Skip to content

Commit ea4bdd6

Browse files
authored
fix(web): delete sidebar sessions through the session action (#331)
## Related Issue No tracked issue. Reported from the desktop app: sidebar delete showed "Pythinker daemon returned an error" and left the session in place. ## Problem Deleting a session from the sidebar failed in about 15ms. The session stayed in the list. The dialog had no error code and no daemon message. ## What changed The web client now posts the session delete action the daemon already implements. The shipped web bundle is rebuilt so the desktop app uses that call. Permanent delete is unchanged. A busy-session guard and a design-system import are not in this change. ## Checklist - [x] I have read the [CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md) document. - [ ] I have linked a related issue (external PRs: the issue must have a maintainer's `/approve`). - [x] I have added tests that prove my feature works. - [x] Ran `gen-changesets` skill, or this PR needs no changeset. - [x] Ran `gen-docs` skill, or this PR needs no doc update. ## Summary - What changed and why: sidebar delete now calls the existing session delete action instead of an HTTP method the daemon does not route. - User-visible behavior: deleting a session from the sidebar removes it instead of showing a daemon error. - Scope deliberately excluded: design-system import, and newer reference commits that do not fix this dialog. ## Risk - Risk level and affected boundaries: low. One client method and the shipped web bundle. The daemon route is unchanged. - Failure, security, data, concurrency, dependency, and lifecycle considerations: a successful call still permanently deletes the session and its history. A missing session still returns the daemon not-found error, now with a code and a message. - New dependency or telemetry approval, if applicable: none. ## Verification - Exact commands and outcomes: `pnpm --filter @pymodel/pythinker-web exec vitest run test/daemon-client.test.ts` — 17 passed. `pnpm run build:web` — copied the web bundle. - Tests added or updated: `daemon-client.test.ts` now expects `POST /sessions/sess_1:delete` with an empty JSON body. - Checks not run: full `pnpm test`, lint, typecheck, and Nix were not run. GitNexus `detect_changes` reported medium risk on `DaemonPythinkerWebApi` and the load process. ## Rollback and review - Rollback path: revert this commit. The daemon route does not change. - Residual risk: a desktop build that still serves the old web bundle will keep the old call until it picks up this bundle. - Human review required: confirm the rebuilt bundle is the only generated change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed session deletion from the sidebar. * Session deletion now works reliably with the updated server action. * **Chores** * Rebuilt web assets to ensure the latest application bundle loads correctly. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 98235bb commit ea4bdd6

20 files changed

Lines changed: 37 additions & 25 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@pymodel/pythinker-code": patch
3+
---
4+
5+
Fix deleting a session from the sidebar.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"sourceHash": "96b15e465da2f27cd299b4f8639a5a305e0b7dfa15cb126d3a450cfce9c4b39b",
2+
"sourceHash": "e55e811106536d4ba7c56e5aa5d31c6d852cd0d560ec69e371349706de04ab06",
33
"sourceFileCount": 496
44
}

apps/pythinker-code/dist-web/assets/CodeBlockNode-BO6YfoxN.js renamed to apps/pythinker-code/dist-web/assets/CodeBlockNode-_wK8GSRB.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/DesignSystemView-YTZhXf4S.js renamed to apps/pythinker-code/dist-web/assets/DesignSystemView-BO8F15GQ.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/Tooltip-BVRELZ4M.js renamed to apps/pythinker-code/dist-web/assets/Tooltip-BV-JRC1N.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/index-lMRB0Jjp.js renamed to apps/pythinker-code/dist-web/assets/index-DAFMRqR8.js

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/pythinker-code/dist-web/assets/index10-Bu-YEcOO.js renamed to apps/pythinker-code/dist-web/assets/index10-Dhnug51i.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)