GeezerVison is showing github.com — pm-stack: /attention needs-user action UI — options, survey, delegation, proposals (#1291, #1293) by dezren39 · Pull Request #1367 · developing-today/code
Conversation
dezren39
commented
Oct 27, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Part 2 of the #1290–#1293 needs-user action layer slice, on top of the contract in #1365 (merged).
What lands here — every Needs User card on /attention now renders its published contract, and nothing it cannot back with store/section data:
- Why-class badge (Title Case: Decision / Missing Info / Approval / Access / Policy), the item's summary, and the 'If nothing happens' line.
- The item's custom options as answer buttons (posting the one
answer verb with optionId), each with its description and predicted-effect line.
- The survey as one inline answer form: per-question inputs by type, 'Needed: ' under each, required questions enforced at the POST boundary (added in pm-stack: needs-user item contract — whyUser, options, survey, delegation (#1290) #1365) with a legible error — an incomplete survey records nothing.
- A free-text Answer form when the item offers neither options nor questions.
- Delegation controls + state: current mode/status line (mode, run, age), Delegate First Pass / Delegate Auto / Bring Back to Me; Auto renders disabled with the reason on access/policy items.
- Proposal review (impl(aggregator/orchestrator): proposal review state handling - proposal identity, supersede/expiry races, cross-surface counts #1293): the proposal box (summary, detail, proposed changes, drafted-at, 'nothing is applied unless you approve'), Approve / Reject forms carrying the proposal identity triple as hidden fields; a second first pass names the previous rejection and its reason; expired proposals render expired with a fresh-draft control and no approve form; the structured inability box (reason / tried / needs) for returned items; pending proposal actions whose proposal changed render 'no longer applicable'.
- Dismiss (reason required, resurface rule stated on the form).
- The standing delegation-default toggle above the queue: current effective value from the preference records, a 'change pending' badge while a preference action awaits the pass, and the save form (kind
preference).
- All needs-user controls join the card's existing actbox, so they disable with the triage set + reason when the tier source is not live (fix(aggregator): /attention presents derived-only data as authoritative when the orchestration tier source is missing - banner + never a silent 0 #1139 behavior, unchanged).
- ACTION_SCRIPT now collects
answers[] (radio/checkbox/text by question id), proposal identity fields, and the standingAuto boolean.
Tests: 269 pass (8 new render tests: full card, access auto-block, proposal box + identity, re-proposal naming, expiry, inability, stale-source disable, toggle states), tsc --noEmit clean, biome 2.3.2 applied.
Refs #1291 #1293. The orchestration-pass consumer step (#1292) follows in this slice.
![Autofix with [code]smith](/api/image?u=https%3A%2F%2Fcamo.githubusercontent.com%2F33b6f70f3541c4e93f4503d29cbfec051fa1b040d8e0ae9313a51c4ece44a627%2F68747470733a2f2f70722d636f6d6d656e74732d6173736574732e626c61636b736d6974682e73682f636f6465736d6974682f6175746f6669782d776974682d636f6465736d6974682d6461726b2d33782e706e67)
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.
Each Needs User card now renders its published contract: the
why-class badge (Title Case), the summary and 'If nothing happens'
lines, the item's custom options as answer buttons with their
predicted-effect lines, the survey as one inline answer form
('Needed: <covers>' per question; required questions enforced at
the POST boundary with a legible error), and the dismissal control
(reason required, resurface rule stated).
Delegation renders from the published state only: current mode and
status, First Pass / Auto / Bring Back to Me controls (Auto disabled
with the reason on access/policy items), the proposal box with
Approve / Reject forms carrying the proposal identity (#1293), a
second first pass naming the previous rejection, the structured
inability box, and expired proposals shown expired with a fresh-
draft control. Pending proposal actions whose proposal has changed
render 'no longer applicable'. The standing delegation-default
toggle sits above the queue, backed by the preference records, with
its pending state shown. Controls disable with the triage set when
the tier source is not live. The action form script now collects
answers[], proposal identity fields, and the standingAuto boolean.
Tests: 8 render tests added (full card, access auto-block, proposal
box + identity, re-proposal naming, expiry, inability, stale-source
disable, toggle states).
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 24 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:
659b35a3-1ca5-449e-9178-e9e2e92ea760
Commits
-
Reviewing files that changed from the base of the PR and between 2ff028f and 79cebd7.
Files selected for processing: 2
-
pm-stack/aggregator/src/render.ts
pm-stack/aggregator/test/needs-user.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
-
Comment @coderabbitai help to get the list of available commands.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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-27T08:17:44.922245Z |
79cebd7 |
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.
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: 79cebd7437
ℹ️ 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
+1748
to
+1749
|
|
const extBody = isUserTier ? needsUserBodyHtml(item, act?.actions) : "";
|
|
|
const extForms = isUserTier ? needsUserFormsHtml(item, objectRef) : "";
|
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.
Render the needs-user contract for session-backed items too
When a published Needs User item names a session present in the live feed, buildAttention consumes it into view.drew rather than view.drewExtra. Those entries render through sessionCard, so the new body and forms added here never run; tierEntry also retains only the item's reason. A session-backed item with required survey questions or a ready proposal therefore shows neither its survey nor its proposal review controls, leaving the user unable to complete that workflow. Preserve the published item on matched session entries and render its needs-user contract there as well.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
const answersByQuestion = {};
|
|
|
for (const el of form.querySelectorAll("[name^='answers:']")) {
|
|
|
const qid = el.name.slice("answers:".length);
|
|
|
if (el.type === "checkbox") { if (el.checked) (answersByQuestion[qid] = answersByQuestion[qid] || []).push(el.value); }
|
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.
Use a prototype-free accumulator for survey answers
For a multi-choice question whose ID is constructor (a valid ID accepted by the question sanitizer), answersByQuestion[qid] resolves to the inherited Object constructor rather than an empty array. Selecting any checkbox then throws .push is not a function before reaching either fetch or the error handler, so the survey cannot be submitted and no inline error appears. Use a Map or a prototype-free object for this accumulator.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
const modeButton = (mode: DelegationMode, label: string) => {
|
|
|
if (mode === "auto" && autoBlocked)
|
|
|
return `<span class="aform"><button type="button" disabled>Delegate: Auto</button><span class="why">${esc(WHY_USER_LABELS[item.whyUser!])} items can never be auto-delegated — they stay with you.</span></span>`;
|
|
|
const current = d.mode === mode && !(expired && mode === "first-pass");
|
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.
Account for pending delegation when disabling mode controls
When an item is published with mode user, submitting Delegate Auto records a pending action and reloads before the orchestration pass updates the published section. The card then shows “delegate (auto) requested” but disables “Bring Back to Me (current)” because this check still uses the published d.mode. Users therefore cannot submit a corrective request to keep the item with them before that pending delegation is consumed. Pass the pending delegation state into the form renderer and account for it when deciding which mode controls to disable.
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.
This was referenced Oct 27, 2026
Uh oh!
There was an error while loading. Please reload this page.
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.
|