Skip to content

Commit c842fdc

Browse files
refactor: separate workspace and transaction workflows.
1 parent 2ba6e10 commit c842fdc

11 files changed

Lines changed: 986 additions & 861 deletions
Lines changed: 31 additions & 151 deletions
Original file line numberDiff line numberDiff line change
@@ -1,166 +1,46 @@
1-
# PR Drawer vs Workspace Contexts Separation Plan
1+
# PR Drawer vs Workspace Contexts Remaining Backlog
22

3-
## Purpose
3+
This document now tracks only work not yet implemented from the original separation plan.
44

5-
Define a post-4C UX split so transactional GitHub actions stay focused while local-first workspace lifecycle actions move to a dedicated surface.
5+
## Completed (for context)
66

7-
## Problem Statement
7+
1. Workspaces button and dedicated Workspaces drawer exist.
8+
2. PR drawer no longer exposes component/styles filename inputs.
9+
3. Commit targets are derived from workspace tab metadata.
10+
4. Checkbox copy uses entry-tab language.
11+
5. Confirmation summary includes a Files to commit list.
812

9-
The current Open Pull Request drawer mixes two distinct concerns:
13+
## Remaining Work
1014

11-
1. Transactional sync actions:
12-
- Open pull request
13-
- Push commit to active pull request
14-
2. Workspace lifecycle management:
15-
- Select/search local contexts
16-
- Remove local contexts
15+
### Phase B follow-up
1716

18-
This creates cognitive overhead and makes destructive local operations feel coupled to one-shot GitHub actions.
17+
1. Add multi-select removal in Workspaces drawer.
18+
2. Add richer filtering in Workspaces drawer.
19+
3. Decide whether to keep a quick context-switch affordance in PR drawer.
1920

20-
## Goals
21+
### Phase C enhancements
2122

22-
1. Keep PR drawer focused on transactional actions and immediate status.
23-
2. Move workspace lifecycle operations to a dedicated context management surface.
24-
3. Preserve local-first behavior and IndexedDB as source of truth for workspace content.
25-
4. Keep migration incremental and avoid breaking existing flows.
23+
1. Add open PR binding tools to Workspaces drawer.
24+
2. Add context health indicators in the Workspaces list (dirty, synced, drift).
25+
3. Add optional pin/favorite/recents support.
26+
4. Evaluate optional tab include/exclude toggles for commit targets.
2627

27-
## Product Decisions (Locked)
28+
### Confirmation summary UX polish
2829

29-
The following decisions are accepted for implementation:
30+
1. For long file lists, cap visible rows and show a +N more summary.
3031

31-
1. Add a dedicated `Workspaces` control button in `app-grid-ai-controls`.
32-
2. `Workspaces` opens its own drawer for lifecycle operations (search/select/remove and future context features).
33-
3. Open PR / Push commit flows no longer expose `Component filename` and `Styles filename` fields.
34-
4. Commit target filenames are derived from workspace tab metadata stored in IndexedDB.
35-
5. The checkbox currently labeled `Include App wrapper in committed component source` will be relabeled to reflect entry-tab semantics.
36-
6. Open PR / Push commit confirmation summary shifts from two fixed file fields to a mapped tab/file list.
32+
### Modularization follow-up
3733

38-
## Proposed Information Architecture
34+
Current implementation is primarily `src/modules/workspaces-drawer/drawer.js`.
3935

40-
### 1. PR Drawer (Transactional)
36+
1. Split module if needed into smaller units:
37+
- `state.js`
38+
- `list-render.js`
39+
- `actions.js`
40+
2. Keep PR transactional logic isolated in PR modules.
4141

42-
Keep only action-scoped fields and status:
42+
## Validation Coverage to Keep
4343

44-
1. Repository and branch selection
45-
2. File mapping summary derived from workspace tab metadata
46-
3. PR title/body and commit message
47-
4. Submit actions (Open PR, Push commit)
48-
5. Transaction status/errors
49-
50-
Optional shortcut:
51-
52-
1. Current context selector (read-focused quick switch)
53-
2. Link/button to open full context manager
54-
55-
### 2. Workspace Context Manager (Lifecycle)
56-
57-
Dedicated UI surface (modal or side panel) for:
58-
59-
1. Search/filter local contexts
60-
2. Select/activate local context
61-
3. Remove one or many local contexts
62-
4. Future: open PR binding and context metadata management
63-
64-
Location and trigger:
65-
66-
1. Triggered from a new `Workspaces` button in `app-grid-ai-controls`.
67-
2. Implemented as a dedicated drawer separate from the PR drawer.
68-
3. Uses a colocated module structure under a parent directory dedicated to workspace lifecycle UI.
69-
70-
## Storage Boundaries (Unchanged)
71-
72-
1. IndexedDB:
73-
- Workspace tabs and content
74-
- Tab sync metadata (dirty/synced markers)
75-
- Workspace context records
76-
2. localStorage:
77-
- User preferences
78-
- Lightweight per-repo PR drawer config
79-
80-
## Migration Plan
81-
82-
### Phase A: Transitional (Low Risk)
83-
84-
1. Add `Workspaces` button in `app-grid-ai-controls` with dedicated icon.
85-
2. Add standalone `Workspaces` drawer skeleton and lifecycle list rendering.
86-
3. Move search/remove controls from PR drawer into `Workspaces` drawer.
87-
4. Keep quick context selection in PR drawer only as an optional shortcut.
88-
89-
### Phase B: Consolidation
90-
91-
1. Reduce PR drawer context UI to active context summary + switch shortcut.
92-
2. Remove component/styles filename fields from PR drawer.
93-
3. Derive commit file targets exclusively from workspace tab metadata in IndexedDB.
94-
4. Add multi-select removal and richer filters in manager.
95-
96-
### Phase C: Follow-up Enhancements
97-
98-
1. Open PR list binding tools live in manager.
99-
2. Context health indicators (dirty, synced, drift) appear in manager list.
100-
3. Optional pin/favorite/recents support.
101-
4. Optional tab-level include/exclude toggles for commit targets (if needed by workflow feedback).
102-
103-
## Confirmation Summary Contract (Open PR / Push Commit)
104-
105-
The confirmation dialog should show:
106-
107-
1. Repository (`owner/repo`)
108-
2. Branch information:
109-
- Open PR: `Base` and `Head`
110-
- Push commit: `Head`
111-
3. Commit message
112-
4. A commit target list derived from tab metadata:
113-
- Tab display name
114-
- Repository-relative filepath
115-
- Optional tag for entry tab
116-
117-
Recommended rendering:
118-
119-
1. Keep the top metadata lines concise.
120-
2. Show a bulleted list for `Files to commit` so users can quickly scan exact targets.
121-
3. For long lists, cap visible rows and show `+N more` summary.
122-
123-
## Accessibility and UX Requirements
124-
125-
1. Dedicated manager must support keyboard navigation for list/select/remove.
126-
2. Destructive actions must require explicit confirmation.
127-
3. PR drawer status remains transactional only.
128-
4. Context manager explains local-only deletion scope clearly.
129-
130-
## Testing Plan
131-
132-
1. PR drawer tests verify transactional workflows independent of context cleanup.
133-
2. Context manager tests verify search/select/delete workflows.
134-
3. Migration test verifies existing users retain contexts after UI split.
135-
136-
## Open Decisions
137-
138-
1. Modal vs side panel for context manager.
139-
2. Whether quick-select remains in PR drawer after Phase B.
140-
3. Whether context removal supports undo window.
141-
4. Whether the PR drawer should show all mapped tabs or only tabs marked as commit-included.
142-
143-
## Implementation Structure Guidance
144-
145-
To keep implementation modular and colocated:
146-
147-
1. Create a parent module directory for lifecycle UI, for example:
148-
- `src/modules/workspaces-drawer/`
149-
2. Keep small focused modules inside it, for example:
150-
- `drawer.js` (controller)
151-
- `state.js` (view state)
152-
- `list-render.js` (UI rendering)
153-
- `actions.js` (select/remove commands)
154-
3. Keep PR transactional logic in existing PR modules and consume workspace metadata via adapter functions only.
155-
156-
## UI Copy Updates
157-
158-
1. Rename checkbox label:
159-
- From: `Include App wrapper in committed component source`
160-
- To: `Include entry tab source in committed output`
161-
2. In summaries and status, refer to `entry tab` and `workspace files` rather than `component/styles files`.
162-
163-
## Suggested Rollout
164-
165-
1. Land after 4C stabilization tests are green.
166-
2. Ship Phase A first, then Phase B in follow-up PR.
44+
1. PR drawer tests remain focused on transactional workflows.
45+
2. Workspaces drawer tests cover search/select/delete and future multi-select behavior.
46+
3. Migration tests ensure existing stored contexts are retained.
Lines changed: 31 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,51 @@
1-
# Render Pipeline + Multi-Tab Spec Plan
1+
# Render Pipeline + Multi-Tab Vital Remaining Spec TODOs
22

3-
This document outlines test coverage to add after the render pipeline rewrite is fully integrated with the multi-tab UX.
3+
This file tracks only high-value gaps that still need coverage.
44

5-
## Why this plan exists
5+
## Already Covered (summary)
66

7-
Current test coverage intentionally removed a subset of specs that were tightly coupled to pre-rewrite assumptions:
7+
1. Entry-tab role behavior, rename stability, and restore behavior.
8+
2. Cross-tab import graph basics, missing-module and circular-import determinism.
9+
3. Core diagnostics/status flows, including pending/error/neutral transitions.
10+
4. Workspace persistence and per-repo context/config isolation baseline.
811

9-
1. Legacy assumptions around default-export hydration behavior in preview module assembly.
10-
2. Styles diagnostics behavior that depended on old compile/lint sequencing.
11-
3. PR drawer path validation timing assumptions tied to previous field sync flow.
12+
## Vital Remaining TODOs
1213

13-
These should return as updated tests once the new pipeline contract is finalized.
14+
## 1. Default Export Support Matrix (High Risk)
1415

15-
## Proposed Test Areas
16+
Add explicit render/typecheck specs for:
1617

17-
## 1. Entry Resolution and Execution Semantics
18+
1. `export default class ...` in React mode.
19+
2. `function App() { ... } export default App` behavior.
20+
3. `const X = ...; export default X` behavior with entry-wrapper rules.
21+
4. Unsupported default-export combinations producing deterministic diagnostics.
1822

19-
Goal: Validate how preview entry is resolved from workspace tabs under the `role: entry` model.
23+
## 2. Style Compile vs Lint Contract (High Risk)
2024

21-
Add specs for:
25+
Lock down precedence and parity:
2226

23-
1. Entry selection prefers explicit `role: entry`, with documented fallback behavior only when no explicit entry is present.
24-
2. Entry rename between `App.tsx` and `App.js` keeps execution stable.
25-
3. Entry path updates preserve directory while enforcing filename convention.
26-
4. Reload restores same entry tab and executes same source.
27+
1. Less error-path parity with Sass error behavior.
28+
2. Compile diagnostics + lint diagnostics precedence/coexistence contract.
29+
3. Clearing styles diagnostics does not affect component diagnostics/status.
2730

28-
## 2. Default Export Handling in New Hydration Pipeline
31+
## 3. Status Aggregation Contract (High Risk)
2932

30-
Goal: Reintroduce export-default tests against the final module assembly support matrix.
33+
Add state-machine coverage for:
3134

32-
Add specs for:
35+
1. Multiple simultaneous error sources aggregating counts correctly.
36+
2. Clearing one scope updates only that scope and leaves other error states intact.
3337

34-
1. `export default () => ...` in entry tab with manual render.
35-
2. `export default class ...` in React mode.
36-
3. `function App() { ... } export default App` compatibility.
37-
4. `const Button = ...; export default Button` behavior when App wrapper is implicit or explicit.
38-
5. Negative cases: unsupported default-export combinations produce deterministic diagnostics.
38+
## 4. Inactive Panel Mutation Guard (Medium Risk)
3939

40-
## 3. Cross-Tab Import Graph Hydration
40+
Add keyboard/actionability spec that proves inactive editor panel input cannot mutate source.
4141

42-
Goal: Ensure workspace graph resolution works across multiple component and style tabs.
42+
## 5. Update Obsolete PR Path-Validation Section (Doc/Test Hygiene)
4343

44-
Add specs for:
44+
Old PR drawer filename-field validation cases are obsolete after tab-derived commit targets.
4545

46-
1. Entry imports sibling component tab by relative specifier.
47-
2. Nested dependency chain (A imports B imports C) hydrates in stable order.
48-
3. Missing module path reports actionable preview error including unresolved specifier.
49-
4. Circular import emits stable error (or supported behavior) without hanging.
50-
5. Windows-style and POSIX-style separators normalize consistently in lookup keys.
46+
1. Replace with tab-derived commit target validation/normalization tests.
47+
2. Remove any remaining assumptions about component/styles filename fields in PR drawer flows.
5148

52-
## 4. Styles Pipeline and Diagnostics Contract
49+
## Minimal Done Criteria
5350

54-
Goal: Lock down expected diagnostics and status transitions for style dialects.
55-
56-
Add specs for:
57-
58-
1. Sass compilation error sets diagnostics state to error with styles-scope detail.
59-
2. Less error path behavior parity with Sass.
60-
3. Switching style mode clears stale diagnostics according to final pipeline contract.
61-
4. Styles lint diagnostics and compile diagnostics coexist or prioritize per contract.
62-
5. Clearing style diagnostics does not clear unrelated component diagnostics.
63-
64-
## 5. Status and Diagnostics State Machine
65-
66-
Goal: Ensure app status text/class and diagnostics toggle class remain consistent.
67-
68-
Add specs for:
69-
70-
1. Pending to error to neutral transitions for typecheck + lint + render.
71-
2. Multiple error sources aggregate counts correctly.
72-
3. Clearing one scope updates only corresponding status/diagnostics indicators.
73-
4. Auto-render off path keeps status stable until explicit render.
74-
75-
## 6. Multi-Tab Tool Visibility and Actionability
76-
77-
Goal: Guarantee controls are actionable only for active editor tab and panel.
78-
79-
Add specs for:
80-
81-
1. Component controls hidden/inert when styles tab is active.
82-
2. Styles controls hidden/inert when component tab is active.
83-
3. Keyboard interactions in inactive panel do not mutate source.
84-
4. Tab switches maintain tool visibility state and collapse state correctly.
85-
86-
## 7. Persistence and Isolation Guarantees
87-
88-
Goal: Verify deterministic startup and no stale state bleed between sessions.
89-
90-
Add specs for:
91-
92-
1. IndexedDB workspace restore across reload preserves tabs, active tab, entry role, and paths.
93-
2. PR drawer saved config does not unexpectedly overwrite active workspace tab paths.
94-
3. New session starts clean when storage is reset in tests.
95-
4. Repository switch behavior isolates per-repo local context and config.
96-
97-
## 8. PR Drawer Path Validation and Sync
98-
99-
Goal: Revisit path validation behavior after final field sync implementation.
100-
101-
Add specs for:
102-
103-
1. Reject traversal (`../`) for component and styles paths.
104-
2. Reject trailing slash paths for component and styles fields.
105-
3. Allow dotted segments that are not traversal.
106-
4. Entry-specific filename rule enforcement (`App.tsx` or `App.js`) reflected in drawer path values.
107-
108-
## 9. Test Infrastructure Improvements
109-
110-
Goal: Keep suites stable as UX evolves.
111-
112-
Actions:
113-
114-
1. Add helper APIs for tab activation before control interactions.
115-
2. Add one reset helper per suite to clear localStorage, sessionStorage, and IndexedDB.
116-
3. Prefer role/name selectors that match active-tab semantics.
117-
4. Avoid assertions that require hidden panel controls to be clickable.
118-
119-
## Suggested Rollout Order
120-
121-
1. Entry resolution + default-export support matrix.
122-
2. Cross-tab import graph hydration.
123-
3. Styles diagnostics contract.
124-
4. Status state machine.
125-
5. PR drawer path validation synchronization.
126-
6. Persistence/isolation hardening.
127-
128-
## Definition of Done for this plan
129-
130-
Before reintroducing removed specs, the render pipeline implementation should provide a written behavior contract for:
131-
132-
1. Entry tab selection.
133-
2. Default export support matrix.
134-
3. Style compile + lint diagnostics precedence.
135-
4. Status/diagnostics state transitions.
136-
5. Path normalization and validation across workspace tabs and PR drawer fields.
51+
This plan is complete when the five sections above are covered by Playwright tests and linked from the affected suites.

0 commit comments

Comments
 (0)