Skip to content

feat(reader): interactive reader cockpit with routing, facets, keyboard nav (#848) - #923

Merged
Sinity merged 1 commit into
masterfrom
feature/feat/reader-shell-848
May 7, 2026
Merged

Sinity merged 1 commit into
masterfrom
feature/feat/reader-shell-848

Conversation

@Sinity

@Sinity Sinity commented May 7, 2026

Copy link
Copy Markdown
Owner

Reader cockpit rewrite. 2 files +621/-202.

…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]>
Copilot AI review requested due to automatic review settings May 7, 2026 16:20
@coderabbitai

coderabbitai Bot commented May 7, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@Sinity has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 3 seconds before requesting another review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 6b02c9cb-4bf3-4fb2-a99c-bbdfc8ec7913

📥 Commits

Reviewing files that changed from the base of the PR and between ab645de and 858113f.

📒 Files selected for processing (2)
  • polylogue/daemon/http.py
  • polylogue/daemon/web_shell.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/feat/reader-shell-848

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Sinity
Sinity merged commit cabce04 into master May 7, 2026
4 checks passed
@Sinity
Sinity deleted the feature/feat/reader-shell-848 branch May 7, 2026 16:20

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread polylogue/daemon/web_shell.py Resolved
Comment thread polylogue/daemon/web_shell.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_HTML UI/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>/raw endpoint.
  • 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.

Comment thread polylogue/daemon/http.py
Comment on lines 333 to +337
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])
Comment thread polylogue/daemon/http.py
Comment on lines +591 to +595
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] = {}
Comment thread polylogue/daemon/http.py
@@ -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", "")),
Comment thread polylogue/daemon/http.py
Comment on lines +21 to +26
from polylogue.surfaces.payloads import (
QueryErrorPayload,
_build_flags_from_conversation,
_extract_cwd,
_extract_repo,
)
Comment on lines +248 to +257
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({}, '', '/');
}
Comment on lines +359 to +363
}
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,'&quot;'); }
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);
Comment on lines +615 to +621
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(); }
});
Comment on lines +285 to +290
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; }
Sinity added a commit that referenced this pull request May 7, 2026
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
Sinity added a commit that referenced this pull request May 7, 2026
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
@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

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.

@Sinity

Sinity commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants