PlotDirector/Docs/Writer/Context-UX-Refinement-20261122.md

18 KiB
Raw Blame History

Context UX refinement, Names Library and visual relationships

Development-only programme requested 22 November 2026. Base implementation: 504ecca; evidence-only follow-up 2eede4e. Existing untracked user investigations remain untouched. Production is outside scope.

Stage 1: shared UI and main-window reuse

Shared correction form geometry gives all controls full available content width, consistent spacing, minimum textarea height and vertical resizing. The shell dialog responds to viewport width independently of its originating pane. Loaded forms expose one Save and one Cancel; the shell fallback Cancel appears only if loading fails. Nested labels, initial input focus, Escape, inline validation, dirty-draft confirmation and the shared toast service are retained.

Main navigation extends ContextWindows / the existing authenticated presence hub with workspace.open and a closed structured target {tool, entityID}. ContextNavigationController resolves permitted Characters, Names, Relationships and Scene targets from canonical IDs after book/project/entity checks. No caller-supplied URL is accepted. Main shells register on the existing native presence connection; a shell without that connection creates one shared connection, not one per feature. Context windows retain their one connection.

A user/browser-profile environment preference restricts automatic main navigation to the same browser environment. It is not an authentication credential: every command and destination is independently authorised. Normal reference focus commands retain their book isolation; main navigation is explicitly allowed to an authenticated same-user main shell currently showing another book, because it revalidates the requested book before navigating. Another environment/device is never selected automatically. Browser-private/storage-disabled environments cannot share this preference and use the named-window fallback.

Main recipients acknowledge navigation, attempt focus where permitted and protect unsaved ordinary forms; Maps uses its existing requestLeave guard. Busy/declined/unconfirmed requests do not automatically open another window. Missing recipients use one named main window and an account/environment-scoped ten-second launch reservation in the existing registry to suppress concurrent fallback opens. Blocked popups retain an explicit named link retry. Focus and named-window targeting remain subject to browser security and browsing-context isolation. Transient leases, reconnect registration, authenticated IDs and data-change notifications remain separate from navigation. No Word navigation is requested.

Context workspace links use data-context-workspace-target plus optional data-context-entity as the reusable standard; href remains an accessible fallback. Existing main editors are not redesigned.

Stage 1 qualification: clean solution build (zero warnings/errors), 19 registry/routing/lease assertions, real-SignalR isolated browser routing suite, existing Characters editing/responsive suite and expanded shared-refinement browser acceptance passed. Every existing character/name correction variant (classification, description, emotional state, physical condition, location, canonical name, alias add and alias correction/removal) and the relationship form was checked for full-width controls; desktop/mobile, one Save/Cancel and Escape passed. Existing-main reuse, repeated actions, unsaved-main cancellation and one named missing-main fallback passed. Browser fixture editor endpoints render the real application shell/views; canonical persistence is qualified separately. Relationship main-editor navigation retains the selected story point. No database migration was needed in this stage.

Stage 1 deployed at 5de6e5f, archive context-refine-stage1-5de6e5f-20261122T162449Z. Published/live assembly and all changed navigation/form assets matched SHA-256; clean active-job guard before restart; service active. Actual Development acceptance reused one existing main window for the real Scene, Character, Names and Relationships editors, kept the Context scene unchanged and sent no Word navigation. Focus remains discretionary in the browser. No canonical edits were made by this navigation check.

Stage 2: Names Library discovery

Names now opens with bounded reference-library candidates rather than an identity catalogue. It calls the same INameIntelligenceService.BuildLibraryAsync with the complete existing NameSearchFilter: search, locale, birth year, gender preference/threshold, type, minimum commonness, project/book/accessible-project usage scope, used/unused, page and page size. No replacement database, generation or matching engine. Profiles retain existing prior weights, era, confidence, source, related forms and usage summary. Copy uses the clipboard and shared toast. Additional filters collapse; layouts use pane containers. Search cancellation propagates to the existing library query. Pagination retains criteria; pane state is independent.

The tool is book-scoped, works without an active scene and does not reload just because the scene changes. Exact established-name/alias lookup and candidate project-use inspection reuse GivenName_UsedDecorations, now bounded to 100 distinct use records. Canonical identity/aliases load only after explicit selection, with existing focused name/alias modals and My Windows character focus. No automatic merge or rename. The obsolete alphabetical presentation and separate suggestion-only partial were removed.

Underlying shared-query correction (migration299): the existing Name Search book-usage CTE joined every character to every book in its project, so unused-in-this-book could be reported as used. It now uses the same canonical SceneCharacters→Scenes→Chapters→Books membership joins as existing usage details. Project scope still includes project identities without appearances; Book scope requires a recorded appearance. Mentioned-only participation can establish name use, which does not establish physical presence or POV knowledge. No manuscript text matching or invented name-use evidence. The main controller now interprets its existing book scope selector correctly; hidden scope/pagination metadata preserve explicit criteria. The main UI is not redesigned. Nonvisual result IDs/counts permit exact parity acceptance.

Both live procedure definitions were checked against the previous authoritative migration before applying the new forward-only definitions. Development backup context-refine-stage2-20261122T163128Z.bak succeeded and VERIFYONLY passed. Migration299 applied and its procedures were smoke-verified. No canonical data rows were changed by the migration. Disposable qualification added one empty book and one reference-name alias on the existing synthetic character; shared-query acceptance proved used in the character's appearance book and unused in the empty second book.

Stage 2 predeployment qualification: clean solution build, seven direct library/filter/bounded-identity/read-only assertions, 17 existing character/name-edit assertions, stored-procedure architecture guard, actual compiled Razor browser with all filters, 100 candidates, profile/related forms/copy, on-demand identity/correction, pagination, independent panes and full/half/stacked/mobile passed. Touch-emulated 390px browser checks passed. Full Development query-parity acceptance follows installation. Existing open application/Context windows should reload once to acquire the updated tool scripts; no Word navigation is part of that reload.

Stage 2 deployed at 4857329, release context-refine-stage2-4857329-20261122T164213Z. Local/public GET200, informational commit and assembly/assets verified (including the new Names module). Ten actual Development main/Context searches matched exact ordered candidate IDs and used counts, covering empty/uncommon/near-prefix, aliases, used/unused, book/project/accessible-project scopes, all meaningful filters, two active locales and pagination. The alias was used in its appearance book and unused in the empty qualification book. Live focused editing with quiet second-session refresh and existing-main navigation passed again. No physical PWA/device acceptance is claimed.

Stage 3: Family and Story visual lenses

The previous text list is replaced with two purpose-built SVG views. Both use the canonical relationship records, existing narrative ordering and RelationshipMapService.BuildAtScene, existing verified evidence projection, existing focused relationship editing/services, My Windows and shared notifications. No new graph framework or story-state engine. Family defaults to POV, represents author-established structure independently of POV knowledge, keeps historical/archived relatives, and never manufactures missing relatives. Explicit directional parent/child, biological/adoptive/step and ancestor links control generations; spouses/partners align, known siblings group with reliable birth dates, multiple unions and half-siblings are preserved. Ambiguous/cyclic records are labelled rather than guessed. Canonical professional partnerships are not family unions.

Story prioritises explicitly physical participants (a Mentioned Only role overrides a contradictory presence label), preserves direction/reciprocity, uses category colours and a legend, and excludes future starts, later changes and unverified primary evidence. Selected links show current state and at most three established changes. The interface expressly avoids inferred first meetings, mutual trust or viewpoint knowledge. Global death status is excluded from Story DTOs because it has no narrative timestamp. No optional viewpoint-knowledge filter is offered: the available canonical data cannot reliably provide one.

Readers use new authorised stored procedures, bounded at 128 characters, 256 links and three verified events per link. Only canonical ordering metadata is read across the project (20,000-item safety limit); no manuscript or complete relationship histories. Lookup is literal escaped name/alias matching, minimum two characters and 25 results. Family expansion is bounded to six connection steps, with boundary messages and recentering for further exploration. Nodes retain readable size and support mouse/touch pan, pinch/buttons/wheel zoom and keyboard exploration. Per-pane lens/focus/pan/layout state survives switching; structural signatures exclude state-only changes so manuscript notifications do not reposition unchanged families. Recorded-connections disclosure provides accessible disambiguation in complex graphs.

User explicitly approved a canonical deceased-status field in response to the data-model question. Characters.IsDeceased is nullable: NULL Unrecorded, false Living, true Deceased. No backfill or inference from archival/imported prose. Family and character reference views label it as global author reference, without death-date/scene/knowledge claims. An existing shared focused modal saves only this field with SQL permission checks and nullable original-value comparison. The main Character form exposes the same optional field; unchanged/legacy saves preserve it. Backup export, stored-field contracts, JSON roundtrip, canonical reads and timeline projections include the field; older backups remain compatible.

Database qualification: migration300 applied after verified backup context-refine-stage3-20261122T170555Z.bak. Life-status backup context-refine-life-20261122T173415Z.bak succeeded and VERIFYONLY passed. Migration301 installed the nullable field and save/read procedures, then stopped on differently formatted deployed projection headers. Migration302 stopped before projection changes because of a malformed comment. Both attempts are preserved unchanged. Forward303 completed projections, and standalone idempotent 304_CharacterLifeStatusCanonical.sql consolidates the complete authorised definition for future environments. Use 304 directly for this field, not a blind replay of 301–303. Exact Character_Save preflight matched authoritative previous logic; all projection anchors were checked before applying. Final schema/procedure smoke passed. Transactional tests proved nullable CAS rejects stale saves, legacy full saves preserve status, explicit full-editor saves update it, and rollback leaves all canonical statuses unrecorded. No real manuscript records changed.

Stage 3 qualification: solution build zero warnings/errors; 10 visual-domain assertions, 12 focused relationship assertions and 21 character/name/life-status assertions passed. Layout tests cover four generations, multiple spouses, half-siblings, adoption/step/Child reversal, unknown/cyclic/cross-generation records, reliable birth order and 120 nonoverlapping nodes; Story sizes 1–128 are checked for nonoverlap. Actual compiled Razor browser passed SVG hit selection, source-specific modal, 120-node family, dense 45-edge network, scene changes, independent panes, full/half/stacked/mobile, keyboard pan/zoom, read-only controls, and zero family layout recalculations on state-only notification. Family death indicator and Story omission are tested. Full integration and actual Development persistence follow installation.

Stage 3 deployed at 01a7723, archive context-refine-stage3-01a7723-20261122T173935Z. Clean active-job guard immediately before restart; local/public HTTP200; informational assembly commit and SHA-256 assembly/graph/form/navigation/CSS matches verified. Actual Development browser passed single-field life-status persistence, Family-only DTO status, Story omission and restoration of the original value on the disposable character. Relationship create/correction and selected-link refresh in a second authenticated browser session passed, with zero receiving success toasts, one native SignalR connection per Context and no Word navigation. Other real manuscript data was not edited.

Stage 4: integrated qualification and final delivery

Full executable regression harness completed successfully with 748 PASS lines and exit0. Final solution build passed with zero warnings/errors. Full harness includes the new Family/Story, character life-status and existing relationship/Names/routing/permissions/backup contracts. Compiled-browser acceptance passed all nine character/name modal variants plus relationship at desktop/mobile, one Save/Cancel, Escape, main-shell reuse/unsaved guard and bounded fallback. Names browser covered all criteria, 100 results, profiles/related forms/copy, usage/identity corrections, pagination, independent panes and full/half/stacked/narrow layouts. The live main/Context Names parity suite passed all ten equivalent queries again on this release, including unused-in-the-empty-other-book behaviour.

Real-SignalR My Windows acceptance passed exact recipient/pane-only reload, no-handler behaviour, cross-user/book/story-point rejection and reconnect recovery. Actual Development navigation passed all four main workspaces with no extra window, no Context scene change and no Word navigation. Browser test adjustments use SVG attachment for zero-width vertical edge groups and dismiss the existing navigation toast through its normal accessible button before a later footer click; no forced clicks or product guard bypasses. Actual Development editing passed description/alias persistence, cancel/unsaved handling, retained failed inline name draft, life status, relationship correction, quiet second-window refresh and one connection per Context.

Chromium touch emulation at 390px passed character/name disclosure taps, graph person selection, zoom buttons, real CDP touch drag and two-finger pinch, Family/Story switching and no document horizontal overflow. Full/half/stacked/mobile graph cases retain legible fixed node dimensions; complex family/network interactions were exercised rather than only HTML assertions. Visual review shortened graph captions and corrected selected-lens contrast using existing theme tokens. Physical phone/tablet, installed PWA/windowing differences and assistive-technology review remain manual acceptance items; no physical-device or PWA-installation claim is made.

Development journal since Stage3 restart had zero error categories and only the existing HTTPS-redirection warning. Final Stage4 release records its source commit, archive, pre-restart guard and published/live hashes in deployment evidence. Existing open windows should reload once to receive the new modules. Production was not accessed or modified. The two original untracked investigation documents were preserved.

Practical limits / remaining manual acceptance

  • Browser focus is discretionary. Private/storage-isolated profiles cannot locate another profile's main window and use one named fallback; physical devices are never selected automatically.
  • Author-reference Family truth and global life status can reveal author knowledge. Story excludes global death status and later narrative developments; reliable death-at-scene/POV knowledge is not modelled or invented.
  • Inspect a representative author-owned complex family and dense scene for editorial readability. Ambiguous canonical/cyclic types are labelled; very large views use explicit bounds and recenter/expand rather than loading every record.
  • Physical-device touch, installed desktop/mobile PWA behaviour and screen-reader acceptance remain manual.

Key acceptance logs on this host: /tmp/context-refine-stage4-regression.log, context-refine-stage4-build.log, context-refine-stage3-polish-browser.log, context-refine-stage3-shared-browser.log, context-refine-stage4-touch.log, context-refine-stage4-names-browser.log, context-refine-stage4-names-parity.log, context-refine-stage4-windows.log, context-refine-stage4-navigation-final.log, context-refine-stage4-live-editing-final.log. These contain no credentials. SQL backup verification is not claimed as a restore test; life-status compatibility was checked by canonical JSON roundtrip, stored-field harness contracts and rollback-protected SQL save smoke.

Final Stage4 deployed source commit d9559713a5beef504f9ca595a8287693c8056256, release /srv/apps/plotdirector-dev/releases/context-refine-stage4-d955971-20261122T174505Z. Clean Development active-job guard, service active, public/local HTTP200, informational version and all twelve published/live assembly/assets hashes verified. Postdeployment authenticated Family/Story/lookup reads passed: authorised focus, bounded responses and no global life-status value in Story. Final deployment manifest: /tmp/context-refine-stage4-deployment.json; authenticated smoke: /tmp/context-refine-stage4-final-health.log. Implementation commits: Stage1 5de6e5f, Stage2 4857329, Stage3 01a7723, Stage4 d955971.