Skip to content

fix(web): IME and Escape keys, connection errors, project action grants and markdown streaming (batch 1855 client) - #751

Merged
trancong12102 merged 1 commit into
mainfrom
fix/batch-1855-client
Nov 24, 2026
Merged

trancong12102 merged 1 commit into
mainfrom
fix/batch-1855-client

Conversation

@trancong12102

@trancong12102 trancong12102 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Follow-ups from the 2026-11-24 upstream syncs and batch 1352 that touch client UI shared by desktop and mobile.

Problems and fixes

Connections and updates

  • Update Everything showed "{host} disconnected" or a fetch error for a server that was already updating. It now checks "already updating" first. A blank connection error no longer leaves a skipped row with no reason. An unsupported client now reads "Client not supported", not "turned off" and not the English-only registry text.
  • An environment mismatch (another Onicode install answering at the saved address) was diagnosed as "did not answer, make sure it is running", with two raw environment ids in the detail. environmentMismatchError is now a server-hop error that says "A different Onicode install answers at this address." Diagnosis has its own branch with advice that also fits LAN roaming. The primary desktop connection gets no "remove this connection" advice, because it cannot be removed. This applies on web and mobile.

Settings

  • Settings → Actions let a client holding only settings:write fill the script form, then fail on submit. Script edits now need both settings:write and orchestration:operate, through projectScriptsPermissionAtom. Reset stays settings-only. serverUpdateSettings joins CLIENT_GUARDED_RPC_SCOPES with patch-based scopes. Mobile does not edit scripts.
  • Diagnostics CPU and resource chart bars could not be reached from the keyboard. Each chart is now one Tab stop, and the arrow keys move between bars and open their tooltips. Each bar is role="img" with its reading as the label.
  • Escape:
    • In a non-text Settings control (selects, switches, the map, a route being dragged), Escape no longer closes Settings mid-interaction. AppRouteModal honours a prevented Escape.
    • The four type="search" fields are now type="text", so Escape no longer triggers the native clear, including during IME composition.
    • The sidebar search clears on Escape when it has a query.

Threads and links

  • The desktop "Thread unavailable" pane had no window header. On frameless windows with the sidebar collapsed, its top strip could not drag the window, and F6 skipped the pane. It is now a workspace area with WorkspacePageHeader.
  • On mobile, a thread link to an unregistered environment redirected to a new draft. Only connected, offline, error and deleted states open a draft now, so the link shows ThreadUnavailableScreen.
  • Linear issue links in desktop HTML renders never opened in the issue panel, because BrowserDocumentFrame did not pass tracker connections. It now does.

Markdown and file preview (shared)

  • markdownChunks:
    • held is now cleared when the last open wrapper closes. Before, a closed <table>/<details> could later be cut through.
    • A complete flag lets callers with a finished text treat its last line as complete. Streaming callers keep the resumable rule.
  • A bare raw HTML <p> got <br> around its inner newlines when line breaks were on. wordsHast now marks raw <p> elements in a second pass, and mobile markdownDocument turns those newlines into spaces.

Shared runtime

  • getCloneDirectoryName: # and ? are now stripped only for URL or SCP-like specs, so firmware#2 and repos/firmware#2.git keep their names.
  • Model search: an exact slug match (for example a pasted opencode-go/deepseek-v4.1-flash) now scores as an exact match and beats prefix matches and favourites.

IME

  • The 61 hand-written isComposing || keyCode === 229 checks in 51 files now use isImeKeyDown, with no change in behaviour.
  • The F6 workspace-focus guard has a browser test.

Flaky ChatView test (Linear badge, shuffle seeds 23 and 42)

  • The app's query cache outlives a test, so a read left pending by one test was never asked again in the next. The fake environment now ends unanswered calls when it is disposed.
  • The two Linear variants use separate workspaces.
  • Tests that rendered without a viewport or with leftover prompt stash state now set both.
  • ChatView.browser.test.tsx passes with seeds 23 and 42, and all 6 fakeEnvironment browser files pass (37 tests).

Verification

  • Tests were extended in the existing files: updateEverything, diagnosis, session, commandPermissions, thread-route-hydration, markdownChunks, fullFileText, wordsHast, mobile markdownHtml, modelSearch, projects, searchFieldEscape, useProjectScriptSettings, EnvironmentRoutesList, AppSidebarLayout (F6 IME), PreviewView and BrowserDocumentFrame.
    • 16 of the 17 changed test files fail with the sources reverted.
    • The F6 test fails without the guard.
  • vp run check:changed passes.
  • Desktop dev app pass:
    • Chart bars move with the arrow keys and show tooltips.
    • The Thread unavailable pane has a header row with the sidebar open and collapsed.
    • Project actions are editable on a full-grant connection.
    • Escape clears the Settings search first, then closes Settings.
    • Escape clears the sidebar search.
  • No mobile device pass. The mobile changes (the route decision, diagnosis input and raw <p> text) are logic with unit tests and no layout change.

Rejected

  • Rewriting 0n pin order keys: only keys written on 0.25.0 are affected. They are the user's own placement and correct themselves on the next reorder. Older mobile builds would also reject a rewrite to 0… keys.

Council review (Antigravity Gemini 4 Neon, xhigh)

Round 1:

  • P1, chat-view Add/Edit/Import ignored the new script grants: fixed. They are hidden without both grants, and there is a new row in ProjectScriptsControl.browser.test.tsx.
  • P1, the wordsHast marker misaligned paragraphs on a <p> in a link destination: fixed. The probe marks nothing unless both renders have the same paragraph count. A document that has both a link-destination <p> and a raw <p> falls back to the old breaks.
  • P2, the probe render ran whenever <p> appeared: the probe now runs only when a bare paragraph has a line break. Math stays on in the probe on purpose, because turning it off can change the paragraph count.
  • P2, nextMarkdownSplit dropped a done-only transition: fixed, with a row added.
  • P2, a single-variant theme mode swallowed Escape: fixed, with a new ThemeSettings browser test.
  • P2, non-script serverUpdateSettings patches skipped the client guard: client and server now share requiredScopesForServerSettingsUpdate. The client still holds only script writes to it (see round 2).
  • P3, </details><details> on one line kept a stale held cut: fixed with per-tag depth tracking, and a row added.
  • P3, mobile raw <p> regex: fixed (custom <p-…> tags and HTML5 block closers), with rows added.
  • P3, mobile Thread unavailable offered Reconnect for an unsupported environment: it now opens Manage environments.
  • P3, fakeEnvironment: calls made between tests now end at once. Effect.die is kept over interrupt, because command handlers read an interrupt as a user cancel.
  • P3, composer-logic IME check: migrated.

Round 2:

  • P2, a full client guard on every settings write would wait up to 6 s for grants and refuse writes that go out on cold grants. The shared settings sync and the model preference migrations depend on those writes, and an unconnected environment would get a false permission error. So the client again guards only script writes, with the shared rule. The server checks every write with the same rule.
  • P2, a wrapper that opened and closed on one line, after an unclosed wrapper had stopped counting, dropped the held cut: fixed, with a row added.
  • P3, a script shortcut kept the edit button's spacing and its hover fade when editing is hidden: fixed.
  • P3, mobile htmlTagMarkdown still matched <p-card>, <div-…> and <details-…> as block tags: fixed, and the assertions are tighter. dialog now ends a raw paragraph.

Rebased onto main, which now carries 9d04a26 (a Settings search Esc fix that overlaps this PR). Main's clearSearchOnEscape is kept, with only the isImeKeyDown migration on top.

A second rebase brought in #753. check:changed then failed twice in Sidebar.browser.test.tsx: a draft named draft-handed-off showed up in its sidebar. That draft comes from a test in ProjectSettingsPanel.browser.test.tsx, which left it in the persisted composer draft store. That test now restores the store when it ends, the same way the Sidebar tests do.

Claude Opus 5.5 (claude-opus-5-5) in Claude Code, inside Onicode.

🤖 Generated with Claude Code

@trancong12102
trancong12102 force-pushed the fix/batch-1855-client branch 3 times, most recently from fa87c58 to 9efb534 Compare November 24, 2026 14:38
…ts and markdown streaming (batch 1855 client)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@trancong12102
trancong12102 merged commit 09f564a into main Nov 24, 2026
18 checks passed
@trancong12102
trancong12102 deleted the fix/batch-1855-client branch November 24, 2026 14:55
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.

1 participant