Repository navigation
Replace language buttons with a dropdown - #335
Ericchenbang wants to merge 2 commits into
Conversation
| page, | ||
| /data-language="python"/, | ||
| "the language tabs drive setLanguage", | ||
| "the language selector drives setLanguage", |
There was a problem hiding this comment.
Only this message was updated, but about 30 browser tests still drive the old buttons: document.querySelector('[data-language="javascript"]').click() in editor-pipeline, candidate-cases, run-shortcut, comment-shortcut and syntax-parser-browser, plus waitForSelector('[data-language="cpp"].selected'). That selector now matches an <option>, so click() dispatches no change and setLanguage never runs, and waitForSelector times out because an option is never visible. scripts/browser-check.cjs has the same problem, since getByRole("button", { name: language }) finds nothing now. Switch them to page.selectOption("#language-select", language), and assert #language-select's value instead of .selected.
jserv
left a comment
There was a problem hiding this comment.
Squash commits and refine commit messages.
cd1cba1 to
4a8e86c
Compare
4a8e86c to
b1f636c
Compare
ColtenOuO
left a comment
There was a problem hiding this comment.
Please improve the commit message follow according to the project's rules.
b1f636c to
8109e4f
Compare
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
Rebase latest |
8109e4f to
4c2e1cf
Compare
4c2e1cf to
9096f70
Compare
This keeps language choices easy to scan as the supported list grows, without crowding the interview toolbar.
Advance caption pacing directly in the browser test. This keeps long-caption assertions fast and avoids a timed-out virtual-clock run.
9096f70 to
9f40372
Compare
Replace the horizontal language buttons with a dropdown to keep the interview toolbar compact and make it easier to add more supported languages. The selector also follows a familiar pattern used by platforms such as LeetCode.
Before: horizontal language buttons

After: dropdown

Summary by cubic
Replaces the horizontal language buttons in the interview toolbar with a dropdown selector so the toolbar stays compact and adding more supported languages is easier.
Selecting a language still switches the editor buffer and updates the agent as before. Languages the judge can't run are disabled and labeled with their reason (for example "(unavailable: class problem)"), each keeping a tooltip with the full explanation. The selector snaps back to the active language whenever the editor rejects a switch — for example keeping it locked on the submitted language while the report modal is open. Browser tests were updated to drive the selector instead of clicking language tabs, and the caption test paces captions directly instead of waiting on a wall clock.
Written for commit 9f40372. Summary will update on new commits.