feat: idb + github sync with atomic open and push to remote.#78
Conversation
There was a problem hiding this comment.
Pull request overview
Implements the first pass of multi-tab GitHub sync foundations by extending workspace/tab persistence with sync metadata, introducing a dedicated Workspaces drawer for managing stored local contexts, and switching the GitHub push pipeline to an atomic multi-file commit via the Git Database API (with a Contents API fallback).
Changes:
- Add tab-level sync metadata (target path, dirty state, synced markers) across workspace state + IndexedDB persistence, and reconcile state after sync/push.
- Replace PR drawer file-path inputs with tab-derived commit targets and a confirmation summary that lists files to commit.
- Add a new Workspaces drawer UI for searching/opening/removing stored local contexts; expand Playwright coverage and increase CI sharding.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/panels-editor.css | Adds a “Dirty” tab badge style for sync state visibility. |
| src/styles/ai-controls.css | Styles new Workspaces toggle + drawer UI. |
| src/modules/workspaces-drawer/drawer.js | New controller for the Workspaces drawer (search/select/open/remove). |
| src/modules/workspace-tabs-state.js | Normalizes/propagates new tab sync fields into in-memory tab state. |
| src/modules/workspace-storage.js | Persists new tab sync fields in IndexedDB via record normalization. |
| src/modules/github-pr-drawer.js | Commits tab-derived fileUpdates and updates summary/active-context sync target persistence. |
| src/modules/github-api.js | Implements atomic multi-file commit via Git Database API + Contents fallback; plumbs fileUpdates through PR/push flows. |
| src/index.html | Adds Workspaces toggle + drawer; removes PR drawer path inputs and updates copy. |
| src/app.js | Computes dirty state, builds file commit list from tabs, reconciles tabs after push/sync, wires Workspaces drawer, persists render mode. |
| playwright/workspace-tabs.spec.ts | Adds coverage for dirty-state behavior on editing a synced tab. |
| playwright/github-pr-drawer.spec.ts | Updates tests for tab-derived commit targets; adds atomic commit + fallback tests; adds Workspaces drawer search test. |
| docs/render-pipeline-multitab-spec-plan.md | Refactors doc into a focused “remaining vital TODOs” list. |
| docs/pr-drawer-workspace-context-separation-plan.md | New doc tracking remaining backlog after drawer separation. |
| .github/workflows/playwright.yml | Increases WebKit sharding from 3 to 4. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Implements the first end-to-end slice of multi-tab GitHub sync: tab-level sync metadata persisted in IndexedDB, a dedicated Workspaces drawer for managing stored local contexts, and PR drawer commit/push flows updated to derive commit targets from workspace tabs and push atomically via the GitHub Git Database API.
Changes:
- Extend workspace tab records (state + IndexedDB) with sync metadata (target path, dirty flag, synced markers) and surface a “Dirty” tab badge.
- Add a new Workspaces drawer UI (toggle + drawer module + styles) to search/open/remove stored local contexts.
- Update PR drawer and GitHub API integration to commit multiple files as a single atomic commit using the Git Database API, and reconcile tab sync metadata after push/open.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/styles/panels-editor.css | Adds styling for a “Dirty” tab meta badge. |
| src/styles/ai-controls.css | Adds styling for Workspaces toggle and the Workspaces drawer layout. |
| src/modules/workspaces-drawer/drawer.js | New drawer controller for listing/searching/opening/removing stored workspaces. |
| src/modules/workspace-tabs-state.js | Normalizes/propagates new per-tab sync metadata fields in tab state. |
| src/modules/workspace-storage.js | Persists new per-tab sync metadata fields in IndexedDB records and normalizes them on read/write. |
| src/modules/github-pr-drawer.js | PR drawer now builds commit payloads from workspace tab-derived file list; updates confirmation summary and config persistence keys. |
| src/modules/github-api.js | Introduces Git Database API tree+commit+ref update path for atomic multi-file commits and wires PR creation/push to accept file update arrays. |
| src/index.html | Adds Workspaces toggle + drawer markup; removes component/styles filename fields from PR drawer; updates checkbox copy. |
| src/app.js | Integrates Workspaces drawer; introduces dirty-state transitions and reconciliation after push/sync; derives PR commit file list from tabs; persists render mode. |
| playwright/workspace-tabs.spec.ts | Adds coverage for “editing a synced tab marks it dirty”. |
| playwright/github-pr-drawer.spec.ts | Updates PR drawer tests for atomic Git Database API path, Workspaces drawer search, and updated PR context config keys. |
| docs/render-pipeline-multitab-spec-plan.md | Refactors the spec plan doc to track only remaining high-value TODOs. |
| docs/pr-drawer-workspace-context-separation-plan.md | New backlog doc for remaining PR drawer vs workspace context separation tasks. |
| docs/next-steps.md | Adds follow-up task to remove legacy pre-multitab component/styles compatibility paths. |
| .github/workflows/playwright.yml | Increases WebKit sharding from 3 to 4 shards. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* feat: idb infrastructure. (#63) * feat: dynamic tabs. (#64) * refactor: better accessbility for tabs. (#68) * feat: remove allow-same-origin for better security. (#69) * feat: tab reordering via drag-n-drop. (#70) * feat: explicit css imports, diagnostics per editor buffer. (#71) * feat: idb + github sync with atomic open and push to remote. (#78) * closes #73, closes #74, closes #75. * refactor: more colocation and smaller file sizes. (#79) * refactor: improvements with styles and gh syncs. (#82) * test: webkit flake. (#83) * test: address flake. (#84) * refactor: github pr context. (#85) * fix: require app in entry, hide workspaces without pat, remove star important. (#86) * feat: make idb source of truth for pr context. (#87) * fix: active pr context on reload and dedupe workspace identity. (#88) * fix: edited and push sync across reloads. (#89) * fix: properly commit tab name changes. (#90) * fix(tabs): filename edits, min-widths, scrolling, content sync. (#91) * feat: improved workspace disconnect and closed ux. (#92) * refactor: status styling and biome config. (#94) * fix(diagnostics): enforce current-editor snapshots and stale results. (#95) * fix: consistent head handling. (#96) * fix: prevent workspace overwrites. (#100) * fix(playwright): stabilize lint diagnostics waits with one-time rerun fallback. (#101) * feat: improved workspace ux and state identity separation. (#103) * fix: iframe protocol mismatch in receiver reads. (#104) * refactor: remove remaining fixed editor assumptions. (#105) * refactor: simplify PR close flow with deterministic workspace state updates (#106) * feat: mode-aware entry tab extensions. (#108) * feat: workspace status bar. (#109) * feat: tab-scoped ai chat. (#111) * refactor: better workspace drawer ux. (#112) * refactor: remove collapsible editors and update breakpoint styles. (#113) * docs: update for vnext. (#114) Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Initial implementation of #73, #74 and #75. Will need a cleanup round and UX/UI improvements.