-
-
Notifications
You must be signed in to change notification settings - Fork 2
Contributing a Project Surface
itsmylab edited this page Aug 4, 2026
·
1 revision
Generated from
docs/contributions/project-surface.md. Edit the canonical source through a pull request.
Use this playbook when a feature needs project-level navigation, a tab identity, or a side-panel destination. Do not create a new surface for a feature that can fit naturally inside an existing view.
stateDiagram-v2
[*] --> Declared
Declared --> Opened: opener creates stable tab id
Opened --> Active: selected
Active --> Hidden: another tab selected
Hidden --> Active: selected again
Active --> Snapshotted: project hibernates
Hidden --> Snapshotted: project hibernates
Snapshotted --> Active: project wakes and restores
Active --> Closed: user closes tab
Hidden --> Closed: user closes tab
Closed --> [*]
Stateful panes generally stay mounted while hidden. Hibernation and close are explicit lifecycle transitions.
src/components/ProjectView/helpers.ts SubTab / SideTab and metadata
src/components/ProjectView/index.tsx state, opener, selection, rendering, close
src/tabKind.ts tab classification
src/tabGroups.ts grouping, if relevant
src/deepLinks.ts direct navigation, if relevant
src/spotSources.ts discoverability, if relevant
src/hibernation.ts snapshot/restore, if persistent
- Decide whether this is a document tab, terminal-like surface, agent surface, or side panel.
- Add one discriminated-union member with a stable identity.
- Search for every exhaustive switch over that union.
- Add the opener and deduplication behavior.
- Add render dispatch using a focused component.
- Define close behavior and resource cleanup.
- Decide whether inactive instances stay mounted. Default to preserving state.
- Add hibernation snapshot/restore only for state that cannot be rebuilt.
- Add deep-link, SpotSearch, and tab-group behavior when relevant.
- Test open, deduplicate, switch, hide, restore, and close behavior.
sequenceDiagram
participant Entry as User, search, deep link, or agent action
participant Project as ProjectView
participant Tabs as Tab state
participant View as Feature component
Entry->>Project: open feature with stable target
Project->>Tabs: reuse existing or append tab
Tabs->>Tabs: set active tab id
Tabs->>View: render or reveal mounted pane
View-->>Project: callbacks and state projection
Run the focused domain and component tests plus relevant tab tests:
npm run test -- src/tabKind.test.ts src/tabGroups.test.ts
npm run typecheck- Existing surface could not reasonably host the feature.
- Stable tab identity and deduplication defined.
- Every union switch updated.
- Hide, close, and hibernation semantics defined.
- Resource cleanup defined.
- Deep-link/search/group integration added only where useful.
- Lifecycle behavior tested.
Generated from FluidWorksApp/canopy-ide. Canonical documentation changes belong in the main repository.
Canopy Architecture
- Home
- Architecture
- Core Rust System
- LLM Context
- Integration Guide
- Contribution Playbooks
- Testing and Coverage
- Publish the Wiki
Playbooks