PlotDirector/Docs/Navigation/FocusRibbonConsolidation.md

7.0 KiB
Raw Blame History

Focus ribbon consolidation

Navigation audit

Surface Existing operation Treatment
Current Focus popup Previous/Next Authoritative scene stepping, including chapter boundaries Removed from popup; same service and boundary logic now power shared ribbon commands. Search, selection and history remain.
Review Reading & Review Previous/Next GET chapter links; reader-specific chapter navigation, not scene stepping Removed ribbon contributions. Retained local chapter controls only in Focus Reading; normal integrated Review hides redundant chapter picker and links. Standalone Reader retains chapter controls.
Review chapter picker Explicit reader chapter choice; preserves reading/focus query state and no-script GET navigation Retained for specialised Focus Reading and standalone Reader. Normal Review uses global selection, with the existing dirty-annotation guard and stable partial refresh.
Relationships Local scene scrubber/Previous Scene/Next Scene; separate Previous/Next relationship change markers Retained. Go explicitly selects the global scene through the existing local explorer. Global stepping never moves it.
Maps Local scene Previous/Next, or dated-event stepping in Time lens; six independent lenses Retained, including journey/travel context. Go explicitly enters Scene lens and selects global scene. Missing scene/scenario reports unavailability, without changing scenario.
Floor Plans Local occupancy Previous Scene/Next Scene and eligible scene picker Retained. Go enters occupancy and selects an eligible global scene. Unavailable scenes disable Go. Existing floor/occupancy edit mechanisms remain.
At This Point Read-only local book/chapter/scene snapshot controls Retained. Go selects global scene and loads via existing snapshot AJAX. Local selection never writes focus.
Timeline Local jump/search/reveal controls; explicit scene-opening links Retained. Go opens focused scene inspector through existing same-workspace navigation, preserving current filters. Hidden/absent scenes offer an explicit unfiltered reveal.
Plot Lines Find a Scene, intersections-only filter, Next intersection, inspector links Retained. Go pans/scrolls and highlights visible scene. Missing/filtered scene offers explicit inspection, preserving selected plot lines and filters.
Calendar / Writer Reflect Previous/Next month and story-month navigation Retained: time-window filters, not narrative stepping.
Review annotations Previous annotations / More annotations Retained: pagination, not narrative stepping.
Threads, Writer objectives, recordings, comparison/reference selectors Entity editing, independent task/session targets, or local inspection Retained. No implicit global retargeting.

Shared implementation

_FocusRibbon renders the same three buttons in every contextual category. Existing ribbon overflow fitting treats it as a normal group. Flex ordering places it last, before an existing contextual Help group; no Help group is created. Disabled buttons render with the group before initialization, so command availability does not insert or shift layout.

narrative-focus.js remains the sole focus commit path. Previous/Next reuse the existing canonical scene sequence, boundary calculations, versioned service writes, history and multi-window notifications. Chapter-only focus uses the already-qualified server semantics: an available scene within its chapter or the neighbouring canonical scene; empty books have no enabled stepping. Go never calls Set.

PlotDirectorFocusWorkspace supplies one presentation adapter for the current workspace. Scene Explorer adapters call the same local choose callback as manual exploration. Other adapters use existing reader, snapshot, chapter destination, Timeline or weave mechanisms. Unsupported pages disable Go. Chapter-only focus supports chapter destinations/Review; scene-specific views require a scene.

Review reuses narrative-focus-review.js: guard open/dirty editors, reuse current chapter without fetching, otherwise replace only read-only sections in stable columns; preserve focus reading, accepted identity, annotations, update state, recording and verified Word objects. Scene focus can select an existing accepted mapping only; no paragraph association is manufactured. Chapter-oriented Book destinations use retainNarrativeFocus=true, so they do not erase global scene focus.

Timeline's Go uses existing document navigation within Timeline, retaining query filters and normal unsaved-navigation protection. Plot Lines' excluded-scene action opens the existing inspector without replacing line selection. These choices preserve existing contracts rather than adding another inspector renderer or filter system. No database or synchronisation changes are required.

Compact Focus menus close after successful commands and retain sensible keyboard focus. Failed focus writes remain visible and retryable. Go refuses to switch dirty/busy map editing or unsaved floor-plan layouts; it leaves the existing draft and local position intact. Cross-window refreshes queued during an asynchronous Go are processed afterwards.

Qualification

  • Solution build: zero warnings/errors; full executable regression harness: 632 passing checks.
  • Browser/focus-ribbon.cjs: Chromium and CDP-installed standalone Chromium PWA; shared ordering before existing Help/at end, no Review ribbon duplicates, one-click canonical stepping, guarded reader following, aligned no-op Go, Focus Reading preservation/exit, real chapter destination retaining scene context, real Timeline inspector and explicit filtered reveal, AJAX snapshot isolation, weave highlight/explicit inspection, unsaved floor-plan protection, disabled unsupported pages, light/dark at 1666/950/650px.
  • Updated Browser/narrative-focus.cjs: browser and installed PWA; global/local isolation and explicit Go for Floor Plans, Relationships and Maps, objective/editor/session/Word boundaries, protected Review annotations, canonical boundaries/empty chapter, persistence/history/scope, cross-window conflicts, search and project-wide context.
  • Updated popup and icon suites: browser and installed PWA; no header stepping controls, selection/search/history/dismissal/error behaviour, existing Reader commands, stateful icons and Word badges. Matching chevrons are compared in the same enabled state.
  • Updated manuscript-reader suite: real Razor/controllers, three widths × four themes × browser/PWA, specialised chapter controls in Focus Reading, selectable accepted text, private responses and scope/empty/error handling.

Browser qualification uses the compiled application test host with isolated repositories and representative synthetic author data; Word transport is simulated. No real author story records were changed by these tests. Timeline Go intentionally reuses document navigation; other adapters use existing local/partial-render mechanisms. Unavailable local scenes remain unavailable rather than changing scenarios, selected plot lines, filters or verified paragraph associations implicitly.