Repository navigation
feat(reader): interactive reader cockpit with routing, facets, keyboard nav (#848) - #923
Conversation
…rd nav (#848) - Fix field-name mismatch: reads data.items instead of data.conversations - /c/{id} client-side routing with pushState/popstate - Dynamic faceted left rail from /api/facets - Top status strip with health, counts, DB size, FTS, ingest - Enriched conversation header: model, repo, cwd, flags, tags - Message display with tool summaries, collapsible text, timestamps - Right inspector with Info/Raw/Notes tabs - Empty/no-results/error/loading states - Keyboard: /search, j/k nav, n/p page, Esc clear, ? help - Daemon HTTP: enriched list/detail with flags, summary, date - New /api/conversations/{id}/raw endpoint Co-Authored-By: Claude Opus 4.7 <[email protected]>
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits 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 (2)
✨ 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: 858113f27f
ℹ️ 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".
There was a problem hiding this comment.
Pull request overview
This PR rewrites the daemon’s built-in web reader into an interactive “reader cockpit” SPA with sidebar facets, keyboard navigation, an inspector panel (Info/Raw/Notes), and URL-based navigation for deep-linking conversations.
Changes:
- Revamps
WEB_SHELL_HTMLUI/UX (layout, facets, keyboard shortcuts, inspector tabs) and adds client-side routing via/c/<conversation_id>. - Extends daemon HTTP API conversation/list payloads with additional metadata (flags, repo/cwd/model/summary) and adds a new
/api/conversations/<id>/rawendpoint. - Adds “raw artifacts” loading flow in the UI (Inspector → Raw → “Load raw data”).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
polylogue/daemon/web_shell.py |
SPA cockpit UI rewrite: facets, keyboard navigation, inspector tabs, and /c/<id> client-side routing. |
polylogue/daemon/http.py |
Adds conversation “raw” API route and enriches conversation/list JSON payloads to support the new cockpit UI. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| self._handle_get_conversation(path[2]) | ||
| elif len(path) == 5 and path[:2] == ["api", "conversations"] and path[3] == "messages": | ||
| self._handle_get_messages(path[2], params) | ||
| elif len(path) == 4 and path[:2] == ["api", "conversations"] and path[3] == "raw": | ||
| self._handle_get_conversation_raw(path[2]) |
| conv = await poly.get_conversation(conv_id) | ||
| if conv is None: | ||
| return None | ||
| raw_items = await poly.get_raw_artifacts_for_conversation(conv_id) | ||
| provider_meta_serializable: dict[str, object] = {} |
| @@ -556,17 +554,63 @@ async def _do_get_conversation(self, poly: Polylogue, conv_id: str) -> object: | |||
| "timestamp": msg.timestamp.isoformat() if msg.timestamp else None, | |||
| "message_type": str(getattr(msg, "message_type", "")), | |||
| from polylogue.surfaces.payloads import ( | ||
| QueryErrorPayload, | ||
| _build_flags_from_conversation, | ||
| _extract_cwd, | ||
| _extract_repo, | ||
| ) |
| var m = window.location.pathname.match(/^\/c\/(.+)$/); | ||
| return m ? decodeURIComponent(m[1]) : null; | ||
| } | ||
| function pushURL(convId) { | ||
| if (convId) { | ||
| var url = '/c/' + encodeURIComponent(convId); | ||
| if (window.location.pathname !== url) history.pushState({}, '', url); | ||
| } else { | ||
| if (window.location.pathname !== '/') history.pushState({}, '', '/'); | ||
| } |
| } | ||
| var repoHtml = c.repo ? '<span class="chip" style="font-size:10px;padding:0 4px">' + esc(c.repo.split('/').pop()) + '</span>' : ''; | ||
| return '<div class="conv-item' + sel + '" data-id="' + escAttr(c.id) + '" onclick="selectConversation(\'' + escAttr(c.id) + '\')">' | ||
| + '<div class="conv-title">' + title + '</div>' | ||
| + '<div class="conv-meta">' |
| function escAttr(s) { return String(s).replace(/'/g,"\\'").replace(/"/g,'"'); } | ||
| function renderInspectorNotes(el, c) { | ||
| el.innerHTML = '<div class="inspector-section"><h4>Notes</h4>' | ||
| + '<div class="inspector-empty">Notes are not yet implemented. See <a href="https://github.com/Sinity/polylogue/issues/867" target="_blank" style="color:var(--accent)">#867</a>.</div></div>'; |
| function toggleHelp() { | ||
| document.getElementById('help-overlay').classList.toggle('visible'); | ||
| } | ||
| document.getElementById('help-overlay').addEventListener('click', toggleHelp); |
| document.getElementById('facet-bar').addEventListener('click', function(e) { | ||
| var chip = e.target.closest('.facet-chip'); | ||
| if (!chip) return; | ||
| var facet = chip.dataset.facet; | ||
| var value = chip.dataset.value; | ||
| if (facet === 'provider') { state.provider = value || ''; state.offset = 0; loadConversations(); renderFacets(); } | ||
| }); |
| async function loadConversation(id, updateURL) { | ||
| if (updateURL !== false) pushURL(id); | ||
| try { | ||
| var data = await fetchJSON('/api/conversations/' + id); | ||
| state.selected = data; | ||
| } catch(e) { state.selected = null; } |
Closes #848 by replacing the older static reader pages with a dynamic shell that adapts the same archive/query/status contracts the Python API, CLI, MCP, and daemon HTTP already use, instead of creating a parallel reader stack. - `polylogue/daemon/web_shell.py`: client-side router, facet panel, keyboard navigation, and conversation/message detail views built on the daemon HTTP API. Net +621/-202 lines. - `polylogue/daemon/http.py`: serves the new shell and exposes the facet aggregations the cockpit needs without inventing reader-only query semantics. - The cockpit covers the visual surface targeted by the MK2 spec; visual smoke evidence lands in PR #941 / #940 (#865). Refs #848
Closes #848 by replacing the older static reader pages with a dynamic shell that adapts the same archive/query/status contracts the Python API, CLI, MCP, and daemon HTTP already use, instead of creating a parallel reader stack. - `polylogue/daemon/web_shell.py`: client-side router, facet panel, keyboard navigation, and conversation/message detail views built on the daemon HTTP API. Net +621/-202 lines. - `polylogue/daemon/http.py`: serves the new shell and exposes the facet aggregations the cockpit needs without inventing reader-only query semantics. - The cockpit covers the visual surface targeted by the MK2 spec; visual smoke evidence lands in PR #941 / #940 (#865). Refs #848
|
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. |
|
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. |
Reader cockpit rewrite. 2 files +621/-202.