Add an interview mode filter to interview progress

未关闭
#617 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
78/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
html, javascript, rust
领域
frontend, testing

调研方向

Start with web/progress.js and the existing problemId filter tests in tests/browser/progress.test.js; then trace the filter wiring in web/app.js and the Filter attempts controls in web/index.html. Add mode filtering to the progress model and cover the UI behavior for account and device history in tests/browser/lobby.test.js. Done when Coding, Whiteboard, and All modes filter the attempts and related progress views, including when combined with existing filters.

由索引模型根据 Issue 内容生成。

描述

Observed behavior

Interview progress's "Filter attempts" section offers Problem, Difficulty, Language, and Duration filters (web/index.html:2041-2067), but no filter for interview mode. A Coding (editor) attempt and a Whiteboard attempt sit mixed together in Past attempts and the phase-score charts, even though they score different things (a whiteboard report scores "Board work", not "Coding", per the row labels in #604) and use an unrelated workflow: no editor, no code, no test runner.

Expected behavior

Candidates should be able to restrict Interview progress to only Coding attempts or only Whiteboard attempts. The selection should combine with the existing Problem, Difficulty, Language and Duration filters, and apply consistently to Past attempts, the phase-score charts, topic counts, and weakness summaries, the same way the existing filters already do. Selecting "All modes" should restore the current, unfiltered behavior.

Reproduction

  1. Complete at least one Coding-mode interview and one Whiteboard-mode interview.
  2. Open Interview progress.
  3. Observe that Filter attempts has no control to separate the two; Past attempts and the charts mix both kinds of attempt together.

Environment

  • Source revision: 628237f.

Initial analysis

  • normalizeProgressEntry() in web/progress.js already reads and normalizes interviewMode per attempt (entry.interviewMode ?? entry.report?.interviewMode, through lib.js's interviewMode()), so the value is already present on every normalized entry; no storage or server change is needed.
  • progressModelFrom()'s matches(entry, key) helper (web/progress.js:178-189) already applies one generic filter to problemId, difficulty, language and durationMin; adding "interviewMode" to that list follows the same one-line pattern as each existing filter.
  • progressOptions() (web/progress.js:307-337) would need to also return the distinct interviewMode values present in history, the same way it already does for difficulty, language and durationMin.
  • web/index.html's Filter attempts fieldset (web/index.html:2041-2067) would need one more <select>, alongside Problem/Difficulty/Language/Duration.
  • web/app.js wires each existing <select> through syncFilter() and folds its value into the filters object passed to progressModelFrom() (web/app.js:1925-1943, 2607-2612); a Mode select would follow the same wiring, using lib.js's existing interviewMode()/modeIsWhiteboard() helpers for the two option labels ("Coding", "Whiteboard").

This mirrors the Problem filter added by #389 (PR #501, commit cb6678a), which used this same four-piece pattern (progressOptions, progressModelFrom's matches, the fieldset markup, and app.js's syncFilter wiring) for a different field.

Proposed change

Add a Mode select to Filter attempts, defaulting to "All modes", with "Coding" and "Whiteboard" options sourced from saved history. Combine it with the existing Problem, Difficulty, Language and Duration filters in progressModelFrom(). Apply the resulting attempts consistently to Past attempts, the phase-score charts, topic counts, weakness summaries, and the attempt count. Refresh the options when history changes; a mode with no remaining attempts drops out of the options the same way other filter values already do.

Validation plan

  • Add model regression tests in tests/browser/progress.test.js for interviewMode filtering alone and combined with the existing filters, mirroring the problemId tests already there.
  • Add UI interaction coverage in tests/browser/lobby.test.js for both account and device history, selecting "Coding" / "Whiteboard" / "All modes" and asserting Past attempts and the charts narrow accordingly, mirroring the existing #progress-language coverage.
  • Run ./scripts/test.sh and report results, including anything skipped.
主要语言
Rust
星标
223
派生
148
平均合并
1 天 7 小时
30 天内合并 PR
225

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

sysprog21/codetrial 的其他 Issue

查看 sysprog21/codetrial 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。