Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,20 +39,25 @@ jobs:
shardIndex: 1
shardTotal: 1
- browser: webkit
jobName: E2E (Playwright, webkit, shard 1/3)
jobName: E2E (Playwright, webkit, shard 1/4)
workers: 1
shardIndex: 1
shardTotal: 3
shardTotal: 4
- browser: webkit
jobName: E2E (Playwright, webkit, shard 2/3)
jobName: E2E (Playwright, webkit, shard 2/4)
workers: 1
shardIndex: 2
shardTotal: 3
shardTotal: 4
- browser: webkit
jobName: E2E (Playwright, webkit, shard 3/3)
jobName: E2E (Playwright, webkit, shard 3/4)
workers: 1
shardIndex: 3
shardTotal: 3
shardTotal: 4
- browser: webkit
jobName: E2E (Playwright, webkit, shard 4/4)
workers: 1
shardIndex: 4
shardTotal: 4

steps:
- name: Checkout
Expand Down
16 changes: 16 additions & 0 deletions docs/next-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ Focused follow-up work for `@knighted/develop`.
- If beneficial, introduce a configurable/hybrid strategy (for example, optimistic default with metadata fallback) without regressing current reliability.
- Suggested implementation prompt:
- "Evaluate and optionally optimize @knighted/develop GitHub file upsert behavior. Compare metadata-first preflight GET+PUT against optimistic PUT with retry-on-missing-sha for existing files. Keep current reliability guarantees and avoid reintroducing noisy false-positive failures. If implementing a hybrid/configurable strategy, keep defaults conservative, update docs, and validate with npm run lint plus targeted Playwright PR drawer flows."

5. **Remove pre-multitab component/styles compatibility paths**
- Delete code paths that preserve or translate legacy single-component/single-styles storage and sync behavior from before the multitab update.
- Remove backward-compatibility shims, fallback field reads, and migration glue tied to old `componentFilePath`/`stylesFilePath`-style assumptions when equivalent tab-derived data exists.
- Favor one canonical tab-first data contract across local storage, IndexedDB workspace records, PR sync metadata, and commit target derivation.
- Accept breaking changes for old locally stored app state to simplify maintenance and reduce branching logic.
- Suggested implementation prompt:
- "Remove backwards-compatibility code in @knighted/develop that supports pre-multitab component/styles storage/sync behavior. Standardize on the current tab-derived schema only, delete legacy field fallbacks and migration helpers, and update tests/docs to match the simplified contract. Validate with npm run lint and targeted Playwright suites for workspace tabs + PR drawer flows."

6. **Promise handling conventions (consistency of intent)**
- Define a project default: use `async`/`await` with `try`/`catch` for most async control flow.
- Keep Promise chains where they better express intent (for example, fire-and-forget paths with explicit `.catch()` to avoid unhandled rejections, or concise pass-through composition).
- Document this as an intent-first rule so mixed syntax is acceptable only when deliberate and easy to reason about.
- Add a lightweight lint/review rule to flag mixed async styles in the same flow unless there is a clear justification.
- Suggested implementation prompt:
- "Define and apply async handling conventions in @knighted/develop with consistency of intent: default to async/await + try/catch, allow Promise chains for explicit fire-and-forget and concise composition, and require explicit .catch on unawaited promises. Update docs and enforce via lint/review guidance without broad no-op refactors. Validate with npm run lint and targeted Playwright runs."
46 changes: 46 additions & 0 deletions docs/pr-drawer-workspace-context-separation-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# PR Drawer vs Workspace Contexts Remaining Backlog

This document now tracks only work not yet implemented from the original separation plan.

## Completed (for context)

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

## Remaining Work

### Phase B follow-up

1. Add multi-select removal in Workspaces drawer.
2. Add richer filtering in Workspaces drawer.
3. Decide whether to keep a quick context-switch affordance in PR drawer.

### Phase C enhancements

1. Add open PR binding tools to Workspaces drawer.
2. Add context health indicators in the Workspaces list (dirty, synced, drift).
3. Add optional pin/favorite/recents support.
4. Evaluate optional tab include/exclude toggles for commit targets.

### Confirmation summary UX polish

1. For long file lists, cap visible rows and show a +N more summary.

### Modularization follow-up

Current implementation is primarily `src/modules/workspaces-drawer/drawer.js`.

1. Split module if needed into smaller units:
- `state.js`
- `list-render.js`
- `actions.js`
2. Keep PR transactional logic isolated in PR modules.

## Validation Coverage to Keep

1. PR drawer tests remain focused on transactional workflows.
2. Workspaces drawer tests cover search/select/delete and future multi-select behavior.
3. Migration tests ensure existing stored contexts are retained.
147 changes: 31 additions & 116 deletions docs/render-pipeline-multitab-spec-plan.md
Original file line number Diff line number Diff line change
@@ -1,136 +1,51 @@
# Render Pipeline + Multi-Tab Spec Plan
# Render Pipeline + Multi-Tab Vital Remaining Spec TODOs

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

## Why this plan exists
## Already Covered (summary)

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

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

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

## Proposed Test Areas
Add explicit render/typecheck specs for:

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

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

Add specs for:
Lock down precedence and parity:

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

## 2. Default Export Handling in New Hydration Pipeline
## 3. Status Aggregation Contract (High Risk)

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

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

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

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

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

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

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

## 4. Styles Pipeline and Diagnostics Contract
## Minimal Done Criteria

Goal: Lock down expected diagnostics and status transitions for style dialects.

Add specs for:

1. Sass compilation error sets diagnostics state to error with styles-scope detail.
2. Less error path behavior parity with Sass.
3. Switching style mode clears stale diagnostics according to final pipeline contract.
4. Styles lint diagnostics and compile diagnostics coexist or prioritize per contract.
5. Clearing style diagnostics does not clear unrelated component diagnostics.

## 5. Status and Diagnostics State Machine

Goal: Ensure app status text/class and diagnostics toggle class remain consistent.

Add specs for:

1. Pending to error to neutral transitions for typecheck + lint + render.
2. Multiple error sources aggregate counts correctly.
3. Clearing one scope updates only corresponding status/diagnostics indicators.
4. Auto-render off path keeps status stable until explicit render.

## 6. Multi-Tab Tool Visibility and Actionability

Goal: Guarantee controls are actionable only for active editor tab and panel.

Add specs for:

1. Component controls hidden/inert when styles tab is active.
2. Styles controls hidden/inert when component tab is active.
3. Keyboard interactions in inactive panel do not mutate source.
4. Tab switches maintain tool visibility state and collapse state correctly.

## 7. Persistence and Isolation Guarantees

Goal: Verify deterministic startup and no stale state bleed between sessions.

Add specs for:

1. IndexedDB workspace restore across reload preserves tabs, active tab, entry role, and paths.
2. PR drawer saved config does not unexpectedly overwrite active workspace tab paths.
3. New session starts clean when storage is reset in tests.
4. Repository switch behavior isolates per-repo local context and config.

## 8. PR Drawer Path Validation and Sync

Goal: Revisit path validation behavior after final field sync implementation.

Add specs for:

1. Reject traversal (`../`) for component and styles paths.
2. Reject trailing slash paths for component and styles fields.
3. Allow dotted segments that are not traversal.
4. Entry-specific filename rule enforcement (`App.tsx` or `App.js`) reflected in drawer path values.

## 9. Test Infrastructure Improvements

Goal: Keep suites stable as UX evolves.

Actions:

1. Add helper APIs for tab activation before control interactions.
2. Add one reset helper per suite to clear localStorage, sessionStorage, and IndexedDB.
3. Prefer role/name selectors that match active-tab semantics.
4. Avoid assertions that require hidden panel controls to be clickable.

## Suggested Rollout Order

1. Entry resolution + default-export support matrix.
2. Cross-tab import graph hydration.
3. Styles diagnostics contract.
4. Status state machine.
5. PR drawer path validation synchronization.
6. Persistence/isolation hardening.

## Definition of Done for this plan

Before reintroducing removed specs, the render pipeline implementation should provide a written behavior contract for:

1. Entry tab selection.
2. Default export support matrix.
3. Style compile + lint diagnostics precedence.
4. Status/diagnostics state transitions.
5. Path normalization and validation across workspace tabs and PR drawer fields.
This plan is complete when the five sections above are covered by Playwright tests and linked from the affected suites.
Loading
Loading