feat(web): add global settings and simplify sidebar
This commit is contained in:
+33
-2
@@ -34,6 +34,7 @@ Default dev URL: `http://localhost:5173`
|
||||
## UI
|
||||
|
||||
- Left panel: mixed list of chat conversations and Exa searches.
|
||||
- The sidebar footer has one **Settings** button. It opens app settings; the conversation header's **Chat settings** button still edits only the current chat.
|
||||
- Sidebar search uses `GET /v1/workspace-items?q=…` to search all saved titles,
|
||||
conversation messages, and web-search queries/answers. It waits 300 ms while
|
||||
typing and cancels superseded requests. Results include a single-line matching excerpt
|
||||
@@ -65,7 +66,7 @@ Client API contract docs:
|
||||
|
||||
## Lightweight interface
|
||||
|
||||
Open `/lite` directly, or choose **Lightweight view** in the full workspace sidebar. **Full interface** switches back. Explicit switches (`?ui=lite` and `?ui=full`) remember the choice in `sybil:ui-mode`; workspace IDs, query parameters, and hashes survive switching. A direct `/lite` visit always works even if Full was previously selected.
|
||||
Open `/lite` directly or from a bookmark; it is intentionally absent from the full workspace sidebar and settings. **Full interface** switches back. Explicit switches (`?ui=lite` and `?ui=full`) remember the choice in `sybil:ui-mode`; workspace IDs, query parameters, and hashes survive switching. A direct `/lite` visit always works even if Full was previously selected.
|
||||
|
||||
At `/`, an explicit or saved choice wins over automatic detection. Otherwise recognizable Kindle/Kobo/PocketBook user agents or `navigator.connection.saveData === true` select Lite. Silk/Kindle Fire alone do not identify an e-ink device. Screen size, CPU count, and reduced-motion preferences do not trigger a redirect. `/search` stays a standalone search unless explicitly switched; switching its `q` parameter into Lite prefills a search without starting a request.
|
||||
|
||||
@@ -108,4 +109,34 @@ Installed Sybil uses `standalone` display, retaining the system status bar where
|
||||
|
||||
Horizontal navigation swipes start on workspace chrome or empty space. Text, tables, quotations, code, controls, existing selections and nested horizontal scrollers keep native gestures, including at scroll edges. Long-press/right-click on transcript text and links uses the native browser menu; the reply footer provides Copy and Fork.
|
||||
|
||||
Agent notification settings include separate browser/server failure guidance and an expandable Android / GrapheneOS setup guide. See [mobile QA results and limitations](../docs/mobile-web-qa.md), including how to run the browser fixtures.
|
||||
**Settings → Notifications** includes browser/server failure guidance. **Troubleshooting** contains browser permission and connection status, Refresh, and the expandable Android / GrapheneOS setup guide. See [mobile QA results and limitations](../docs/mobile-web-qa.md), including how to run the browser fixtures.
|
||||
|
||||
## App settings
|
||||
|
||||
The sidebar has one **Settings** entry. Desktop opens a 760 px pane with a section list and scrollable content. Mobile opens a section list; each section has Back and Close in a fixed header. Safe-area padding and 44 px controls keep the pane usable on narrow and short screens. Close, Escape, and desktop backdrop dismissal return focus to the Settings button. Workspace shortcuts and Agent read tracking are suspended while settings covers the workspace; the selected conversation, composer draft, and background notification session remain intact.
|
||||
|
||||
| Section | Controls |
|
||||
| --- | --- |
|
||||
| Notifications | Agent status, enable/disable, and a brief lock-screen preview notice. Actionable errors remain visible; Troubleshooting contains permission/connection diagnostics, Refresh, and Android / GrapheneOS help. |
|
||||
| Models | A remembered chat model for each provider, plus Quick Questions' separate provider and per-provider model selections. Both use the existing catalog and shared picker, including custom model names and keyboard selection. |
|
||||
| Connection & session | Read-only configured server location, signed-in/open mode, Sign out with notification revocation, and a Keyboard shortcuts disclosure. Credentials are never displayed. |
|
||||
|
||||
Model selections save automatically to this browser using the existing `sybil:modelPreferencesByProvider` and `sybil:quickQuestionModelSelection` keys. Existing stored choices require no migration. New chats use the remembered model for the current provider; there is no new persistent default-provider setting for regular chats. Selecting or editing an existing conversation retains its own model and settings. Editing a model through Chat settings or Quick Questions updates the same remembered choices shown in app settings. Clearing a model entry returns to that provider's existing fallback.
|
||||
|
||||
Preferences apply locally, with no server request or account synchronization. If storage is blocked or full, the page keeps working with the changed values and Models shows a concise persistence error with **Retry saving**. Closing and reopening settings preserves session values; reloading requires successful storage. Quick Questions' controls are disabled during an active quick request or conversion, matching the inline controls.
|
||||
|
||||
Chat title, star, provider/model overrides, additional system prompt, and enabled tools stay in **Chat settings**. The web server address remains build-configured; native iOS retains its existing editable connection settings. Open-mode servers explain that notifications require token sign-in and omit Sign out. `/lite` stays a direct/bookmarked route, absent from sidebar and settings; its saved UI-mode preference and automatic detection remain intact. Push consent, presence, registration, retry, revocation, API contracts, and the full app's disabled zoom are unchanged.
|
||||
|
||||
### Settings verification
|
||||
|
||||
After `npm run build`, start the local preview as described above. With `PLAYWRIGHT_MODULE` and `CHROME_EXECUTABLE` set, run:
|
||||
|
||||
```bash
|
||||
node tests/app-settings.browser.mjs
|
||||
node tests/agent-push.browser.mjs
|
||||
node tests/agent-push-errors.browser.mjs
|
||||
node tests/mobile-workspace.browser.mjs
|
||||
node tests/ui-mode.browser.mjs
|
||||
```
|
||||
|
||||
The settings fixture covers desktop/mobile sections, Back/Close/focus and shortcut isolation, catalog/custom/keyboard model selection, migration-free preference persistence and reload, shared Quick Questions settings, existing-chat and draft preservation, blocked/full storage and retry, connection details, collapsed help, short-screen scrolling, open-mode behavior, direct `/lite` navigation, and disabled zoom in the full app. Set `SETTINGS_ARTIFACT_DIR` to save screenshots. Push fixtures retain their existing consent, failure, retry, source-change, worker, and offline sign-out checks through the new pane. APIs and push providers are mocked; actual phone delivery and native keyboard behavior still require device verification.
|
||||
|
||||
Reference in New Issue
Block a user