Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Downloaded markdown reports use internal lowercase keys instead of display labels for programming languages

Đã đóng Phù hợp với người mới
#246 2 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@SkyDrive2 đang làm issue này rồi.

Từ ngày 9/10/2026.

  • #1 của @SkyDrive2 — đã merge
  • #260 của @SkyDrive2 — đang mở

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
85/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript
Lĩnh vực
frontend

Hướng nghiên cứu

Di chuyển hàm trợ giúp languageLabel từ web/app.js sang web/lib.js và export hàm này để có thể dùng lại giữa các module. Tiếp theo, cập nhật các hàm downloadSavedReport trong web/app.js và buildMarkdown trong web/interview.js để bọc các giá trị language bằng languageLabel() trước khi truyền chúng vào reportMarkdown. Xác minh bản sửa bằng cách tải báo cáo Markdown từ giao diện web và xác nhận tiêu đề phần mã cuối cùng sử dụng nhãn ngôn ngữ đã được định dạng (ví dụ: ## Final code (Python) thay vì ## Final code (python)).

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Observed behavior

When downloading an interview report as a .md file, the heading for the final code section displays the raw, lowercase internal language key (e.g., ## Final code (python) or ## Final code (cpp)).

However, in the web UI (such as the Past attempts history panel), the language is correctly formatted and displays as Python or C++.

Root Cause Analysis

The inconsistency occurs because the Markdown generator receives the raw language key instead of the formatted label:

  1. In web/app.js (around line 1232) inside downloadSavedReport(), the code passes language: attempt.language to reportMarkdown().
  2. Similarly, in web/interview.js (around line 2942) inside buildMarkdown(), the code passes language: state.language.

The formatting helper function languageLabel(value) is currently defined locally in web/app.js (around line 1371), which makes it inaccessible to web/interview.js and missed during the download serialization.

Expected behavior

The downloaded markdown report should be consistent with the web UI and use the proper human-readable label (e.g., ## Final code (Python)), rather than the internal data key.

Proposal
  1. Move the languageLabel function from web/app.js to web/lib.js and export it, so it can be shared across modules.
  2. Wrap the language variable with languageLabel() inside both downloadSavedReport (web/app.js) and buildMarkdown (web/interview.js) before passing it to reportMarkdown.

I have already verified this fix locally and can submit a pull request if this direction is acceptable.

Reproduction
  1. Open the CodeTrial web UI and navigate to the lobby (Past attempts).
  2. Click the "Download report (.md)" button for any completed interview.
  3. Open the downloaded .md file in a text editor.
  4. Scroll to the bottom and observe the heading: ## Final code (python) instead of ## Final code (Python).
    (The exact same issue occurs when downloading the report immediately after a session ends).
CodeTrial version

Built from source (commit 3c8fccd)

Environment

OS: All
Browser: All
Language: Any
Interview loop: N/A
Problem: N/A
REACTO or STAR step: Post-interview (Report Download)
Reconnect: N/A

Sanitized evidence

Downloaded markdown file contains:
## Final code (python)

Expected:
## Final code (Python)

Public data confirmation
  • I removed credentials, session tokens, candidate recordings, and personal interview content from this public report.
Ngôn ngữ chính
Rust
Star
160
Fork
64
Merge trung bình
1 ngày 10 giờ
Pull request đã merge (30 ngày)
112

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của sysprog21/codetrial

Tất cả issue của sysprog21/codetrial

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.