Repository navigation
[2476 by Claude Opus 5] Keep a new plan's title in sync with its prompt and LLM-generated name instead of freezing the first word - #2481
Conversation
New `propr-ui/src/components/TaskPlanner/planDisplayName.ts` - `isStalePromptDerivedName(name, prompt)` — true when the prompt starts with the name (trailing `...` ignored) and the name is shorter than the title the current prompt would produce. - `getDraftDisplayName(draft, fallback)` — refreshes stale prompt-derived names via `truncateToSentences` (so the UI matches exactly what the server stores), shows LLM-generated and user-provided names unchanged, and falls back prompt-title → fallback text. `setupWizardHooks.ts` — exported `PromptPersistedUpdate`, added an optional fifth `onPersisted` parameter to `usePromptPersistence` held in a ref (so an inline callback doesn't recreate `enqueuePromptSave`), fired after `updateDraft` resolves inside the save queue — which covers debounced saves and pre-generation flushes alike. `SetupWizard.tsx` — new `onDraftMetadataPersisted` prop, forwarded through a third parameter of `useSetupWizardLoaders` into `usePromptPersistence`. `PlanStudioPage.tsx` — added `metadataOverride` state + `applyMetadataOverride`, used only for the page title and only while the draft is in `draft`/`failed` status; it is deliberately not merged into the `draft` prop given to `SetupWizard` (that would reset `useDebouncedDraftPersistence` and drop keystrokes). The title now prefers the refetched `draft` over the one-time `inPlaceDraft` snapshot, and the override resets on `location.key`. `getTaskTitle`/`getDocumentTitle` use the helper. `PlanEditor.tsx`, `ApprovedPlanView.tsx`, `PlansPageComponents.tsx` — switched from `draft.name || draft.initial_prompt` to `getDraftDisplayName`. No backend/API changes. Tests: new `planDisplayName.test.ts` (12 cases) and two new cases in `setupWizardHooks.persistence.test.tsx` covering `onPersisted` on debounced save and on flush. Two notes worth flagging: - `npm test -w propr-ui` passes in full (158 files, 1242 tests), as do `typecheck` and `lint --max-warnings 0`. Getting lint green required compacting a few lines in `SetupWizard.tsx` and `setupWizardHooks.ts` — both files sat exactly at the 400-line `max-lines` cap, and my additions pushed them over. I compacted in the dense one-line style those files already use (e.g. the `SetupWizardLoadersParams` interface, `savePromptDirectly`), changing no behavior. - I verified the acceptance criteria I could exercise without a running backend (helper behavior, persistence callback, title-computation wiring, no character loss in existing persistence tests). The live end-to-end tab-title check on `/studio/new` I did not run, since it needs the API and database stack. For preview evidence I rendered the real `PlansListItem` against a temporary Vite harness and captured before/after screenshots with Playwright, then removed the harness. The before shot shows the frozen `Add` / `Fix` titles; the after shot shows the full derived titles with the LLM name and user rename untouched. The browser tab title change is not capturable in a screenshot, so it is not represented in the previews.
|
/ultrafix |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — claude:claude-opus-5Overall EvaluationThis PR fixes the "frozen first word" plan title by (a) introducing a shared I traced the changed paths and found no correctness or safety regression that blocks merge. The staleness heuristic is conservative in the right direction: because the client ✅ Pure, well-covered display helper — ✅ Deliberate, documented separation of title state from editor state — the comment above ✅ Callback wired through a ref, not a dependency — Status: ready to merge once the pending CI shards complete. Merge blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Duplicate truncation rules diverge
S2: 🟢 No test for the page-level title glueThe user-visible defect lives in S3: 🟢
|
…CI failures were already resolved by the previous commit. The dashboard is rebuilt to the Studio guidelines, and the CI failures were already resolved by the previous commit. ## CI failures (comments 1, 2, 3, 5) Already fixed by `1760d21ec`, the commit after the one CI reported against (`bd9892fa3`). I verified rather than assumed: `apps/desktop/scripts/packaged-acceptance-stats.test.mjs` now passes (6/6), and it still passes after my changes — it greps the dashboard component sources, so it was worth re-running. ## Design regressions (comment 4) **1. Card Hell — eliminated.** The page is `bg-white` end to end. Every section lost `rounded-xl border shadow-sm`, the `gap-4` between cards is gone, and structure now comes from 1px rules: a `border-b` per section, a full-height `lg:border-r` pane divider, and tinted utility headers. Because grid cells stretch, the horizontal rules in both columns land on the same pixel — the "Horizon Line" from §2A. **4. Entity tagging — schema enforced.** `WorkReference` no longer emits bare numbers; it's `Issue #118` or `PR #2481`, always. `RepositoryLabel` became a monospace chip too, so `example/workspace` gets the same `font-mono bg-slate-100 border-slate-200 rounded-sm` treatment as an ID. **6. Semantic colour — corrected.** `merged` was `text-teal-700` while `completed` was slate; both are now `text-slate-600` with a checkmark, so two successful end states can't be told apart by colour. Cancelled dropped orange. Failed stays red. Active work swapped the pulsing dot for a spinner — a filled circle reads as a status light, and a teal one reads green at a glance. The histogram was uniformly `#14B8A6`; settled days are now slate-300 and only the in-progress day is teal. **7. KPI cards — demolished.** The four boxes are one compact row of label-beside-number pairs, roughly 34px instead of ~120px. Section counts also moved inline into the utility headers as `HAPPENING NOW (6)`. ## Guarding against another relapse Since the complaint is that this regressed after prior correction, I added `Dashboard.designRules.test.tsx` — 7 tests asserting the rendered chrome (no rounded/shadow sections, no bare `#118`, identical classes for merged and completed, no green in the active section, neutral history bars, no card-shaped counts). I mutation-checked them: reverting the bare-number chip, the teal `merged`, and the card chrome each fails a test. Shared fixtures moved to `Dashboard.fixtures.ts`, which also cleared a pre-existing `max-lines` warning on the test file. ## Verification 1251/1251 UI tests, 4/4 dashboard Playwright specs (including the 320px no-overflow check), typecheck clean, eslint clean with zero warnings on all changed files, desktop acceptance test 6/6. One judgment call worth flagging: the review asked for either a compact data row *or* counts folded into section headers. I did both — the row keeps the drill-down links that the original PR's acceptance criteria depend on, while the headers carry counts where a section already owns one. If you'd rather drop the row entirely and rely only on headers, that's a small change, but it costs the four filtered-list entry points. PR: #2486 Comment by: @propr-dev[bot] (ID: 5795997485) Comment by: @propr-dev[bot] (ID: 5795997900) Comment by: @propr-dev[bot] (ID: 5796059106) Comment by: @integry (ID: 5796089352) Comment by: @propr-dev[bot] (ID: 5796207333) Comment by: @github-actions[bot] (ID: 5796208101) Model: claude-opus-5
AI Implementation Summary
Closes #2476
Branch:
2476/claude-opus-5-keep-a-new-plan-s-title-i-20260923-1155-xkuCommits: ✅ Changes committed (4c64063)
AI Processing Completed
Execution Details:
Summary:
Implementation complete. Summary of what I did for issue #2476:
New
propr-ui/src/components/TaskPlanner/planDisplayName.tsisStalePromptDerivedName(name, prompt)— true when the prompt starts with the name (trailing...ignored) and the name is shorter than the title the current prompt would produce.getDraftDisplayName(draft, fallback)— refreshes stale prompt-derived names viatruncateToSentences(so the UI matches exactly what the server stores), shows LLM-generated and user-provided names unchanged, and falls back prompt-title → fallback text.setupWizardHooks.ts— exportedPromptPersistedUpdate, added an optional fifthonPersistedparameter tousePromptPersistenceheld in a ref (so an inline callback doesn't recreateenqueuePromptSave), fired afterupdateDraftresolves inside the save queue — which covers debounced saves and pre-generation flushes alike.SetupWizard.tsx— newonDraftMetadataPersistedprop, forwarded through a third parameter ofuseSetupWizardLoadersintousePromptPersistence.PlanStudioPage.tsx— addedmetadataOverridestate +applyMetadataOverride, used only for the page title and only while the draft is indraft/failedstatus; it is deliberately not merged into thedraftprop given toSetupWizard(that would resetuseDebouncedDraftPersistenceand drop keystrokes). The title now prefers the refetcheddraftover the one-timeinPlaceDraftsnapshot, and the override resets onlocation.key.getTaskTitle/getDocumentTitleuse the helper.PlanEditor.tsx,ApprovedPlanView.tsx,PlansPageComponents.tsx— switched fromdraft.name || draft.initial_prompttogetDraftDisplayName. No backend/API changes.Tests: new
planDisplayName.test.ts(12 cases) and two new cases insetupWizardHooks.persistence.test.tsxcoveringonPersistedon debounced save and on flush.Two notes worth flagging:
npm test -w propr-uipasses in full (158 files, 1242 tests), as dotypecheckandlint --max-warnings 0. Getting lint green required compacting a few lines inSetupWizard.tsxandsetupWizardHooks.ts— both files sat exactly at the 400-linemax-linescap, and my additions pushed them over. I compacted in the dense one-line style those files already use (e.g. theSetupWizardLoadersParamsinterface,savePromptDirectly), changing no behavior./studio/newI did not run, since it needs the API and database stack.For preview evidence I rendered the real
PlansListItemagainst a temporary Vite harness and captured before/after screenshots with Playwright, then removed the harness. The before shot shows the frozenAdd/Fixtitles; the after shot shows the full derived titles with the LLM name and user rename untouched. The browser tab title change is not capturable in a screenshot, so it is not represented in the previews.Detailed Logs:
056875cc-a76b-491a-b1a3-c76915f0cefbLog files stored at:
/tmp/claude-logs/issue-2476-2026-09-23T12-07-13-037Z-conversation.json/tmp/claude-logs/issue-2476-2026-09-23T12-07-13-037Z-output.txtLatest Conversation Messages
This PR was created automatically by ProPR after processing issue #2476.
💡 Need changes?
Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!
Visual preview
Plans list before
Plans list rendered by the real PlansListItem component before the fix. The first two plans, whose stored name was captured from the first word the user typed, show the frozen titles "Add" and "Fix".
Original unavailable: managed storage is unavailable or the upload has expired.
Plans list after
Same component and same data after the fix. Stale prompt-derived names are refreshed from the current prompt ("Add dark mode toggle to settings.", "Fix the flaky planner autosave test on CI."), while the LLM-generated name "Dark Mode Settings Toggle" and the user rename "Settings polish" are shown u
Original unavailable: managed storage is unavailable or the upload has expired.