Repository navigation
feat(reader): saved queries and named views UI (#1118) - #1152
Conversation
Wire the existing /api/user/saved-views substrate into the web reader so saved views can be created, recalled, and deleted from the UI without leaving the workspace. Adds a "Saved views" select and "Save view" button to the workspace toolbar (mirroring the existing Restore workspace pattern), a Delete button per saved view in the Notes inspector list, a naming-conflict guard that prompts the operator before overwriting an existing view, and an actionable empty-state message that names the next step. Tests assert toolbar entry presence, naming-conflict UX, delete button wiring, empty-state copy, and an end-to-end roundtrip the UI relies on (save → list → delete). Ref #1118 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d46fbed57
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.
Only the rows listed above are dispositioned. Held findings remain open. |
Summary
Wire the existing
/api/user/saved-viewssubstrate (shipped via #1050-#1057 under the #867 user-state umbrella) into the web reader so an operator can save the current filter chain under a name, recall it, and delete it without leaving the reader. Adds a toolbar entry-point, a Delete affordance, a naming-conflict guard, and an actionable empty state.Problem
#1118 calls out the reader UI gap for saved views: the storage table and the HTTP envelope existed, and the Notes inspector tab could already save/open a view, but there was no way to delete an existing view from the UI, no naming-conflict UX (the SQLite
UNIQUE(name)constraint would surface as an opaque error), and no toolbar-level entry-point — saved views were reachable only by opening the Notes inspector tab on a selected conversation. The acceptance criteria require list/recall/delete affordances, an empty state distinct from a populated one, and naming-conflict handling.Solution
polylogue/daemon/web_shell_workspace.py: adds aSaved views<select>and aSave viewbutton to the workspace toolbar (mirroring the existingRestore workspaceselect pattern). Populates the select inrenderWorkspaceToolbarwithstate.savedViews, disables it when empty, and falls back throughapplySavedView→loadConversations+loadFacets. MovessaveCurrentViewand addsdeleteSavedViewhere.saveCurrentViewnow trims whitespace, rejects empty names, and detects a naming clash againststate.savedViewslocally — promptingwindow.confirmto overwrite (DELETE the existing view_id, then POST) or abort.deleteSavedViewconfirms by name before issuing the DELETE.polylogue/daemon/web_shell.py: the Notes inspector list now renders a per-row Delete button next to Open; the empty state is reworded to name the next action (Click "Save current view" to name the current filter chain.).tests/unit/daemon/test_web_reader.py: addsTestReaderSavedViewsUIwith five tests — toolbar entry-point presence, naming-conflict UX strings, delete-button wiring, actionable empty-state copy, and an HTTP roundtrip (save → list → delete) that catches regressions in the new toolbar surface.The MCP coverage criterion (#1118 AC: "At least one MCP read tool exposes saved views by id") was already satisfied by
list_saved_views/save_saved_view/delete_saved_viewinpolylogue/mcp/server_mutation_tools.py— no change there.The naming-conflict handling is client-side rather than at the HTTP envelope. The shared
user_state_http.pyis owned by another lane per the dispatch plan and the existingsave_viewSQL is anINSERT OR REPLACE BY view_id; the UNIQUE constraint is onname, which means a differentview_idfor the same name would 500. Detecting the conflict client-side keeps the UX coherent without changing the contract.polylogue/daemon/web_shell.pynet change is −13 LOC (functions moved into the workspace asset module), keeping the file under the 1100-line budget enforced byverify-file-budgets.Verification
devtools verify(full pytest path) requiresdevtools verify --seed-testmonon this fresh worktree; the affected unit suite was exercised directly above.render-pageswas re-emitted to clear a pre-existing.cache/sitedrift unrelated to this PR.Closes #1118