Commit Graph

510 Commits

Author SHA1 Message Date
Gille
b26b6c2769 fix(web): isolate PostCSS discovery from ancestor config 2026-10-28 15:15:13 -07:00
Teknium
6da3e5641e fix(web): reload for a failed chunk only into a newer build, once per build
Review on #145357 (@unsupportedpastels):

M1: a failed chunk request reloaded even when nothing was rebuilt (a
network abort, offline). Before reloading, fetch the page's index.html
with cache: no-store and reload only when it names a different built
entry than the running one; skip while offline and in dev. Otherwise
the import rejects as before.

M2: the single tab-wide 5-minute timestamp suppressed recovery for a
later build (A -> B -> C inside the window). The session guard now
records the entry the tab reloaded away from, so a repeat on the same
build (or a reload that lands on it again) is suppressed while a newer
build can still recover.
2026-10-27 20:32:39 -07:00
Teknium
010611bc5e test(web): drive chunk-load recovery through a real vite:preloadError event
The tests called reloadForChunkLoadError directly, so a broken listener in
startChunkLoadRecovery would stay green. startChunkLoadRecovery now takes the
storage and reload seams, and the tests dispatch the event itself: one reload
then suppression, chunk CSS / Safari / Firefox messages, and throwing storage.
Renaming the listened event turns 4 of the new cases red.
2026-10-27 20:32:39 -07:00
Teknium
640b2c21d3 Port from paperclipai/paperclip#17349: reload once when a lazy chunk fails to load
A web UI tab (Webapp / gateway web UI / dashboard) opened before
`hermes update` keeps referencing the old hashed page chunks. The update
rebuilds web_dist with emptyOutDir, so the first page the stale tab opens
404s on its chunk; there is no error boundary, so React unmounts the whole
app and the tab goes blank until the user reloads by hand.

Listen for vite:preloadError (fired for every failed lazy import and chunk
CSS preload) and reload once; index.html is served no-store, so the reload
picks up the new build. A sessionStorage timestamp limits it to one reload
per 5 minutes per tab, and only build chunks under /assets/ qualify, so a
broken plugin bundle never triggers it.
2026-10-27 20:32:39 -07:00
Teknium
428809549a fix(memory): never call an unsaved provider active; refresh readiness after setup
Review on #145574:
- The Settings summary labelled the unsaved memory.provider draft "Active
  memory provider" even when GET /api/memory named another one. The draft
  now shows as "Selected memory provider" (not active yet, naming what
  sessions keep using), and the active row and recall copy come only from
  status.active. A config autosave that touches `memory` refetches.
- Readiness refreshes after an inline credential save, a full-config modal
  save and OAuth completion ($memoryStatusRevision); a failed status read
  shows "Memory status unavailable" with Retry instead of dropping the badge.
- The built-in row reflects memory.memory_enabled / user_profile_enabled in
  Settings ("On by default" where the config isn't loaded), and recall is
  claimed only for a ready provider. Web dashboard copy drops "always on".
- isExternalMemoryProvider matches the backend's full sentinel set,
  including `default`.

Refs #144648 (WA-22)
Refs #145175
2026-10-27 20:32:14 -07:00
Teknium
f70610a4a0 refactor(memory): keep the Memory cards out of the page functions' complexity
The dashboard Memory card moves into its own MemorySection and the
Settings slot decides its own visibility, so SystemPage and
ConfigSettingsInner end no larger than on main (code-health ratchet).

Refs #144648 (WA-22)
2026-10-27 20:32:14 -07:00
Teknium
7a0908c3b1 fix(memory): show the active provider and the always-on built-in layer on every Memory page
An external memory provider is additive: MEMORY.md / USER.md stay loaded
in every session. The Memory surfaces did not say so, and Desktop/Webapp
Settings > Memory & Context showed only the provider select plus the
built-in toggles, so a working provider read as "not in effect".

- Desktop + Webapp: new MemoryLayersSummary (Settings > Memory & Context >
  Persistent memory, and Command Center > Maintenance) names the active
  provider with its readiness from GET /api/memory (or "None - built-in
  memory only") and labels MEMORY.md / USER.md as the built-in layer,
  "Always on". On Settings it follows the live memory.provider draft.
- Dashboard System page: "Active memory provider" and a "Built-in layer -
  always on" label with the additive note, through web i18n.
- MemoryStatusResponse now types the per-provider status the server
  already returns; getMemoryStatus takes the Settings scope profile.

No endpoint change: GET /api/memory already returns active + status.

Refs #144648 (WA-22)
Refs #145546
Fixes #145175
2026-10-27 20:32:14 -07:00
Austin Pickett
681346296c fix(web): write every page header slot from a layout effect
A passive-effect cleanup on the outgoing page runs after the incoming page's
layout effects, so leaving Sessions (the landing route) or Files still erased
the next page's header action, e.g. Channels' Restart gateway. Move the
remaining passive header writers (Sessions, Files, Plugins and Chat's title)
to useLayoutEffect, document the rule on usePageHeader, and cover leaving
Files and Sessions.
2026-10-27 14:27:04 -04:00
Gille
e8b6c9b6ad fix(web): preserve page header actions across route commits
Reset per-page header slots during the route render, before child layout
effects populate them. The parent layout effect previously erased the
Channels restart action on direct load and replacement slots on navigation.

Adapt the provider-reset portion of #45652. The separate hidden ChatPage
writer was already addressed by #72234. Add real Channels and route lifecycle
coverage, including delayed mounting and clearing every previous slot.

Co-authored-by: WompaJango <WompaJango@protonmail.com>
2026-10-27 14:27:04 -04:00
Austin Pickett
82d7e2dba7 fix(skills): match a ClawHub install by source, not through a bare slug alias
The installed map listed each ClawHub lock row under its bare slug as well
as clawhub/<slug>. A bare id carries no source, so with @alice/foo
installed, a `foo` from any other source would also read installed.

HubLockFile.by_identifier now keys a ClawHub row by its lock id and the
source-qualified clawhub/<slug> card id only. Desktop cards install that
id, so they need no change. The dashboard's hub search and featured list
carry a ClawHub skill's bare slug, so web/src/lib/skill-hub-installed.ts
looks a hit up under its own id, then under the id a catalog card would
install for it (skillCatalogInstallIdentifier), which differs only for
ClawHub.

Co-authored-by: unsupportedpastels <theoldwizard123@pm.me>
2026-10-27 10:56:48 -04:00
rob-maron
6adca16a77 Merge branch 'NousResearch:main' into window-plans 2026-10-21 23:07:58 -04:00
Gille
13282fdac4 fix(dashboard): allow safe WhatsApp re-pairing after logout (#142439)
* fix(dashboard): allow safe WhatsApp re-pairing after logout

* fix(whatsapp): retain pairing reservations through credential flush
2026-10-21 10:08:33 -04:00
emozilla
d7c48548a9 feat(shared-metrics): offer two consent answers, drop collect-only
The first-run offer on Desktop, the dashboard and the terminal had a
third answer ("Keep on this computer" / "Collect locally only" / "Local
only") that collected stats nobody reads: no surface shows them to the
user, and data from before an opt-in is never sent. Every surface now
offers "Share with Nous" or "No thanks", and each answer sets `enabled`
and `send` together. Desktop Settings > Privacy and `hermes setup
telemetry` become one on/off choice to match.

Profiles that already chose collect-only keep that answer and are not
asked again: they saw the question and declined to send. Nothing is sent
for them; the Desktop switch reads off and the `hermes tools` row says
"collecting locally".

Copy that described collection as a separate local choice is rewritten
in every locale that carries it (de, es, fr, ja, ru, zh, zh-hant, ar).
2026-10-21 00:32:21 -04:00
rob-maron
0e29e8a25a fix tests 2026-10-20 22:18:49 -04:00
rob-maron
83c5737be2 merge main in 2026-10-20 21:19:31 -04:00
rob-maron
15307dece7 Usage-window plan support 2026-10-20 21:04:30 -04:00
alt-glitch
c5a3c0f876 fix(plugins): address review — dashboard scan override, feed and pin-aware update signal, subdir coverage
- Dashboard: the update route answered a scan block with a bare HTTP 400,
  so the browser page could not show the findings or send force. It now
  passes scan_blocked through (update route only; install is unchanged),
  and the page's update button runs the same consent-then-scan flow as
  Desktop through web/src/lib/plugin-update.ts. AgentPluginUpdateResponse
  moves to web/src/lib/api-plugins.ts (api.ts is over the size cap).
- Saved update checks now record the install they were checked against
  (source, revision, pin). A result is dropped once any of those changed,
  so a --ref pin or a reinstall from another source no longer shows an
  Update button that update refuses. An update_url feed's version target
  is offered too (the old match compared it to a commit and never hit);
  the row field is update_target, a commit or a version.
- Each finding in the Desktop dialog shows its description.
- Tests: a real subdirectory install exercises the re-clone path (caution
  needs force, dangerous refused even with it, refusals leave the tree and
  record alone); the dashboard route returns findings and applies with
  force; the saved signal drops on update, new source and pin.
- locales/_keys.desktop.json regenerated for the new Desktop strings.
2026-10-20 12:26:35 +05:30
KoNit-K
d41b8aafdc fix: support session mutations on insecure origins
(cherry picked from commit e9b0c9cc5f727be592b1fab5af1b14327ca329b2)
2026-10-16 19:20:53 -07:00
unsupportedpastels
da01ee9c3c fix(plugins): run a served profile's dashboard plugins in its own plugin host
On a gateway serving several profiles, dashboard plugins were discovered
from the launch home only and mounted once in the gateway process. A plugin
installed only in a secondary profile answered 404 from that profile's
Desktop window, its plugins.isolation was ignored, and the interim rule ran
the launch profile's copy for it when both profiles enabled the name.

A request scoped to a secondary profile (its native grant or a ?profile=
selection) now gets that profile's own plugins, served through its own
plugin host (the existing per-profile host and its asgi op, bound to that
profile's home and secrets) whatever its isolation setting says. Their code
is never imported into the gateway.

- Discovery: the profile's own plugins/, then the root ~/.hermes/plugins
  (as a standalone `hermes --profile X serve` scanned before the cutover),
  then bundled; the profile's own copy wins a name clash. Root plugins also
  run in that profile's host.
- Consent: the requesting profile's plugins.enabled/disabled decide; the
  launch profile's consent no longer gates them. Disabled, not enabled and
  unknown names get identical answers (404 on HTTP, a 1008 close before
  accept on a websocket).
- Bundled plugins are Hermes code: a secondary profile uses the in-process
  router only when it is that profile's own bundled copy (the imported
  module's file, or for a cold mount the copy that would be mounted), and
  the cold mount binds the request's ?profile= before deciding. Otherwise,
  for example when a launch-profile user plugin shadows the bundled name,
  the request goes to the profile's host.
- Credentials: the session token, native grants, the Authorization and
  Cookie headers, and the gateway's query keys (token, ticket, internal,
  display_ticket, attach, profile; URL-decoded, every repeat) are removed
  before the request reaches the host. Ordinary plugin parameters pass.
- Assets: /dashboard-plugins/@<profile>/<name>/<file>, and
  /dashboard-plugins/... with ?profile=, bind that profile for the lookup
  and consent check (traversal and file-type checks unchanged; an unknown
  profile answers like an unknown plugin). The dashboard builds the path
  form, so files a stylesheet or bundle loads by relative URL come from
  the same profile. Its plugin loader binds its list request, asset URLs
  and loaded plugins to the selected profile and drops a list that lands
  after a switch; leaving a profile always removes that profile's
  stylesheets and bundles, even after its list became empty. A ?profile=
  rescan refreshes that profile's own cache.
- Plugin SDK: fetchJSON and authedFetch scope /api/plugins/ requests to
  the selected profile with ?profile=, and plugin sockets carry it too; a
  profile the plugin passes itself wins.
- The launch profile is unchanged.

The host protocol is request/response, so an authenticated websocket to a
secondary profile's hosted plugin gets a named refusal (HTTP 501 before
accept) instead of running in-process.

Tests that relied on a secondary profile reaching the launch copy now use
that profile's own copy (through a real host) or a bundled probe, and a
consent and refusal matrix covers both ways of selecting a profile.

Refs #134889 (PLG-3)
Refs #139523
2026-10-16 19:15:07 -04:00
Teknium
27141aa0e4 fix(plugin-catalog): CLI, dashboard and Desktop tell verified apart
- `hermes plugins search/browse` labeled every non-official entry
  "community" and sorted verified with community; it now prints the real
  tier and orders official, verified, community (review finding).
- Dashboard `CatalogEntry.tier` allows "verified" (review finding).
- Desktop tier pill: official in the accent colour, verified green with a
  check, community stays neutral, so verified reads differently from the
  other two at a glance.
2026-10-16 14:31:11 -07:00
Teknium
620f3b3b45 feat(plugin-catalog): add a Nous-granted verified tier
Verified entries come from the company that makes what the plugin integrates,
confirmed by the Nous team. Only maintainers set official/verified (CODEOWNERS
review; no CI check inspects the value). Tier order everywhere: official,
verified, community. Desktop's installed-plugin pill now reads the same
catalogInstall.tier map as the install card, dropping the duplicate
skills.plugins.tierOfficial/tierCommunity keys.
2026-10-16 14:31:11 -07:00
Teknium
2cd0ec8686 Merge origin/main into feat/unified-gateway-runtime
215 commits from main (c70332f888). One textual conflict: the generated
apps/shared/src/gateway-contract.generated.ts, regenerated with scripts/gen_gateway_contracts.py
rather than hand-merged. Brings main's fix for the dated shared-metrics install-receipt test
(783637e370).
2026-10-13 05:15:48 -07:00
Teknium
812bb55ac6 refactor: keep the rollback wiring inside the code-health caps (#137714)
The statusbar rows share one versionItem builder and depend on the status
objects, the version tooltip moves its "what is waiting" lines into
pendingLines, the overlay status line into availableLine, and the dashboard
badge/toast into helpers; the dashboard payload carries one `rollback_to`
version instead of two fields.
2026-10-13 04:42:06 -07:00
Teknium
e36fa7ba6b fix(update): --version, the dashboard and a remote backend name a stable rollback too (#137714)
`hermes --version` printed "Update available", the dashboard badged
"update available" and the Desktop overlay for a remote backend said a
new update was ready, all for a stable release the checkout already
contains. Each now names the move back to that release. Also keeps the
install.ps1 if/else on one line.
2026-10-13 04:42:06 -07:00
Teknium
1bb22926ee Merge origin/main (#20: 54 commits to c538ec5f40) into feat/unified-gateway-runtime
No conflicts.
2026-10-07 15:22:46 -07:00
Austin Pickett
9d7a4ab718 fix(dashboard): hide AuthWidget on 401 via ApiError status
fetchJSON now throws ApiError with a humanized message, so the
widget's legacy `msg.startsWith("401:")` check never matched and a
401 from /api/auth/me rendered "auth status unavailable" instead of
nothing. Read the status off the error object.

Part of GH issue 66223 (loopback /api/auth/me).
2026-10-07 17:13:07 -04:00
Tranquil-Flow
0f56e56a24 fix(dashboard): repair loopback auth identity frontend integration (#66295) 2026-10-07 17:13:07 -04:00
Teknium
cff27bd30f Merge origin/main (#19: 14 commits to 2943ee6f19) into feat/unified-gateway-runtime
No conflicts.
2026-10-07 10:58:02 -07:00
ethernet
2943ee6f19 fix(ts): npm run fix 2026-10-07 13:42:42 -04:00
Austin Pickett
ef0c635f33 refactor(web): move session source config to SessionsPage_sources sibling; satisfy code-health ratchet 2026-10-07 11:18:50 -04:00
Austin Pickett
d199cc2465 test(web): behaviour coverage for structured reasoning transcript rendering
RED on main: the expanded session transcript renders assistant
reasoning with literal <thinking>/<action>/<result> wrapper tags.
Keeps the user-role invariant (literal tags stay on the Markdown path).
2026-10-07 11:18:50 -04:00
giggling-ginger
85d7a896d0 fix(web): scope structured reasoning UI to assistant messages
Only assistant content with known reasoning tags uses StructuredReasoning.
User and tool messages with literal <action>/<result> tags stay on Markdown.
2026-10-07 11:18:50 -04:00
giggling-ginger
cdda67f83f Fix reasoning markup rendering in dashboard 2026-10-07 11:18:50 -04:00
Teknium
ca38632fc0 Merge origin/main (#17: 454 commits to e6757f2029) into feat/unified-gateway-runtime
12 conflicted files, resolved in three lanes:
- gateway/run.py: take the branch split; main's tirith removal and spool-replay
  ordering ported into run_runtime_init.py / run_bootstrap.py.
- config migrations: main keeps v50 (tirith); the branch's bot-chat timeout removal
  becomes v51 (_config_version 51, template + test updated).
- hermes_state_usage.py: main's voice_chat task route threaded through the branch's
  owner transaction; worker.persist usage allowlist accepts task.
- tui_gateway/server.py: branch side; main's edits applied where the code now lives
  (agent_factory, session_registry). Desktop sessions get the catalog toolset on the
  authority path; daemon-run finite CLI turns are not watched turns; lazy session info
  reports nous/welcome on the free tier.
- Desktop/Ink: one branch-child spinner fix (main's route-token check); main's
  uninstall i18n keys kept, pool keys stay removed; voice_turn forwarded and accepted
  by the authority submit (surface_v1.voice_turn).
- chat_ws / PTY keepalive test: main's stricter test kept.
2026-10-07 06:48:09 -07:00
Teknium
6cc1efd8f9 feat(voice): auxiliary.voice_chat routes spoken voice turns to their own model
Voice replies had to come from the session's main model, so a heavy model made every spoken
answer slow (#83894). A new auxiliary slot, voice_chat, picks the model for voice turns:

- CLI/TUI voice mode, the Desktop voice conversation (prompt.submit voice_turn) and messaging
  voice notes mark the turn; agent/voice_turn_route.py binds the route after the prompt, row and
  preflight compaction were settled against the main model and undoes it before memory sync and
  background review, so the next typed turn and the review run on the main model.
- A turn larger than the voice model's compression threshold stays on the main model with a
  one-time notice: switching to voice never compacts the conversation.
- Usage lands in session_model_usage under task voice_chat; it never rewrites the session's
  recorded model/route, so resume keeps the model the user picked.
- Slot appears in Desktop Settings -> Models, the dashboard, and `hermes model`; GPT-Live
  delegations keep using the session model.
2026-10-07 01:35:11 -07:00
andyst-dev
1ac3f97fbe fix(dashboard): enable touch scrollback in chat 2026-10-06 17:39:35 -04:00
Teknium
1e500ebce2 Merge origin/main (#16: 4,465 commits to 9dcab1e440) into feat/unified-gateway-runtime
99 conflicted files resolved in nine area lanes (Desktop composer, Desktop renderer/shared
client, Electron main, Ink, tui_gateway, gateway, state, CLI/config, cron/tools/CI). The
unified runtime's architecture wins where it deliberately replaced a mechanism (pool,
fallback lanes, claim poller, renderer queue); every orthogonal main change is kept, ported
into the <stem>_<topic> sibling that now owns relocated code.

Notable ports and repairs in this merge:
- tui_gateway/server.py relocated regions: atomic _attach_built_agent (#49852), slash ranking
  registry names, minted-key helpers methods_session.py calls, request_overrides, service tier.
- gateway/run_turn*.py: i18n accessors for the removed reply constants, first-contact
  internal/DM rule, rotated-compression persist, fast-mode tiers, prompt-pin rehydration.
- webhook: route_from_chat_id decodes main's opaque webhook:v2 chat ids (old ids still read).
- ws.py: main's per-connection dispatch queue with authority-first dispatch inside it.
- state: schema event for runtime revision renumbered to 31; worker mirrors updated for
  main's message uid/merge fields, on_contended lease arg, compression columns.
- config: branch's bot_chat_delivery_timeout removal renumbered v47 -> v50.
- Electron: primary-profile pin, redirect header scoping, remote fetchJsonForBackend, SSH
  teardown on profile delete, held-update dial gate restored (lost in earlier merges).
- Desktop: canonical clarify.request mapped to main's questions[] card; replay truncation vs
  snapshot_required; periodic secondary prune tick restored; DELETE already_absent restored.
- cron/tools: diagnostic category on cron failure notices restored; owner_holds_delivery
  ported onto the authority; admitted receipts can no longer be cancelled locally.
2026-10-06 14:24:24 -07:00
Teknium
eb6a3886f1 fix(dashboard): ChatSessionList test type-checks under tsc -b
#134100 added a test that assigns globalThis.IS_REACT_ACT_ENVIRONMENT directly
(TS7017) and destructures ghost/outlined/size from a plain ButtonHTMLAttributes
prop type (TS2339). Vitest strips types, so the test passes, but `tsc -b` in the
web build fails, which breaks every Docker image build and the Desktop update
E2E seed on main. Cast globalThis like the sibling tests do and widen the mock
prop type with the three props it consumes.
2026-10-06 14:22:13 -07:00
Austin Pickett
5e836abd90 refactor(dashboard): move the copy-last button into a chat-copy-last-button sibling
Offset ChatPage.tsx growth (the isActive prop for ChatSessionList) per the
code health ratchet: the floating copy-last response button moves verbatim
into web/src/lib/chat-copy-last-button.tsx. No behaviour change.
2026-10-06 15:31:39 -04:00
Austin Pickett
da1bf112a2 fix(dashboard): use react-router MemoryRouter in ChatSessionList test 2026-10-06 15:31:39 -04:00
debaditya
d81d4ac33f fix(dashboard): pause session refresh off chat route 2026-10-06 15:31:39 -04:00
debaditya
39ac8f2b25 fix(dashboard): refresh chat session switcher 2026-10-06 15:31:39 -04:00
Austin Pickett
35f0b4b569 fix(dashboard): route native text paste through term.paste to stop last-char duplication
A native/DOM paste on the chat terminal (context-menu paste, middle-click,
or any Ctrl+V route that bypasses the keydown interception) fell through to
xterm's own paste listeners. xterm clears the hidden textarea during the
paste dispatch, but the browser's default action — inserting the pasted
text into that textarea — runs after dispatch, so a stale value survives
and the next typed character is duplicated (#52471: "when" → "whenn").

The host capture-phase paste handler now cancels the native paste for
plain text and delivers it via term.paste() exactly once — the same clean
route the Ctrl/Cmd+V keydown interception already uses. Image pastes keep
their upload path and are never routed as text.

Supersedes #52477 (credit: @liuhao1024 — same interception, extended with
the image route preserved and regression coverage).

Fixes #52471
2026-10-06 13:00:43 -04:00
Austin Pickett
3225f357a5 fix(dashboard): show broken links as non-actionable entries in Files page
Backend listings now emit broken_link: true placeholder entries with
nullable mtime for dangling symlinks. Update ManagedFileEntry to match,
render broken links with an Unlink icon and a destructive badge, disable
download for them, and keep delete enabled so users can remove the dead
link from the UI.
2026-10-06 12:30:01 -04:00
Austin Pickett
0620913eac fix(dashboard): gate the chat WebGL renderer and fall back to DOM
The chat terminal loaded @xterm/addon-webgl for every wide host with
nothing but a constructor try/catch. Three failure classes escaped it:

- Safari's WebGL atlas garbles Unicode box-drawing glyphs (#18773)
- software rasterizers (llvmpipe/SwiftShader) advertise WebGL but regl
  throws '(regl) webgl not supported' from inside the addon (#45520)
- the per-glyph atlas cannot shape complex scripts, so Bengali
  conjuncts render broken (#58685)

Gate the addon behind a pre-flight probe (real context + non-software
unmasked renderer, released immediately) and a Safari UA check, both in
a new pure module; when shaped-script text arrives over the PTY, drop
the live addon so xterm re-renders through the DOM renderer, whose text
shaping handles conjuncts. Context loss already disposed the addon.
2026-10-06 12:26:53 -04:00
Austin Pickett
aa30e02d86 fix(dashboard): badge follows the PTY runtime model, not config, during fallback (#54509) 2026-10-06 11:44:38 -04:00
Austin Pickett
dca25fe74d refactor(web): extract terminal appearance helpers; satisfy code-health ratchet
ChatPage.tsx crossed its FILE_LINES cap and the ChatPage function its
FUNC_LINES cap once the #36784 accessibility lines landed. Move the
module-level theme/font-tier helpers to web/src/lib/terminal-appearance.ts
(the ratchet's sanctioned remedy — moved code keeps its cap) and tighten
the new comments. No behaviour change: same helpers, same values.
2026-10-06 11:44:32 -04:00
Austin Pickett
fe6eb7f976 test(web): assert composer screen-reader mode behaviourally (#36784)
Replace the static source-text assertions with behavioural tests that
render ChatPage against a capturing FakeTerminal and observe what
assistive technology observes: the Terminal is constructed with
screenReaderMode: true, the host div is a labelled role=region, and the
single registered key handler lets Tab escape (WCAG 2.1.2) while other
keys still reach the terminal. Proven RED on base, GREEN with the fix.
2026-10-06 11:44:32 -04:00
David Metcalfe
a29eb0d8e0 fix(web): fold Tab escape into existing xterm key handler (#59091 review)
Teknium's review of the original PR flagged that the new
`term.attachCustomKeyEventHandler` at line 540 silently overwrote
the clipboard handler at line 464 — xterm.js stores a single
`_customKeyEventHandler` per Terminal
(node_modules/@xterm/xterm/src/browser/CoreBrowserTerminal.ts:914,
`this._customKeyEventHandler = customKeyEventHandler;`) and assigns
overwrites later registrations, so the Tab escape branch never
executed.

The rework folds the Tab branch into the existing handler at the
top (right after the type guard) so only one handler is registered.
The ARIA region and screenReaderMode additions remain untouched.

Adds web/src/pages/ChatPage.a11y.test.ts — regression test asserting
that `screenReaderMode: true` is set, the host div carries
`role="region"` + `aria-label=`, exactly one
`term.attachCustomKeyEventHandler(` call exists, and the single
handler contains the Tab-escape branch + keydown guard. Verified the
test fails on the original PR diff (catches the regression) and
passes on the rework.

Closes inline review thread at #59091.
2026-10-06 11:44:32 -04:00
David Metcalfe
cc26049c52 fix(web): enable screen-reader mode for chat composer (#36784)
The web UI chat composer uses xterm.js, which renders to a canvas
invisible to VoiceOver/NVDA. Add screenReaderMode: true to create
the offscreen textarea screen readers need, a Tab escape handler to
prevent keyboard traps (WCAG 2.1.2), and an ARIA region label on
the host div.
2026-10-06 11:44:32 -04:00