Skip to content

feat(crew-companion): edit a reminder's text in place - #14496

Merged
chenmingwei23 merged 1 commit into
mainfrom
fix/companion-edit-task-5552
Sep 28, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
fix/companion-edit-task-5552

Conversation

@iamwhatever

@iamwhatever iamwhatever commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let the user fix a Crew Companion reminder's text in place instead of deleting it and adding it again.

Each row in the Companion page's reminder list has only a remove (x) button. A typo in a captured task can only be fixed by deleting the row and typing the whole reminder again, time included.

Why it matters

Delete-and-re-add loses the reminder's schedule and repeat setting, and the user has to type them again. Editing the text should not cost that.

Not a goal

  • Editing the time or the repeat interval. Only the text is editable.
  • A modal or any new reminder field.
  • The desktop panel's "All reminders" list (PanelViews.tsx). This PR changes the dashboard page only.

What changed (motivation → approach → change)

  • Users can only delete a reminder, so fixing a typo means typing it all again. The fix is a small in-place editor that reuses the inline-rename pattern from the meeting title.
  • Backend: new POST /api/apps/crew-companion/reminders/update takes {id, text}. It uses the same text rule as reminders/add (now shared through _text_error, which also caps text at 500 characters) and changes only the text. The time and repeat stay as they were. An unknown id answers 404 reminder_not_found. CompanionStore.update saves under the store lock, like the other mutations.
  • Frontend: each row in website/src/apps/crew-companion/RemindersSection.tsx gets an Edit control, wired to the new route in CrewCompanionPage.tsx. A one-time row shows a pencil button. A repeating row already has Skip, so Skip and Edit move into one "More actions" menu (the shared components/ui/dropdown-menu) and Remove stays visible: every row holds two actions, as the blocking max-two-buttons-per-row rule requires.
  • Edit opens an input: Enter or blur saves, Escape cancels. Blank or unchanged text closes without saving. A failed save keeps the draft open and shows the reason in the shared ErrorNotice. Only one save runs at a time, and text typed while a save is in flight is kept. Remove is hidden while the editor is open, so the only control beside it is not a delete.
  • A failed background poll now shows the offline note (through ErrorNotice, reworded to "Couldn’t refresh your reminders. Retrying…") above the list instead of replacing it, so an open edit is not unmounted. A reminder that fires mid-edit drops out of the next poll; its row is held until the user saves or cancels, so the draft is not lost. Below 480px the reminder text takes its own line (styles.ts), so time, tag and actions cannot squeeze it to nothing.
  • Strings: the offline text is reworded in every catalog. One new key, edit_aria, in website/src/i18n/locales/en.manual.json and every translated catalog. The error text and the menu's "Edit" label reuse existing keys. The Skip button's own skip and skip_aria strings are removed, since the menu item uses skip_title. en-XA is regenerated.

Backwards compatibility

Breaking: reminder text over 500 characters is now refused with 400 text_too_long on reminders/add, as on the new reminders/update, because a fire copies the text into the persisted pending queue and an unbounded text could push the store past its load cap and stop every tick. Only new writes are refused: existing longer reminders still load (row_from_dict does not check length) and still fire. Writer sweep on origin/main @ 20ed6a1: the dashboard page's add box (CrewCompanionPage.tsx) and the overlay panel's add (panel.tsx) both POST reminders/add and keep the draft on a refused write; no other caller of the route exists, and no companion MCP tool or store path had a text limit to reuse.

Tests

  • crew_companion/tests/test_routes.py: update changes only the text (trimmed); time and recurrence are kept. Blank text answers 400 text_required, a missing id id_required, an unknown id 404 reminder_not_found, and the stored row is unchanged. The new route is in the "every route is gated" list.
  • website/src/test/CrewCompanionEditReminder.test.tsx: Enter saves trimmed text and closes; blur saves; Escape cancels; blank text does not save; a failed save keeps the draft with the reason; a second Enter during an in-flight save is ignored and newer typing is kept; Remove is hidden while editing and the editor survives a failed poll; an open edit survives its reminder dropping out of the list, and Escape then removes the row; Edit opens from the More menu on a repeating row with focus in the editor.
  • Two existing tests clicked the Skip button directly. They now open the More menu and pick Skip.

Manual verification

Captured the real RemindersSection with its shipped stylesheet in a stubbed harness, at this revision, in dark and light themes and at 360px. Each scene asserts before it saves: no Skip button on the repeating row, the open menu lists "Skip just the next one" and "Edit", Remove is gone while editing, a failed save shows its reason with the draft still in the input, and a failed poll shows the offline alert above the list.

Screenshots / video

A one-time row with the pencil, and a repeating row with More and Remove:

Reminder rows

The More menu open on the repeating row:

More menu open

Editing in place (dark, light); Remove is hidden while the editor is open:

Editing, dark

Editing, light

A failed save keeps the draft and shows the reason:

Failed save

At 360px the text takes its own line:

Narrow rows

A failed poll: the offline alert sits above the list, which stays usable:

Offline above the list

Related Issues

Closes #5552

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@iamwhatever
iamwhatever requested a review from a team September 27, 2026 17:53
@iamwhatever
iamwhatever requested a review from a team as a code owner September 27, 2026 17:53
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 27, 2026
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of eae694a45121f63f5a9f018aa85f364fb437778a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Verify the panel's add box surfaces the new text_too_long refusal readably — it's the one pre-existing writer now hitting a 400 it never saw.

Suggestions

  • The failed-save notice and Edit label borrow apps.issueRadar.views.crews.desk.settings_failed and components.commentOverlay.edit from other surfaces' namespaces; this page's own comment history (the offline.body reuse it had to unwind) shows where that coupling ends — own crewCompanion.reminders.* keys are one catalog entry each.

[DESIGN-REVIEWED] eae694a

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of eae694a45121f63f5a9f018aa85f364fb437778a — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Only breaking piece to confirm: reminders/add now refuses new text over 500 chars — the panel's add box hits that too.

What this change ships

Inventory (10 items) — 10 justified

Intent: let the user fix a reminder's text in place instead of deleting and re-adding it — an ADDITION (linked issue #5552).

  1. Each reminder row gains an Edit control (inline editor: Enter/blur saves, Escape cancels) — justified
  2. New POST /reminders/update route and CompanionStore.update, one consumer (editReminder) — justified
  3. Skip moves from a visible button into a "More actions" menu on repeating rows — justified (mandated by blocking max-two-buttons-per-row, website/AUTOSDE.yaml)
  4. New reminder text over 500 chars refused on add and update — justified (store MAX_BYTES load cap, store.py:74; writer sweep verified: 2 callers, no MCP path)
  5. A failed poll shows a notice above the list instead of replacing it — justified
  6. Offline notice reworded in every catalog — justified (old sentence false beside a still-visible list)
  7. A reminder that fires mid-edit stays listed until save or cancel — justified
  8. Below 480px the reminder text takes its own line — justified
  9. Skip's label becomes "Skip just the next one"; skip/skip_aria keys removed (0 remaining consumers, grepped reminders.skip) — justified
  10. New edit_aria key in all catalogs — justified

[FIRST-PRINCIPLES-REVIEWED] eae694a

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of eae694a45121f63f5a9f018aa85f364fb437778a and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] eae694a

False positive or not applicable? A repository writer can comment:
/ai-review override gpt eae694a45121f63f5a9f018aa85f364fb437778a: <one-sentence reason>

@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — 🟡 CONCERNS

UX-level review of eae694a45121f63f5a9f018aa85f364fb437778a — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: CONCERNS

Edit has no visible finish or cancel — blur silently saves, Escape is undiscoverable, and a failed save names no next step.

Watch

  • Finishing an edit is a guess: the reader saw "no Save or Cancel button anywhere" and couldn't tell whether "clicking elsewhere might save or cancel". Blur commits, so clicking away to abandon still saves; Escape-to-cancel is invisible (lens 6 hotkey parity). Every edit, moderate impact, persistent. Fix: a muted "Enter to save · Esc to cancel" hint while the editor is open.
  • Failed save gives no recovery path: reused string Could not save: {{error}} (shot-05) asserts failure only; the reader "can't tell if my change is kept somewhere waiting, or lost" and saw the still-green input beside red text ("no idea which to believe"). Fix: a reminders-specific string — "Couldn't save — your text is kept here. Press Enter to retry."
  • Two edit affordances for one operation: pencil on one-time rows, Edit hidden in the More menu on repeating rows; the reader had "no idea why they're different." Fix: use the More menu (Edit + Skip where applicable) on every row so edit lives in one place.

[UX-REVIEWED] eae694a

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 27, 2026
@github-actions

github-actions Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed eae694a45121f63f5a9f018aa85f364fb437778a — this comment is updated in place on each push.

Review details

Nothing blocks; two advisory findings in the new in-place reminder editor.

FINDING — website/src/apps/crew-companion/RemindersSection.tsx:57 — onCloseAutoFocus={(e) => e.preventDefault()} is unconditional, but only the Edit item mounts something to receive focus, so choosing "Skip just the next one" by keyboard unmounts the focused menu item with Radix's trigger-restore suppressed and no replacement target, stranding focus on <body> (the exact failure ApprovalModePicker.tsx:364 and SketchDialog.tsx:442 prevent) — and the menu is now the only route to Skip → Fix: preventDefault only on the Edit path (arm a ref in the Edit onSelect, as ChatSidebar's suppressMenuRestoreRef does) and otherwise let the trigger regain focus. (origin: validation)

FINDING — website/src/apps/crew-companion/RemindersSection.tsx:117 — the new hold promises to "keep its row until save or cancel", but every case that actually retains a row is one where the reminder left the store (tick() drops a fired one-time row via advance→done; a Remove from the panel or another tab deletes it), so store.update returns {"ok": False} → 404 reminder_not_found → apiPost rejects and the retained editor shows an unclearable save error whose only exit is Escape, discarding the text the hold existed to protect → Fix: when a held row's id is absent from the polled list, render it as already-fired/removed (read-only notice) instead of an editor whose save cannot succeed.

[OPUS-REVIEWED] eae694a

Verdict parsed from the review's SHA-scoped output markers for commit eae694a45121f63f5a9f018aa85f364fb437778a.

False positive or not applicable? A repository writer can comment:
/ai-review override fable eae694a45121f63f5a9f018aa85f364fb437778a: <one-sentence reason>

@iamwhatever
iamwhatever force-pushed the fix/companion-edit-task-5552 branch from 4f92cdd to be1a3ca Compare September 27, 2026 18:20
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/companion-edit-task-5552 branch from be1a3ca to 6f5ade2 Compare September 27, 2026 18:52
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 4: the More menu on repeating rows is not justified span=cabd352ad41f

Disposition: rebutted.
The 2-button row rule (max-two-buttons-per-row, blocking: true in website/AUTOSDE.yaml) is blocking, and the GPT lane upheld it on this PR's earlier head: Skip + Edit + Remove on one row was a blocking violation.
The More menu is how this change follows that rule. The rule itself names an overflow DropdownMenu as the fix; removing the menu branch brings the blocking violation back.
The maintainer chose this path over an override, since the rule finding is not a false positive.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Item 5: Skip's label and aria text change span=534b2f7652fa

Disposition: rebutted.
This follows from the same blocking 2-button row rule: once Skip lives in the More menu, the menu item is its label.
The item reads skip_title ("Skip just the next one"), the tooltip Skip already had, so the words the user sees are unchanged in meaning.
The per-reminder skip_aria text existed only to name the row's standalone button; a menu item inside that row's menu needs no row name, so the key had no reader left.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Screenshots predate the More menu span=8b2e9cc608ad

Disposition: fixed.
Fixed in 6f5ade2: the description now carries six shots captured at this revision, including the repeating row closed and with its More menu open, and a 360px row.
Each capture scene asserts before saving: no Skip button on the repeating row, the menu lists Skip and Edit, Remove is gone while editing.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Save error reads pale and gives no reason span=8bc9e3a6d5b8

Disposition: fixed.
Fixed in 6f5ade2: the error renders through the shared ErrorNotice inline variant (text-danger, alert icon) and carries the reason: "Could not save: {{error}}", reusing an existing key.
The pale grey in the old shot was the earlier cc-hint element; the new failed-save shot shows the danger colour.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Remove sits beside the open editor span=4d3b2cb7a70e

Disposition: fixed.
Fixed in 6f5ade2: Remove (and the tag and More control) are not rendered while the editor is open, so the only exits are Enter/blur (save) and Escape (cancel).
Pinned by CrewCompanionEditReminder.test.tsx (hides Remove while editing) and asserted by the capture harness.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Menu item label interpolates the reminder text span=9532c9139487

Disposition: fixed.
Fixed in 6f5ade2: the visible menu item reads a plain "Edit" (existing key); the interpolated edit_aria stays only as the input's and pencil's accessible name.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Poll failure discards an edit; text unreadable at 320px span=458d66fc86d2

Disposition: fixed.
Fixed in 6f5ade2: a failed poll now renders the offline note ABOVE the rows instead of replacing them, so an open editor is not unmounted; pinned by a test that rerenders with remError and finds the draft intact.
Narrow screens: below 480px the reminder row wraps and the text (or editor) takes its own full line (styles.ts), so time, tag and actions cannot squeeze it; shown in the 360px shot.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Sep 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/companion-edit-task-5552 branch from 6f5ade2 to 694ce0b Compare September 27, 2026 19:23
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 27, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Poll failure bypasses ErrorNotice; a firing reminder destroys its edit span=458d66fc86d2

Disposition: fixed.
Fixed in 694ce0b: the offline note renders through ErrorNotice (inline, no hand-off, with a comment naming the open draft).
A reminder that fires mid-edit is held in the list until save or cancel (section-level held row), so the editor stays mounted and the draft survives; pinned by a test that drops the reminder from the payload mid-edit.

@iamwhatever

iamwhatever commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Offline note is a plain muted div span=efc2463da872

Disposition: fixed.
Fixed in 694ce0b: it renders through the shared ErrorNotice inline variant.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Offline note contradicts the visible list span=1633a81bdda5

Disposition: fixed.
Fixed in 694ce0b: offline now reads "Couldn’t refresh your reminders. Retrying…" in every catalog, true both above a list and with none; the new offline screenshot shows it above the list.

@iamwhatever
iamwhatever force-pushed the fix/companion-edit-task-5552 branch from d5a6700 to c53f66b Compare September 27, 2026 20:55
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Unchanged draft overwrites a newer polled edit span=458d66fc86d2

Disposition: fixed.
Fixed in c53f66b: save now compares the draft with the text captured when the editor opened (opened ref), not the latest polled r.text, so an untouched draft never writes stale text over a newer edit; pinned by a test that refreshes the text mid-edit and blurs without typing.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Land the bundle re-baseline as its own chore PR first span=7625263f1de6

Disposition: rebutted.
Carried here by explicit maintainer ruling, following the file's own rule that a raise is justified in the PR that makes it; both measurements are in the comment beside the line.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • The editor's commit path is invisible span=c2e48bf23d92

Disposition: rebutted.
Enter or blur saves and Escape cancels is the scope the issue set and the repo's existing inline-editor contract (MeetingTitle.tsx); blank or unchanged text never saves.
A hint string would add copy beyond the goal to a catalogs chunk at its budget.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Failed-save text has no recovery step span=2bcd2ff56293

Disposition: rebutted.
The draft stays in the focused input with the ErrorNotice directly under it, and Enter retries the same save; the text reuses an existing shared key by maintainer ruling.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Pencil on one-time rows, Edit in the menu on repeating rows span=9fc45d707456

Disposition: rebutted.
The blocking 2-button row rule applies only where a row passes two actions; only repeating rows carry Skip, so only they get the menu, as the maintainer scoped it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Pencil sits beside the instant Remove span=79098cff1263

Disposition: rebutted.
Remove and its instant behaviour predate this PR; undo on remove is a new capability outside this PR's goal.
The pencil and the × are separate borderless icon buttons with the row's existing gap, the same spacing the × already had beside Skip.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Sep 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/companion-edit-task-5552 branch from c53f66b to a479378 Compare September 27, 2026 21:26
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Reverting text after an in-flight save loses the revert span=458d66fc86d2

Disposition: fixed.
Fixed in a479378: a successful save now sets opened.current = next, so a draft typed back to the original while that save was in flight compares against the saved text and is written; pinned by a test (save B, type A during the save, Enter after it resolves -> A is saved).

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Sep 27, 2026
@iamwhatever
iamwhatever force-pushed the fix/companion-edit-task-5552 branch from a479378 to 93fab5f Compare September 27, 2026 21:36
@iamwhatever

Copy link
Copy Markdown
Contributor Author

The catalogs-chunk budget change is no longer part of this PR. Main landed its own ceiling for chunk t in #14532, so on rebase this branch keeps main's website/scripts/check-bundle-size.mjs unchanged. The earlier review items about the re-baseline riding in this PR (spans 8012154d0c61, ee944fb806e3, 7625263f1de6) no longer apply to the diff.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Sep 27, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Failed-save text does not guide the next step span=19d8f3f10191

Disposition: rebutted.
The draft stays in the focused input with the ErrorNotice directly under it, and Enter retries the same save; Escape discarding an unsaved draft is the editor's stated cancel contract (MeetingTitle.tsx).
The text reuses an existing shared key by maintainer ruling; new guidance copy is beyond the frozen goal.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Edit reached two ways span=02b0984c0d52

Disposition: rebutted.
The blocking 2-button row rule applies only where a row passes two actions; only repeating rows carry Skip, so only they get the menu, as the maintainer scoped it.

@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Remove on a repeating row does not state its scope span=f8bd961f3a77

Disposition: rebutted.
Remove and its label predate this PR and are unchanged by it; relabelling it is outside this PR's goal.

A pencil on each reminder row opens an inline editor: Enter or blur
saves, Escape cancels, and a failed save keeps the draft open with an
error. POST reminders/update changes only the text, reusing the add
route's text rule; an unknown id answers 404 reminder_not_found.
@iamwhatever
iamwhatever force-pushed the fix/companion-edit-task-5552 branch from 93fab5f to eae694a Compare September 27, 2026 21:58
@iamwhatever

Copy link
Copy Markdown
Contributor Author
  • Ambiguous save failure can preserve the wrong text span=458d66fc86d2

Disposition: fixed.
Fixed in eae694a: the rejection handler now clears opened.current, so after a failed save (which may still have been stored) the next non-blank save always retries instead of closing as unchanged; pinned by a test (save B fails, type A back, Enter -> A is sent).

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 27, 2026
@chenmingwei23
chenmingwei23 merged commit 0715645 into main Sep 28, 2026
97 checks passed
@chenmingwei23
chenmingwei23 deleted the fix/companion-edit-task-5552 branch September 28, 2026 00:06
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 28, 2026
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.

Companion App: captured tasks cannot be edited, only deleted and recreated

2 participants