fix(jarvis-web): router-navigate docs button (#477) + gate Tab-to-cycle on empty composer (#478) - #488
Draft
TYRMars wants to merge 1 commit into
Draft
fix(jarvis-web): router-navigate docs button (#477) + gate Tab-to-cycle on empty composer (#478)#488TYRMars wants to merge 1 commit into
TYRMars wants to merge 1 commit into
Conversation
…le on empty composer (#478) #477 — AppChatPane docs button did a hard `window.location.href = "/docs"` inside an SPA. In browser mode this tore down the chat WebSocket, in-flight stream, composer value, and staged attachments for what should be a client-side route change; in the desktop shell (HashRouter) a hash-less `/docs` reload rendered `/` (chat) instead, or a dead `file:///docs` page before the sidecar was healthy. Switch to `useNavigate()("/docs")`, matching the rest of the app's navigation. #478 — Composer's bare-Tab handler cycled the permission mode and `preventDefault()`'d unconditionally, regardless of textarea content. That silently flipped the permission mode (and could pop the bypass confirm) when a user pressed Tab mid-typing, and trapped forward keyboard focus in the composer even when nothing happened. Add the `value.length === 0` guard the handler's own comment already describes, matching the adjacent Backspace branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ltebc8xx243roKDvh9Dy9X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auto-resolves two open
jarvis-webbug reports. Both target real code in the current tree; each fix is minimal and follows patterns already established elsewhere in the SPA.#477 — docs button does a hard document navigation
apps/jarvis-web/src/components/AppChatPane.tsx— the "open docs" composer button usedwindow.location.href = "/docs", a full-document navigation inside a react-router SPA.HashRouter): routes live in the hash, so a hash-less/docsreload rendered/(the chat surface) instead of docs; before the sidecar was healthy the window was onfile://, where/docsresolved to a deadfile:///docspage.Fix: call
useNavigate()("/docs"), matching the rest of the app's navigation. There is already a/docsroute inApp.tsx, anduseNavigateis used across the SPA (DocsPage,ProjectsPage,AppSidebar, …).#478 — bare Tab cycles permission mode regardless of composer content
apps/jarvis-web/src/components/Composer/Composer.tsx— theonKeyDownTab branchpreventDefault()'d and calledcyclePermissionMode()whenever the slash palette was closed and no modifier was held, never checking that the textarea was empty (which the handler's own comment claims it does).window.confirm).preventDefault()ran beforecyclePermissionMode()'sif (!isOpen()) returnearly-out, so forward Tab never moved focus even when nothing else happened.Fix: add the
value.length === 0guard to the Tab branch, matching the adjacent Backspace branch that already gates on empty content. Non-empty Tab now falls through to normal browser focus traversal / indent.Notes
DesktopStartupOverlay.onConfigureProvider/SETTINGS_TARGET_KEY) references code that does not exist in this branch'sDesktopStartupOverlay.tsx, so it is not addressed here.node_moduleshere, and the sandbox's newernpx tscerrors on a pre-existingbaseUrltsconfig deprecation unrelated to this diff. The changes are small and use existing, widely-used APIs.🤖 Generated with Claude Code
https://claude.ai/code/session_01Ltebc8xx243roKDvh9Dy9X
Generated by Claude Code