Skip to content

[fix] canvas: one switch in Settings, not two - #498

Open
Zhangbo-cn wants to merge 6 commits into
ThinkFlowLab:mainfrom
Zhangbo-cn:fix/model-setup-language
Open

Zhangbo-cn wants to merge 6 commits into
ThinkFlowLab:mainfrom
Zhangbo-cn:fix/model-setup-language

Conversation

@Zhangbo-cn

@Zhangbo-cn Zhangbo-cn commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The same interface language switch appeared twice in one Settings dialog. Opening Model connections showed an Interface language select in the panel's top-right corner, while the General tab showed the language setting under its own label. Both edited the same preference, so moving one moved the other with nothing on screen saying they were the same value.

This removes the copy inside the model connections panel. Settings → General remains the settings entry, and the welcome screen keeps its own switch because it is what a first-time user sees before a project with settings exists. No message key is added or removed: the welcome screen still uses modelSetup.language, so the key stays in use.

Changes

  • src/canvas/ModelSetup.tsx: drop the language select and the now-unused locale/setLocale binding.
  • src/canvas/model-setup.css: drop the two styles that only positioned that select.
  • tests/browser/first_run.mjs: the first-run journey now asserts the model connections panel renders no #model-setup-language and that Settings → General still exposes #settings-language with the active locale, in both languages at 390 px and 1440 px.

Linked issue

No issue is linked; the scope is the duplicated control described above.

Evidence

Steps: the isolated fixture API and Vite served a project. The browser opened its Settings dialog on Model connections (?setup=models, setup preference seeded so the dialog opens directly), then switched to the General tab. The viewport was 1440 × 900; the published images crop the dialog to 900 × 620, in English and Chinese.

Before (728b4077): the model connections panel shows Interface language in its top-right corner, next to the close button.

Before, English: the language select sits in the model connections panel (728b4077)

Before, Chinese: the same duplicate select (728b4077)

After (c986ee6d): the panel shows only the close button in that corner; the category rows and footer are unchanged.

After, English: the panel keeps no language select (c986ee6d)

After, Chinese: the panel keeps no language select (c986ee6d)

The single remaining settings entry is Settings → General, whose language row is unchanged:

After, English: General keeps the one language switch (c986ee6d)

After, Chinese: General keeps the one language switch (c986ee6d)

Failing before, passing after: the updated first_run.mjs was copied onto 728b4077 and run against the base revision:

BASE SHA: 728b40774628307f315a2b29c466237a8c434a11
$ node tests/browser/first_run.mjs
AssertionError [ERR_ASSERTION]: the model setup panel keeps no second language switch
1 !== 0
    at file:///tmp/od499-base/tests/browser/first_run.mjs:408:14

On the head the same file passes (Browser first-run workspace selection, model setup, cancellation and retry passed).

Test plan

Local, on the head tree (c986ee6d; e2bce233 has the same tree):

  • node_modules/.bin/tsc --noEmit — passed
  • npm test — 1111 passed, 0 failed
  • npm run check:i18n — 3839 keys, 0 problems, 170 Chinese source lines (baseline 170)
  • npm run check:browser-locale — 101 pages, 0 problems
  • npm run check:browser-manifest — 109 entries, gate=37
  • node tests/browser/first_run.mjs against the isolated fixture API and Vite at this head — passed
  • The same test file on 728b4077 — failed at line 408 (output above)
  • Before/after screenshots captured at both revisions in both languages (above)

Left to CI: Release checks on the pushed head, including the gate lane that runs first_run.mjs. No other browser lane and no desktop package was run locally.

The previous Release run on 18c5840f (run 46914029505) failed checks / python at the setup of test_real_opencode_native_visual_input[image-model] with AssertionError: Real OpenCode integration timed out (2_checks _ python.txt in the run log). That lane does not exercise frontend code, so this body does not attribute the failure to the diff. The branch then merged current main (728b4077) and pushed e2bce233; run 47332260956 completed on that head with every job passing, including checks / python (job 145039030071, 22m28s) and the aggregate checks / checks (job 145050937013).

Provider verification

No real provider was called. The browser journey uses the isolated fixture API and a local Vite build; the models shown in the screenshots are fixture entries.

Bilingual UI

No message key or translation changed; the duplicate label was removed from the panel. Both zh-CN and en-US were exercised in the browser test and captured in the screenshots.

Review

  • Reviewed base: 728b40774628307f315a2b29c466237a8c434a11 (origin/main)
  • Reviewed head: e2bce233031f0ad83d2ed7da380708baea91e1bb. e2bce233 is an empty retrigger commit whose tree equals c986ee6d's, made after the previous run flaked in an unrelated browser lane.
  • Self-review (opendirector-review, candidate mode): 93/100 on that tree. Ratings: scope 3/3, correctness 3/3, validation 2/3 (Release checks had not run at review time), claim evidence 3/3 (before/after captures in both languages at the pinned base and head, steps, and a failing-before run), simplicity 3/3 (comments removed, no new state; the CSS and key cleanup is minimal). No blocking code finding.
  • Self-review findings, all non-blocking: the test asserts the removed control only on the model connections panel; the welcome screen's #welcome-language is untouched but not asserted, so its retention rests on the unchanged source. The screenshot path seeds the setup preference to open Settings directly, which is suitable for a visual capture but is not itself the tested journey.
  • Independent candidate review (non-contributing subagent, same skill and pinned base/head): 90/100, PASS after a re-check of the corrected body and the settled run. Ratings: scope 3/3, correctness 3/3, validation 3/3, claim evidence 2/3, simplicity 3/3. The initial pass was a WITHHOLD because run 47332260956 was unfinished and the body carried a false sentence about the earlier Python log; the re-check confirmed the corrected sentence, the updated reviewed head, and the settled run, and recorded that the remaining wording deductions clear to 100/100 once applied. It verified the empty retrigger diff and identical trees, the 3-file base..head diff, tsc, npm test 1111/0, and the three repository checks; it confirmed all six evidence images return HTTP 200 and show the described states; it read the CI jobs for e2bce233 (all jobs pass, and the isolated browser lane's log shows the first-run journey passing); and it retrieved the retired run's Python log, which shows AssertionError: Real OpenCode integration timed out. It did not run the browser journey locally (missing Playwright system library, then a port collision) and did not re-capture the screenshots.
  • Findings after this revision: B1 (false prior-log sentence) is corrected above and the log's actual failure cause is stated; N1 (stale reviewed head and check state) is corrected; N2 (imprecise "no user-facing copy" wording) is corrected; N3 and N4 ask for a positive panel-render assertion and for capturing through the tested journey — both are sound improvements left unaddressed to keep the diff at three files, and neither indicates a defect.
  • Material validation gaps: no local browser run (the independent reviewer's Playwright shell was missing a system library, then a Vite port collided); the passing browser evidence is CI's isolated lane. The other browser lanes and the desktop packages passed in CI but were not run locally.

🤖 Generated with Claude Code

@github-actions github-actions Bot added area:canvas Canvas, nodes and direct manipulation area:i18n Localisation and bilingual UI type:bug Something is broken labels Nov 25, 2026
Settings -> General already has the interface language, and the welcome screen offers it before a project exists. The model setup panel repeated the same control in its top-right corner, so the same setting appeared in two places depending on which panel happened to be open, with nothing indicating they were the same value.

The setup panel now opens on the thing it is for: which models are missing. The key it used stays, because the welcome screen still labels its switch with it.
@Zhangbo-cn
Zhangbo-cn force-pushed the fix/model-setup-language branch from 7c013e8 to 55ffecc Compare November 25, 2026 03:56
@kunkunblueberry

kunkunblueberry commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

PASS 55ffecc

  • Removes the duplicated language select from the model setup panel. #settings-language and #welcome-language remain, and ModelSetup renders inside ModelSettings and WelcomeScreen, so a switch is still reachable in both places the panel appears.
  • Keeping the modelSetup.language key is correct: the welcome screen labels its own select with it, so deleting the key would have broken that string. Naming check:i18n as the check that would catch that is the right instrument.

Two template gaps I am recording but not blocking on: the body uses "What / Verification" instead of the template sections, and a user-visible removal has no screenshot and no N/A line. For a pure deletion with an automated key check behind it I accepted that; the next removal in this panel should carry the evidence section.

Ran: gh pr checks 498 on 55ffecc (13/13); read the full diff (2 files) and traced where ModelSetup is rendered on main.
Not run: tsc, check:i18n or the browser lane locally.

Zhangbo-cn and others added 4 commits December 2, 2026 22:19
Removing the duplicated select from the model setup panel left the workflow
reading #model-setup-language and switching the locale through it. The workflow
now asserts the panel keeps no second switch and uses #settings-language.
Co-Authored-By: Claude Code <noreply@anthropic.com>
@Zhangbo-cn Zhangbo-cn changed the title [fix] canvas: one interface language switch, not three [fix] canvas: one switch in Settings, not two Dec 4, 2026
Co-Authored-By: Claude Code <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:canvas Canvas, nodes and direct manipulation area:i18n Localisation and bilingual UI type:bug Something is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants