Skip to content

Replace language buttons with a dropdown - #335

Open
Ericchenbang wants to merge 2 commits into
sysprog21:mainfrom
Ericchenbang:language-dropdown
Open

Ericchenbang wants to merge 2 commits into
sysprog21:mainfrom
Ericchenbang:language-dropdown

Conversation

@Ericchenbang

@Ericchenbang Ericchenbang commented Oct 17, 2026 •

Copy link
Copy Markdown

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
螢幕擷取畫面 2026-10-17 121334

After: dropdown
螢幕擷取畫面 2026-10-17 121534


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.

View guided diff

cubic-dev-ai[bot]

This comment was marked as resolved.

page,
/data-language="python"/,
"the language tabs drive setLanguage",
"the language selector drives setLanguage",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread web/interview.js Outdated
Comment thread web/interview.js
Comment thread web/interview.js Outdated

@jserv jserv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Squash commits and refine commit messages.

@Ericchenbang
Ericchenbang force-pushed the language-dropdown branch 2 times, most recently from cd1cba1 to 4a8e86c Compare October 17, 2026 16:24
@jserv
jserv requested review from ColtenOuO and alanhc October 17, 2026 16:26

@ColtenOuO ColtenOuO left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please improve the commit message follow according to the project's rules.

@jserv

This comment has been minimized.

1 similar comment
@jserv

jserv commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Rebase latest main and resolve conflicts

Comment thread tests/browser/editor-pipeline.test.js
Comment thread web/interview.html Outdated
Comment thread web/interview.html Outdated
Comment thread web/interview.js
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants