Skip to content
PidebugWeb4 files · +450 −103

Persist and restore Excel sidebar session tabs across reload

Session from pi-for-excel-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk

44msession
1interventions
GOAL

Fix a bug where reloading the Excel taskpane sidebar dropped all but one open session tab, so tabs would persist and restore correctly per workbook.

  1. Prompt · +0
    We just implemented tabs, but reloading the sidebar removes all tabs but one
  2. Agent did · +0m
    Explored the codebase (session-runtime-manager, init.ts, sessions.ts, workbook design docs) to find where tab state was and wasn't persisted across reload.
  3. Agent did · +3m
    Added src/taskpane/tab-layout.ts to persist per-workbook tab layout (session ids + active tab) in SettingsStore, wired persistence/restore hooks into init.ts, and added tests/tab-layout.test.ts.
  4. Agent did · +10m
    Fixed resulting lint/typecheck errors, split out resume-target.ts, ran full check/test suite, committed 'fix(tabs): persist and restore session tabs on reload', rebased on origin/main, and pushed.
  5. Intervention · +39m
    After reloading, the developer found the old tabs still disappeared and said the fix didn't work.
    Why: I reloaded and the tabs still vanished, so the persistence code wasn't actually being used on startup — needed to check what was really wired in.
  6. Fail · +40m
    Investigation showed restorePersistedTabLayout wasn't hooked into the runtime bootstrap path — the earlier fix never actually ran on load.
  7. Agent did · +42m
    Rewrote init.ts to call restorePersistedTabLayout before falling back to single-session restore, handle missing session records by recreating blank tabs, and reran lint/typecheck/tests, all passing.
  8. Outcome · +44m
    Committed 'fix(tabs): restore persisted tab layout on sidebar reload' and pushed to main as b6c5863; lint, typecheck and test:context all passed with 0 npm audit vulnerabilities.
VERDICT

Next time I'd ask upfront for the fix to include a manual verification step (actually reload and check tabs) before calling it done, since the first commit passed all checks but never actually wired the restore into the boot path. My interruption — reloading and pointing out the tabs still disappeared — was what forced the agent to find that the persistence code wasn't hooked up at all, which was the real bug.

I tried this · 0

Discussion · 0

How Builds work