From d47d86ef0f3f37854e745f43debb0c35d1c8dd26 Mon Sep 17 00:00:00 2001 From: Greg Trihus Date: Thu, 3 Sep 2026 15:51:19 -0500 Subject: [PATCH 1/2] TT-7051 Enhance context and functionality for Sections & Passages in the project. Added definitions for Sections, Passage Cards, and Current Passage in CONTEXT.md. Updated PassageCard component to include unique IDs and data attributes for better accessibility. Modified PlanView to restore the Current Passage from local storage and ensure it is in view when loaded. Added tests to verify the restoration and scrolling behavior of the Current Passage card. --- CONTEXT.md | 12 ++ .../src/components/Sheet/PassageCard.tsx | 5 + .../src/components/Sheet/PlanView.cy.tsx | 202 +++++++++++++++++- .../src/components/Sheet/PlanView.tsx | 38 +++- 4 files changed, 250 insertions(+), 7 deletions(-) diff --git a/CONTEXT.md b/CONTEXT.md index e1b4fb973..6493ca688 100644 --- a/CONTEXT.md +++ b/CONTEXT.md @@ -70,6 +70,18 @@ _Avoid_: Hierarchical; calling flat rows "passages" Project structure with sections containing numbered passages. _Avoid_: Flat +**Sections & Passages**: +The project page that lists sections and passages — desktop sheet or mobile cards. +_Avoid_: PlanSheet; PlanView (implementation names) + +**Passage Card**: +A mobile card for a passage (or section+passage) on Sections & Passages. +_Avoid_: Sheet row; table cell + +**Current Passage**: +The last passage the user opened for work, stored per user in local storage so Sections & Passages can restore focus. +_Avoid_: Last row (desktop-sheet wording); selected row + ## Publishing & Akuo Publishing in APM normally means releasing **oral content** to listeners — not transferring transcriptions. Text content follows the Paratext sync path instead. diff --git a/src/renderer/src/components/Sheet/PassageCard.tsx b/src/renderer/src/components/Sheet/PassageCard.tsx index 4468f9ab3..6a8a99827 100644 --- a/src/renderer/src/components/Sheet/PassageCard.tsx +++ b/src/renderer/src/components/Sheet/PassageCard.tsx @@ -52,9 +52,13 @@ export function PassageCard(props: IProps) { } }; + const passageId = cardInfo.passage?.id; + return ( @@ -118,6 +122,7 @@ export function PassageCard(props: IProps) { )}