feat(standalone): floating sheet navigator panel backed by a C++ hierarchy export (sheet-panel)
Canvas-only eeschema sessions (read-only viewers, hide-UI editors) could not reach the wx hierarchy pane, so a viewer of a hierarchical design was stuck on the entry sheet. Adds the React stand-in (SheetPanel) + the bridge: - eeschema_embind: kicadSheetsGetTree() (SCHEMATIC::Hierarchy(), page-number ordered: instance KIID path / parent / Sheetname / file / page / depth) and kicadSheetsEnter(path) (validated synchronously, applied on the coroutine via SCH_ACTIONS::changeSheet — same route as the wx pane, history intact). OnSchSheetChanged pushes window.kicadCollab.onSheetsState after EVERY navigation, wx-driven included, so the panel is event-driven. - kicad → 9ab93b838e: navigate actions allowlisted for read-only viewers. - SheetPanel.tsx: LayerPanel shell conventions; rendered + menu row only when the hierarchy has >1 sheet instance; viewers boot it collapsed. - tests: fixtures/demo/hier (root → Power, IO → Sub) + web/sheet-panel.spec (list/order/depth, navigate + collab rebind, menu toggle/close, flat schematic has no panel, bridge-driven navigation updates the panel); SheetPanel.test.ts for the wire parser. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CtN6ASBvMGNbjPqY5boycg
This commit is contained in:
parent
fab6108cbb
commit
f3119e690f
12 changed files with 762 additions and 1 deletions
49
tests/fixtures/demo/hier/hier.kicad_sch
vendored
Normal file
49
tests/fixtures/demo/hier/hier.kicad_sch
vendored
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
(kicad_sch
|
||||
(version 20250114)
|
||||
(generator "eeschema")
|
||||
(generator_version "9.0")
|
||||
(uuid "a0000000-0000-4000-8000-000000000001")
|
||||
(paper "A4")
|
||||
(title_block
|
||||
(title "Hierarchy demo — root")
|
||||
)
|
||||
(lib_symbols)
|
||||
(wire
|
||||
(pts (xy 50.8 101.6) (xy 101.6 101.6))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid "c0000000-0000-4000-8000-000000000011")
|
||||
)
|
||||
(sheet
|
||||
(at 50.8 50.8)
|
||||
(size 25.4 20.32)
|
||||
(exclude_from_sim no)
|
||||
(in_bom yes)
|
||||
(on_board yes)
|
||||
(dnp no)
|
||||
(fields_autoplaced yes)
|
||||
(stroke (width 0.1524) (type solid))
|
||||
(fill (color 0 0 0 0.0000))
|
||||
(uuid "a0000000-0000-4000-8000-0000000000a1")
|
||||
(property "Sheetname" "Power" (at 50.8 50.0876 0) (effects (font (size 1.27 1.27)) (justify left bottom)))
|
||||
(property "Sheetfile" "power.kicad_sch" (at 50.8 71.7046 0) (effects (font (size 1.27 1.27)) (justify left top)))
|
||||
(instances (project "hier" (path "/a0000000-0000-4000-8000-000000000001" (page "2"))))
|
||||
)
|
||||
(sheet
|
||||
(at 101.6 50.8)
|
||||
(size 25.4 20.32)
|
||||
(exclude_from_sim no)
|
||||
(in_bom yes)
|
||||
(on_board yes)
|
||||
(dnp no)
|
||||
(fields_autoplaced yes)
|
||||
(stroke (width 0.1524) (type solid))
|
||||
(fill (color 0 0 0 0.0000))
|
||||
(uuid "a0000000-0000-4000-8000-0000000000a2")
|
||||
(property "Sheetname" "IO" (at 101.6 50.0876 0) (effects (font (size 1.27 1.27)) (justify left bottom)))
|
||||
(property "Sheetfile" "io.kicad_sch" (at 101.6 71.7046 0) (effects (font (size 1.27 1.27)) (justify left top)))
|
||||
(instances (project "hier" (path "/a0000000-0000-4000-8000-000000000001" (page "3"))))
|
||||
)
|
||||
(sheet_instances
|
||||
(path "/" (page "1"))
|
||||
)
|
||||
)
|
||||
31
tests/fixtures/demo/hier/io.kicad_sch
vendored
Normal file
31
tests/fixtures/demo/hier/io.kicad_sch
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
(kicad_sch
|
||||
(version 20250114)
|
||||
(generator "eeschema")
|
||||
(generator_version "9.0")
|
||||
(uuid "b0000000-0000-4000-8000-000000000003")
|
||||
(paper "A4")
|
||||
(title_block
|
||||
(title "Hierarchy demo — io")
|
||||
)
|
||||
(lib_symbols)
|
||||
(wire
|
||||
(pts (xy 50.8 101.6) (xy 101.6 101.6))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid "c0000000-0000-4000-8000-000000000013")
|
||||
)
|
||||
(sheet
|
||||
(at 50.8 50.8)
|
||||
(size 25.4 20.32)
|
||||
(exclude_from_sim no)
|
||||
(in_bom yes)
|
||||
(on_board yes)
|
||||
(dnp no)
|
||||
(fields_autoplaced yes)
|
||||
(stroke (width 0.1524) (type solid))
|
||||
(fill (color 0 0 0 0.0000))
|
||||
(uuid "a0000000-0000-4000-8000-0000000000a3")
|
||||
(property "Sheetname" "Sub" (at 50.8 50.0876 0) (effects (font (size 1.27 1.27)) (justify left bottom)))
|
||||
(property "Sheetfile" "io_sub.kicad_sch" (at 50.8 71.7046 0) (effects (font (size 1.27 1.27)) (justify left top)))
|
||||
(instances (project "hier" (path "/a0000000-0000-4000-8000-000000000001/a0000000-0000-4000-8000-0000000000a2" (page "4"))))
|
||||
)
|
||||
)
|
||||
16
tests/fixtures/demo/hier/io_sub.kicad_sch
vendored
Normal file
16
tests/fixtures/demo/hier/io_sub.kicad_sch
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(kicad_sch
|
||||
(version 20250114)
|
||||
(generator "eeschema")
|
||||
(generator_version "9.0")
|
||||
(uuid "b0000000-0000-4000-8000-000000000004")
|
||||
(paper "A4")
|
||||
(title_block
|
||||
(title "Hierarchy demo — io sub")
|
||||
)
|
||||
(lib_symbols)
|
||||
(wire
|
||||
(pts (xy 50.8 101.6) (xy 101.6 101.6))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid "c0000000-0000-4000-8000-000000000014")
|
||||
)
|
||||
)
|
||||
16
tests/fixtures/demo/hier/power.kicad_sch
vendored
Normal file
16
tests/fixtures/demo/hier/power.kicad_sch
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
(kicad_sch
|
||||
(version 20250114)
|
||||
(generator "eeschema")
|
||||
(generator_version "9.0")
|
||||
(uuid "b0000000-0000-4000-8000-000000000002")
|
||||
(paper "A4")
|
||||
(title_block
|
||||
(title "Hierarchy demo — power")
|
||||
)
|
||||
(lib_symbols)
|
||||
(wire
|
||||
(pts (xy 50.8 101.6) (xy 101.6 101.6))
|
||||
(stroke (width 0) (type default))
|
||||
(uuid "c0000000-0000-4000-8000-000000000012")
|
||||
)
|
||||
)
|
||||
Loading…
Reference in a new issue