Skip to content

feat(planning): request Inbox with status, and host requests that skip Run and Share - #8386

Merged
kyle-sexton merged 8 commits into
mainfrom
feat/shared-inbox
Oct 19, 2026
Merged

kyle-sexton merged 8 commits into
mainfrom
feat/shared-inbox

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: owner-approved design from the live shared-interview session (spec PR 3; follow-up items 9 and 11; round 6 Q24)

Summary

Answers from Claude landed on the question they were asked from with no signal, so people missed them, and the host had to Run and then Share even their own requests. This adds a request Inbox and lets the host's own requests go straight through.

Fix

  • Inbox replaces the bell in the header: each person's own requests, newest first, with status (Waiting, Running, Answered, Shared, Declined, Failed) and a link to the answer; unread badge; marks read only when opened, stored server-side so it follows the person across devices. The host also gets "Waiting on you" (requests to run, results to share, reports, merges, joins). Every notification kind stays reachable in the Inbox.
  • Toast "Claude answered your request on Q · Open" once the requester can see the answer.
  • A request the host identity creates starts running and its result is published at once; guest requests (the owner's guest identity included) still wait for Run and Share.
  • POST /api/inbox/read is throttled like notifications/read, writes nothing when nothing changed, and only marks keys in the caller's own Inbox at the status the page showed.
  • State schema 3 -> 4 adds inboxSeen; the migration marks existing requests read at their current status (with the live visibility rule), so nothing turns unread on upgrade.
  • The Ask Claude form starts on Ask, as round 5 decided (it started on Research).

Verification

  • ui.test.sh: 27 suites, 0 failed (ui_inbox 34 passed; ui_question_layout 31 passed, the Ask-default check fails before its fix).
  • python3 -m unittest discover -s plugins/planning/shared/tests: Ran 917 tests, OK (one run failed a known load-sensitive test; a rerun passed).
  • Migration rehearsed on a copy of a real v3 session: question, request, chat, people, round and result counts unchanged; only inboxSeen and the version change; the v4 schema check passes.
  • Fresh-context review: no blockers; the should-fix (unthrottled, always-writing read endpoint) and two nits are fixed in the second commit.
  • Left out: Run/Decline buttons inside the Inbox (items link to the request card, where they are).

Related

N/A

🤖 Generated with Claude Code

kyle-sexton and others added 3 commits October 18, 2026 23:24
…p Run and Share

The top bar's bell becomes the Inbox (items 11 and 9 of the shared
interview follow-ups). It lists the person's own requests newest first,
each with its question, the ask, a status chip (Waiting, Running,
Answered, Shared, Declined, Failed with its reason) and a link that opens
the answer, or the request card, in that question's Claude section. A
guest's answer reads "Answered, waiting for the host to share" until the
host shares it. For the owner it adds "Waiting on you": requests to run,
results to share, problem reports, merge requests and join requests, each
opening where it is handled. Every notification kind stays listed under
Notifications in the Inbox; the badge leaves out the request and queue
kinds, which Inbox items already count. A toast "Claude answered your
request on Q<N>" with Open fires when an answer becomes visible to its
requester. Tabs All, Mine, Waiting on you (owner) and Notifications; on a
phone the Inbox is a full-screen sheet.

session.py builds the viewer's Inbox (snapshot `inbox`), scoped to their
own requests and, for the owner only, the waiting items. Unread means the
status moved since the person last opened the item; POST /api/inbox/read
{keys} marks only keys in the caller's own Inbox and drops marks of items
gone, and nothing else marks one read. The marks live server-side in
state.json `inboxSeen`, so they follow the person across devices; a merge
carries them to the kept identity.

A request the owner sends starts running at once (request-run event, no
queue note) and Claude's result for it is published at once. Guest
requests, the owner's guest identity included, still wait for Run and
Share.

schemaVersion 3 -> 4: migrate.py adds inboxSeen with every existing
request read at its current status, so the upgrade makes nothing unread;
state-written-394a8bc.json, written by the base build's own session.py,
loads unchanged but for that key. core.js reloads on version 4.

Tests: TestInbox and TestStateFrom394a8bc in test_session, inbox route
and host-skip tests in test_server, v3 -> v4 tests in test_migrate, and
ui_inbox.js (badge counts, opening marks read, host Waiting on you,
toast, guest waiting-for-share, no other person's request, 390 sheet).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eep later moves unread

Review fixes for the request Inbox:

- POST /api/inbox/read goes through the one-write-a-second limit like
  notifications/read, and a read that marks nothing returns without a
  commit, so a page cannot force state writes in a loop. core.js spaces
  the route like its sibling.
- A read carries `saw`, the status the page showed for each key, and marks
  that status; an answer that lands while a spaced read waits stays unread.
- The v3 -> v4 migration treats a removed guest's own-Claude result as not
  visible, as the live Inbox does, so it starts read as unshared.
- Mark all read sends every unread key, 100 a read, instead of the first
  100 only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 19, 2026 03:45
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T03:47:35.799934Z 6862bcd Draft marked ready
ℹ️ 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.

@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 25f9b9eb0bb1164337bac3eb6054d01cb869f546: 0 finding(s), 0 as inline comments.

Security review (incremental, 23089d3 → 25f9b9e)

No security issues found in the three files changed since the last review: plugins/planning/shared/web/app.js, plugins/planning/shared/web/core.js and plugins/planning/shared/tests/ui_inbox.js.

  • Injection: The new owner-only toasts (iw: keys) interpolate guest-controlled values (disp(i.by), i.qid) into the message. flash() writes the message with toastTxt.textContent (app.js:593), not innerHTML, so a guest's display name cannot inject markup or script.
  • Authorization: The new toasts are created only inside the existing if (Core.me.isOwner) block (app.js:3317). The test asserts that the leader gets none. The server still decides what appears in S.inbox; the client change only adds a notification.
  • Name resolution: The new joinName lookup in core.js reads names from joinRequests, which the server already sends. It is used only as display text and adds no new data exposure.
  • Tests: The ui_inbox.js additions are test-only and carry no secrets or machine-specific data.

I didn't check the instruction-surface lens or the exception register, since the diff touches no standing instructions.

@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: 6862bcd94d

ℹ️ 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 plugins/planning/shared/web/app.js Resolved
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 25f9b9eb0bb1164337bac3eb6054d01cb869f546: 0 finding(s), 0 as inline comments.

No findings in the incremental change since 23089d3, which covers ui_inbox.js, app.js and core.js. I traced the logic by reading the code and ran nothing, including the UI suite. The PR body's test results are the author's claim and I did not confirm them.

  • Toasts for the owner (app.js ~3320): the new iw:<key> notices go through the existing note()/first priming logic. Items already waiting at load or reload therefore stay silent, and each new item toasts once. The block sits inside Core.me.isOwner, so leaders get none.
  • Inbox keys (session.py _inbox): the waiting keys (run:, share:, report:, join:) are stable per item. A run that moves on to a share item gets a new key and a new, intended toast. Merges are left out of WAIT, so they don't toast twice.
  • Join names (core.js ~231): the server's join item uses the person's pid as by, and a waiting person is not in the people map. The new joinName lookup through joinRequests fixes the "Someone asks to join" fallback. people[i.by] ? … : joinName(i.by) || nameOf(i.by) falls back correctly.
  • New test checks: Core.snapshot(), the approveJoins setting, and the dialog.core-name / #core-n selectors it uses all exist in the codebase.

I didn't report one thing: the owner's own guest identity may get a " asked Claude…" toast for its own request, because there is no isMe filter on the run toast. I did not trace whether that identity shares the owner's Core.me, so it is speculative.

kyle-sexton and others added 3 commits October 19, 2026 00:37
The Inbox badge dropped every unread queue notification, but proposals,
suggestions and file offers raise a queue notice with no Inbox item, so a
leader or the owner saw badge 0 and no Mark all read for a new proposal.

The queue line now counts unless the viewer has a waiting Inbox item,
read or not: only the owner has those, and each stands for a request,
share, report, merge or join the queue line also counts. Counting it once
the waiting item is read would bring the badge back for a request the
owner already opened.

ui_inbox.js covers a leader seeing 1 and Mark all read after a guest's
proposal, and the owner with waiting items seeing only the Inbox count.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…box entry

The owner's Inbox already lists requests waiting on Run, unpublished
results, reports, merge requests and joins as waiting items, so the
queue notice those raised for the owner counted the same thing twice.
They no longer notify the owner. Proposals, suggestions and upload offers,
which have no Inbox item, still notify every moderator, and inboxUnread()
counts every unread notification except a request's own.

This closes the gap the client heuristic left: an owner who had opened a
waiting request saw no badge for a new proposal.

The Inbox and Share buttons no longer shrink below their labels on a
crowded 768-wide top bar (.vf-tbtn's min-inline-size replaced the flex
min-content floor), so the title gives way instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Comment thread plugins/planning/shared/README.md Resolved
kyle-sexton and others added 2 commits October 19, 2026 01:02
The badge now counts every unread notification except a request's own; the
owner simply gets no queue line for items its Inbox lists as waiting.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The owner's queue notices for joins, requests waiting on Run, results
waiting on Share and reports were also what popped a toast, so the owner
lost the time-sensitive pop-up for a guest asking to join. notices() now
toasts once per waiting Inbox item of those kinds when it arrives, with
Open going to the item; items already waiting at page load stay quiet.

A person asking to join is not in people yet, so the Inbox named them
"Someone"; core.js now takes their name from joinRequests.

ui_inbox.js checks one toast each for a join and a Run-waiting request,
none for a leader, and none after a reload.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant