-
Notifications
You must be signed in to change notification settings - Fork 0
Arbitrary Dynamic Editor Tabs (vNext): Named Multi-File Workspace Model for @knighted/develop #53
Copy link
Copy link
Open
Labels
vNextArbitrary Dynamic Editor Tabs: Named Multi-File Workspace Model for @knighted/developArbitrary Dynamic Editor Tabs: Named Multi-File Workspace Model for @knighted/develop
Description
Summary
Introduce a new editor model in @knighted/develop that supports arbitrary, user-defined editor tabs with dynamic names and per-tab file mapping, replacing the current fixed Component/Styles assumptions as the primary workflow.
This is intended as a vNext milestone and architectural foundation for future UX and PR-context features.
Problem
Current editor behavior is optimized around a small fixed set of editors and file paths. That model makes advanced workflows difficult, especially when users need:
- More than two source files.
- Named workspace organization by intent.
- Reliable mapping between editor tabs, file paths, and GitHub PR context.
- Reusable context switching across repositories and PRs without losing editor intent.
Goals
- Support user-created tabs with dynamic names.
- Persist tab metadata and editor content state in localStorage with a stable schema.
- Support explicit file-path mapping per tab for GitHub commit/PR workflows.
- Preserve current render, lint, typecheck, diagnostics, and AI/BYOT behavior during migration.
- Enable future multi-PR context switching using tab-aware file mappings.
- Keep browser-first, CDN-first, no new dependency requirements unless explicitly approved.
Non-Goals
- No immediate redesign of AI model providers or auth flow.
- No server-side persistence.
- No change to CDN strategy.
- No mandatory migration of historical data without backward-compatibility logic.
Proposed UX (v1 of this issue)
- Users can create, rename, reorder, and close editor tabs.
- Each tab has:
- Display name.
- Content type (for example JSX, CSS, TS, JSON, Markdown).
- Optional repository-relative file path mapping.
- Active-tab indication and predictable restore behavior on reload.
- Safe handling for invalid or duplicate tab names.
- Clear behavior when mapped files are missing in selected branch/PR.
Data Model Requirements
- Introduce a versioned localStorage schema for tab workspaces.
- Store tabs as first-class objects with stable IDs.
- Persist per-tab:
- Name.
- Language/type.
- Content.
- File path mapping.
- Last active timestamp.
- Keep compatibility reader for legacy fixed-editor keys.
- Include migration path from legacy storage to new workspace schema.
PR/GitHub Integration Requirements
- Commit and PR flows must consume mapped files from current workspace tabs.
- Active PR context should record enough metadata to restore tab mappings correctly.
- Future issue work (multi-open-PR switching) should build on this schema without another storage overhaul.
AI/Assistant Integration Requirements
- Assistant edit proposals must target tab IDs (not hardcoded Component/Styles).
- Apply/undo should work per tab.
- Existing feature-flag and BYOT constraints must remain unchanged.
Acceptance Criteria
- User can create at least 5 tabs with arbitrary names and persist them across reload.
- User can assign file mappings to tabs and commit mapped files through existing PR flow.
- Legacy users load without data loss via migration or compatibility fallback.
- Existing diagnostics/typecheck/lint flows still function for active tab context.
- Existing active PR flows continue to work with tab-aware mappings.
- Playwright coverage added for:
- Tab create/rename/reorder/close.
- Persistence and restore.
- File-path mapping and commit behavior.
- AI apply/undo targeting named tabs.
- Lint and build pass.
Suggested Implementation Phases
- Phase 1: Schema and compatibility layer.
- Phase 2: Tab UI and core interactions.
- Phase 3: Runtime toolchain integration (render/lint/typecheck/diagnostics).
- Phase 4: GitHub PR/file mapping integration.
- Phase 5: AI apply/undo integration by tab ID.
- Phase 6: Cleanup of deprecated fixed-editor assumptions.
Risks
- Migration regressions for existing localStorage users.
- UI complexity increase for first-time users.
- Tight coupling between tab state and PR context if not normalized early.
Open Questions
- Should there be a reserved system tab concept, or are all tabs user-defined?
- Should tab language auto-detect from file extension when mapping changes?
- Should tab reorder persist globally or per repository?
- What is the maximum tab count before UX degrades?
- Should we allow unmapped scratch tabs in PR workflows, and if so, how are they excluded?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
vNextArbitrary Dynamic Editor Tabs: Named Multi-File Workspace Model for @knighted/developArbitrary Dynamic Editor Tabs: Named Multi-File Workspace Model for @knighted/develop