GeezerVison is showing github.com — feat(pm-aggregator): S6 chat/session surface — threaded view, nav unread badge, completion push (#10035) by dezren39 · Pull Request #13383 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
S6 chat/session surface — the view + push half (#10035)
Design: #9539 §4/§6 (PR #10030). The S6 backend landed in PR #12747: threadId/replyTo/refs/archived/read/notify on PromptRecord, reply inherits the parent thread, GET /api/prompt filters, /api/prompt/thread/:id, /api/prompt/threads, /api/prompt/unread-count, and PATCH /api/prompt/:id. That PR's own record left "UI threaded view + nav badge" as the remainder — this PR lands it, plus the push half of §4 that the stored notify flag was waiting for.
What lands
- Threaded view —
/chat (manifest-registered in src/pages.ts, dropdown tier per the dashboard: clean up the page list (12 registered pages, overlaps to resolve) #1497 curation rule that new pages take no primary slot without a ruling; the curation table in test/curation-1497.test.ts gains the row): threads grouped by threadId, oldest first inside a thread, threads ordered by latest activity. Each prompt card shows its text, status, answer/error, attachments, an "in reply to" link, and its cross-references as links to the referenced prompt's card (an archived target links into the archived view; an unknown id renders as a plain badge). Per-prompt reply form posts replyTo that prompt (the store inherits its thread) with target/mode defaulting to the parent's and the notify opt-in checkbox. Archive / mark-read toggles PATCH the record. Archived prompts are hidden by default, per §4; ?archived=1 shows them, marked.
- Notification count badge in nav: every page's bar now carries a hidden
✉ n unread link to /chat; src/assets/prompt-badge.js (served like the other client assets) fills it from the existing /api/prompt/unread-count endpoint and unhides it only when n > 0. Fetch failure stays silent.
- Push on async completion (§4: "push notification on async completion (opt-in per submission)"): the new
prompt notification class (src/notifications.ts — defaults + preferences metadata + a /chat test landing) and src/prompt-notify.ts. PATCH /api/prompt/:id — the single path answers land through — compares the record before/after; on the transition into a terminal status with notify: true, it fans sendPush over the alerts store's subscriptions gated by classEnabled(sub, "prompt"), one sends-ledger row per attempt, alive/gone bookkeeping like the other fan-outs. Fire-and-forget: a push failure never fails the answer. Pre-existing subscriptions receive nothing until they opt in on /alerts/preferences (the established classEnabled default: only incident defaults on for old rows); new subscriptions get the reviewed default (on).
Deliberately not in this slice
Tests
Remote dispatch at head a8c1d1e58 — fleet-command run 45197156793, conclusion success: bun test over src/prompt-notify.test.ts (new: transition predicate incl. no-re-push on re-patch, payload shape, class-gated fan-out with ledger assertions), src/prompts.test.ts, src/prompt-attachments.test.ts, src/prompt-ws.test.ts, test/chat-10035.test.ts (new: threading order, reply forms, refs links, archive visibility, unread count, badge markup, manifest registration), test/curation-1497.test.ts, test/a11y-1215.test.ts, test/notification-preferences-3318.test.ts, test/notifications.test.ts, test/alerts.test.ts — 178 pass / 0 fail, 781 expect() calls — and bunx tsc --noEmit clean (chained in the same command). Two intermediate runs caught real defects in my own additions, both fixed in-branch: the alerts.test.ts verbatim pins of the default class set (run 45193990075) and the noteSubscriptionGone fake return type under tsc (run 45195433568).
New dependencies: none. Schedules touched: none.
Refs #10035, #9539.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…ead badge, completion push (#10035)
The S6 backend landed in PR #12747 (threadId/replyTo/refs/archived/
read/notify on PromptRecord, thread/threads/unread-count endpoints,
PATCH updates). This lands the remaining surface half of design
#9539 §4/§6:
- /chat page (manifest-registered, dropdown tier per the #1497
curation rule): threads grouped by threadId, oldest first inside
a thread, threads by latest activity; per-prompt reply forms
posting replyTo (the store inherits the thread); refs rendered
as cross-reference links to the referenced prompt's card;
archive/read toggles via PATCH; archived hidden by default with
a ?archived=1 view.
- Nav unread badge: a hidden '✉ n unread' link in the bar on every
page, filled by /assets/prompt-badge.js from the existing
/api/prompt/unread-count endpoint; shown only when n > 0.
- Push on async completion: PATCH /api/prompt/:id detects the
transition into a terminal status on a record whose submitter
opted in (notify) and fans sendPush out over the alerts store's
subscriptions under a new 'prompt' notification class (new
subscriptions default on; pre-existing subscriptions stay off
until they opt in on /alerts/preferences, per classEnabled).
One sends-ledger row per attempt; the send is fire-and-forget
so a push failure never fails the answer.
Tests: src/prompt-notify.test.ts (transition predicate, payload
shape, class-gated fan-out with ledger assertions) and
test/chat-10035.test.ts (threading, reply forms, refs, archive
visibility, unread count, badge markup, manifest registration);
curation table gains the chat row.
The two verbatim expectations of the merged default class set in
alerts.test.ts predate the prompt class; add prompt: true to both,
matching NOTIFICATION_CLASS_DEFAULTS.
… return (#10035)
tsc: AlertsStore.noteSubscriptionGone returns Promise<'marked' |
'pruned'>; the test fakes returned void. Return 'marked'.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-23T14:55:52.750830Z |
a8c1d1e |
PR opened |
ℹ️ 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" or "@codex security review".
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 12 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
815b108b-db7c-4989-9e80-0b73a9e9c33a
Commits
-
Reviewing files that changed from the base of the PR and between d416140 and a8c1d1e.
Files selected for processing: 11
-
pm-stack/aggregator/src/assets/app.css
pm-stack/aggregator/src/assets/prompt-badge.js
pm-stack/aggregator/src/notifications.ts
pm-stack/aggregator/src/pages.ts
pm-stack/aggregator/src/prompt-notify.test.ts
pm-stack/aggregator/src/prompt-notify.ts
pm-stack/aggregator/src/render.ts
pm-stack/aggregator/src/server.ts
pm-stack/aggregator/test/alerts.test.ts
pm-stack/aggregator/test/chat-10035.test.ts
pm-stack/aggregator/test/curation-1497.test.ts
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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: a8c1d1e58d
ℹ️ 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".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+2846
to
2847
|
|
const before = await promptsStore.get(id);
|
|
|
const updated = await promptsStore.update(id, patch);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Snapshot the prompt before mutating its status
PromptsStore.get() returns the live stored object, and PromptsStore.update() mutates that same object in place. Consequently, before and updated both contain the terminal status when promptCompletionTransition() runs, making its nonterminal-to-terminal check always false. Opted-in prompts therefore never send completion notifications. Capture a snapshot or the previous status before calling update().
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Comment on lines
+6861
to
+6865
|
|
if (!r.ok) throw new Error(body.error || 'HTTP ' + r.status);
|
|
|
window.location.reload();
|
|
|
} catch (e) {
|
|
|
if (status) status.textContent = 'Not sent: ' + e.message;
|
|
|
button.disabled = false;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Treat sync-block timeouts as accepted submissions
When a reply uses sync-block and its answer exceeds the configured timeout, the POST handler has already persisted the reply but returns HTTP 504 with its ID (server.ts, POST /api/prompt, and syncBlockHttpResult()). This handler treats that response as a submission failure, displays “Not sent,” and re-enables the submit button without showing the persisted reply. Retrying then creates a duplicate prompt. Handle the typed timeout response as an accepted, still-pending submission and reload or link to the existing record instead.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
const parent = p.replyTo ? byId.get(p.replyTo) : undefined;
|
|
|
const replyLine = p.replyTo
|
|
|
? `<p class="muted">in reply to ${
|
|
|
parent ? `<a href="#prompt-${esc(parent.id)}">${esc(chatExcerpt(parent.prompt))}</a>` : esc(p.replyTo)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link archived reply parents into the archived view
When a parent prompt is archived but its reply remains active, the default /chat view still resolves the parent through byId, but excludes its card through visiblePrompts. The “in reply to” link therefore points to a fragment that does not exist on the page, preventing navigation back to the reply's context. Check the parent's visibility and use /chat?archived=1#prompt-... for hidden parents, as the cross-reference links already do.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|