Related Reports
A Station plugin whose Reports pane opens each report beside the list
as a related pane, through the SDK's related-pane capability
(useRelatedPanes; see Pane relationships
and the SDK reference). It is the
dogfood for that capability: the same bundle runs as a trusted direct pane and
inside Station's sandboxed plugin frame.
What it demonstrates
opennames one of the plugin's own descriptors, a mode it declares and the plugin's own report key. Station decides where the pane goes: beside the list (destination), with the Tools (thetoolrole of Report log), or as a child screen on a phone.- Opening another report replaces the one preview; opening the same report focuses it; Keep open on the report turns it into an ordinary tab.
revealandclosetake the handleopenreturned and act only on what this pane opened.closeasks the report's own unsaved-changes guard.- The Report pane reads the report it was opened for with
target(). - Every outcome is a value. On a Station without the capability, or when an open is refused, the list shows the report itself and says why.
- The list always calls through the capability the latest render returned:
the host replaces it when, for example, the Station changes, and the one
it replaced answers
context-mismatch. - In the frame, the bundle draws plain DOM once the frame document has loaded, with the same landmarks as its components, and talks to the host through the client the frame runtime injects.
Install and try
- Build it with
station plugin buildin this directory, then install the directory withstation plugin install ./examples/related-reports(or through Plugins → Install plugin). - Open a Project, choose Add pane, and open Reports.
- Choose Open Weekly report. It opens beside Reports with the opener's way back above it.
Verify
The browser journeys are tests/related-panes.spec.ts (the direct tier) and
tests/related-panes-frame.spec.ts (Station's sandboxed plugin frame); the
host's admission, placement and refusals are unit-tested in
src-ui/src/workspace-panes/__tests__/relatedPanesHost.test.tsx.