Commit ea4bdd6
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
File tree
- .changeset
- apps
- pythinker-code/dist-web
- assets
- pythinker-web
- src/api/daemon
- test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
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