feat: UX hardening P0 — Plot Board DnD safety + Writer mode transparency#191
Conversation
handleDragOver previously rewrote a scene's act on every hover frame, so merely passing the cursor over another column reassigned the scene even when the drop was cancelled. It is now highlight-only; the act change commits in handleDragEnd (act-N container or adopted from the dropped-on card). handleAddForAct used setTimeout + sections[sections.length-1] against a stale closure, reassigning the WRONG section's act; addManuscriptSection also dropped every passed field but title. The reducer now honors the full section payload (act/color/status/summary/position) and add-to-act is a single deterministic dispatch via handleAddSectionForAct. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ks (P0) Flow/Focus/ProForge/collapsed-panel states combined into many layouts with no visible indicator of why a panel was hidden and no single reset. Adds: - WriterModeBadge: chips for each active non-default mode + 'restore standard layout' (clears focus/collapse/flow and turns ProForge off in one click). - WriterModeCoachmark + useFirstUseFlag: one-time, localStorage-persisted explainers on first activation of Flow/Focus/ProForge. - useWriterLayout.resetLayout(). i18n: 16 keys across all 17 locales (+bundles). Tests cover badge visibility, reset dispatch, and focus chip. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis diagram shows how the plot board now commits scene act changes only on drop and how the writer studio surfaces active modes with coachmarks plus a single action to restore the standard layout. sequenceDiagram
participant User
participant PlotBoard as Plot board UI
participant Store as Project store
participant WriterUI as Writer view UI
participant Layout as Writer layout manager
participant LocalStorage
Note over User,PlotBoard: Plot board drag and drop safety
User->>PlotBoard: Drag scene card into another act column
PlotBoard->>PlotBoard: Highlight target act during drag only
User->>PlotBoard: Drop scene on target column or card
PlotBoard->>Store: Commit new act for dropped scene based on drop target
Note over User,WriterUI: Writer modes transparency and reset
User->>WriterUI: Enable Flow Focus or ProForge mode
WriterUI->>LocalStorage: Check first use flag for this mode
WriterUI-->>User: Show mode badge and first use coachmark if needed
User->>WriterUI: Click restore standard layout
WriterUI->>Layout: Reset layout and clear non standard modes
Layout-->>User: Return to default three column writer view
Generated by CodeAnt AI |
…helper Addresses CodeAnt #191: useFirstUseFlag read/wrote localStorage directly. Adds services/storage/uiFlagStore (a tiny synchronous, non-sensitive UI-flag helper) and routes the hook through it, so UI-pref persistence goes through a single storage abstraction. Kept synchronous by design (project data uses the async IDB/dbService layer); localStorage key namespace unchanged (worldscript-hint-*). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis diagram shows how the Plot Board now commits scene act changes only on drop and adds scenes to a specific act deterministically, and how the Writer Studio surfaces active modes with a reset action and one-time coachmarks stored via a UI flag helper. sequenceDiagram
participant User
participant PlotBoard
participant StateStore
participant Writer
participant WriterStudio
participant Storage
User->>PlotBoard: Drop scene onto target act
PlotBoard->>StateStore: Commit scene act change based on drop target
User->>PlotBoard: Add new scene to specific act
PlotBoard->>StateStore: Add section with act and defaults in single dispatch
Writer->>WriterStudio: Enable Flow, Focus, ProForge or collapse panel
WriterStudio->>Storage: Check first-use flag and show coachmark if needed
Writer->>WriterStudio: Click restore standard layout
WriterStudio->>StateStore: Reset layout and turn off ProForge
Generated by CodeAnt AI |
…e 2 #191) Addresses CodeAnt #191 (5 findings): - ActSwimlane now registers a useDroppable with a stable act-N id, so dropping a scene into an EMPTY lane commits the act change (the act-* branches were dead). - handleDragOver resolves the hovered card's act, so the lane highlight appears over populated lanes too (not only empty ones). - uiFlagStore gains a module-level session-memory fallback so coachmark dismissals survive unmount/remount when localStorage is blocked. - useWriterLayout.resetLayout also resets the mobile tab to 'tools'. Tests: new uiFlagStore suite + WriterViewUI reset-mobile-tab assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis PR makes Plot Board scene moves act-safe by committing act changes only on drop, and improves Writer Studio transparency with visible mode badges, one-time coachmarks, and a single restore-layout action backed by a UI flag store. sequenceDiagram
participant User as Writer
participant PlotBoard as Plot Board UI
participant WriterUI as Writer View UI
participant Store as Project store
participant Flags as UI flag storage
User->>PlotBoard: Drag scene card over act lane
PlotBoard->>PlotBoard: Highlight hovered act lane only
User->>PlotBoard: Drop scene card
PlotBoard->>Store: Update scene act based on drop target
User->>WriterUI: Enable Flow, Focus, or ProForge mode
WriterUI->>Flags: Read first use flag for mode
WriterUI-->>User: Show one time coachmark if not seen
User->>WriterUI: Click Restore standard layout
WriterUI->>Store: Reset layout and turn off ProForge mode
Generated by CodeAnt AI |
- WriterModeBadge: wrap the decorative reset glyph in aria-hidden so SRs announce only the translated action text. - uiFlagStore.get now treats the session map as authoritative once a key is written (true OR false), so a failed localStorage removal can't resurrect a cleared flag from a stale '1'. Added unit coverage. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis PR hardens plot board drag and drop so scene acts change only on drop and new scenes are created directly in a chosen act, and it makes writer modes visible with a resettable layout and one-time coachmarks backed by a UI flag store. sequenceDiagram
participant Writer
participant PlotBoard as Plot Board UI
participant ProjectStore as Project store
participant WriterStudio as Writer Studio UI
participant Layout as Layout manager
participant UIFlags as UI flag store
Writer->>PlotBoard: Drag and drop scene card between act lanes
PlotBoard->>ProjectStore: Commit scene act change only on drop (hover is highlight-only)
Writer->>PlotBoard: Add new scene in a specific act
PlotBoard->>ProjectStore: Create new section with that act and default metadata in one dispatch
Writer->>WriterStudio: Enable Flow/Focus/ProForge or collapse panels
WriterStudio->>UIFlags: Check first-use flag, show one-time coachmark, mark mode as seen
WriterStudio-->>Writer: Show mode badge with active mode chips and restore layout action
Writer->>WriterStudio: Click restore standard layout
WriterStudio->>Layout: Reset layout to default and turn off ProForge mode in store
Layout-->>Writer: Render standard three-column writer view without mode badge
Generated by CodeAnt AI |
…ch target (wave 4 #191) - uiFlagStore gains _resetForTest() to clear the module-level session map; the test suite calls it in beforeEach so cases aren't order-dependent. - WriterModeCoachmark dismiss button now meets a 44px touch target on mobile (min-h-[44px] sm:min-h-0), matching the badge reset control. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis diagram shows how the Plot Board now commits act changes only on drop and how adding a new scene to an act creates the section with its act and defaults in a single deterministic dispatch. sequenceDiagram
participant User
participant SceneBoard
participant ProjectStore
User->>SceneBoard: Drag scene card
SceneBoard->>SceneBoard: handleDragOver highlights target act column only
User->>SceneBoard: Drop scene over act lane or another card
SceneBoard->>SceneBoard: handleDragEnd determines target act from drop target
SceneBoard->>ProjectStore: Dispatch updateManuscriptSection with new act (if changed)
ProjectStore-->>SceneBoard: Return updated manuscript sections
User->>SceneBoard: Click add scene for specific act
SceneBoard->>ProjectStore: Dispatch addManuscriptSection with act and default fields
ProjectStore-->>SceneBoard: New scene appears already assigned to chosen act
Generated by CodeAnt AI |
…n payload (wave 5 #191) CodeAnt flagged the random `position` added to buildNewSectionPayload as dead data: board placement is authoritative in project.sceneBoardLayout (keyed by section id), never section.position. Removed the field. This also exposed a latent bug — the sections-derivation fallback used Math.random() on every memo recompute, so an unplaced scene jumped to a new spot whenever the manuscript changed. Replaced it with an index-derived grid (fallbackPosition) so unplaced scenes keep a stable, deterministic position across renders. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
@CodeAnt-AI review |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
Sequence DiagramThis PR makes Plot Board scene moves deterministic by committing act changes only on drop and adding scenes to a specific act in a single dispatch, and improves Writer Studio mode transparency with a mode badge, reset layout action, and first-use coachmarks persisted via a UI flag store. sequenceDiagram
participant User
participant PlotBoard
participant ProjectStore
participant WriterLayout
participant UIFlagStore
User->>PlotBoard: Drag scene card across act columns
PlotBoard->>PlotBoard: Highlight potential target act without changing scene act
User->>PlotBoard: Drop scene on act lane or another card
PlotBoard->>ProjectStore: Commit scene act change based on final drop target
User->>PlotBoard: Click add scene button in a specific act
PlotBoard->>ProjectStore: Add new scene with act and defaults in one deterministic dispatch
User->>WriterLayout: Turn on Flow, Focus, or ProForge mode
WriterLayout->>UIFlagStore: Read first use flag and show mode badge or coachmark
User->>WriterLayout: Dismiss coachmark or click restore standard layout
WriterLayout->>UIFlagStore: Persist first use flag and reset layout and ProForge state
Generated by CodeAnt AI |
User description
Context
Part 1 of a stacked pair addressing user-facing UX/interaction risks from a focused audit. This PR carries the two P0 items (kept separate from P1/P2 so each PR stays under CodeAnt's ~100-file review limit). PR 2 (
feat/ux-hardening-p1) is stacked on this branch.Items
2 · Plot Board drag-and-drop safety (data-integrity)
handleDragOverpreviously rewrote a scene'sacton every hover frame, so merely passing the cursor over another column reassigned the scene even when the drop was cancelled. It is now highlight-only; the act change commits inhandleDragEnd(act-N container, or adopted from the dropped-on card).handleAddForActusedsetTimeout+sections[sections.length-1]against a stale closure, reassigning the wrong section's act;addManuscriptSectionalso silently dropped every passed field buttitle. The reducer now honors the full section payload (act/color/status/summary/position) and add-to-act is a single deterministic dispatch (handleAddSectionForAct).1 · Writer-Studio mode transparency
WriterModeBadge: chips for each active non-default mode (Flow/Focus/ProForge/collapsed panels) + a one-click "restore standard layout" (clears focus/collapse/flow and turns ProForge off).WriterModeCoachmark+useFirstUseFlag: one-time, localStorage-persisted explainers on first activation of Flow/Focus/ProForge.useWriterLayout.resetLayout().Tests & i18n
writer.*keys across all 17 locales (+ rebuilt bundles).🤖 Generated with Claude Code
CodeAnt-AI Description
Improve scene board drop behavior and make writer modes easier to understand
What Changed
Impact
✅ Fewer accidental scene moves✅ Safer add-to-act scenes✅ Clearer writer mode status💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.