#17765: fix: add link to settings when chat shows auth error
app: web-ui
size: XS
trusted-contributor
Cluster:
UI Enhancements and Security Fixes
## Summary
When the Control UI chat tab shows an "unauthorized" or "gateway token missing" error, users now see a clickable link to navigate to Settings where they can add their gateway token.
Previously, users who opened the Control UI directly at `/chat?session=main` would see the auth error but had no way to navigate to settings to add a token - they were stuck in a loop.
## Changes
- Added `onGoToOverview` callback prop to chat view
- When chat shows auth error (unauthorized, token missing, connect failed), displays a "Go to Settings to add a gateway token" link
- Clicking the link navigates to the overview tab where the token input field is available
## Testing
- TypeScript type checks pass
- UI builds without errors
Fixes #17745
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds a helpful navigation link when the chat view displays authentication errors. When users see "unauthorized" or "connect failed" errors, they can now click a link to navigate to the overview tab where the gateway token settings are located.
The implementation:
- Adds an optional `onGoToOverview` callback prop to the chat view interface
- Wires the callback to `state.setTab("overview")` in the app render component
- Conditionally displays the "Go to Settings to add a gateway token" link when auth errors are present
- Uses the existing `.session-link` CSS class for consistent styling
- Follows the same error detection pattern as `overview.ts` (checking for "unauthorized" and "connect failed")
The previous review comment about redundant "token missing" check has been addressed in commit `18653b5e`.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The changes are simple, well-scoped, and follow existing patterns in the codebase. The implementation adds an optional callback prop and conditionally renders a navigation link, with no breaking changes or complex logic. TypeScript types are properly defined, the CSS class exists, and the tab name is valid. The previous review feedback has been addressed.
- No files require special attention
<sub>Last reviewed commit: 18653b5</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#15965: feat(ui): show inline token input on Chat page when auth fails
by alextnetto · 2026-02-14
84.7%
#18273: fix: extract token from URL query string for Control UI websocket auth
by MisterGuy420 · 2026-02-16
79.5%
#6352: fix(ux): update gateway token error message UI location
by Glucksberg · 2026-02-01
77.3%
#10093: fix: import gateway token from URL param into localStorage
by devjiro76 · 2026-02-06
77.2%
#11527: feat(control-ui): UX improvements — Enter key, thinking icon, auto-...
by Annaxiebot · 2026-02-07
75.8%
#9218: Fix Control UI chat resync on gaps and terminal events
by figitaki · 2026-02-05
75.3%
#10800: fix(ui): apply token from URL param to settings
by callebtc · 2026-02-07
75.2%
#13960: fix(ui): preserve structured config validation error details
by constansino · 2026-02-11
74.6%
#20422: Fix/tailscale device pairing
by slagyr · 2026-02-18
74.5%
#17378: fix(gateway): allow dangerouslyDisableDeviceAuth with trusted-proxy...
by ar-nadeem · 2026-02-15
74.5%