Repository navigation
feat(console): add safe session controls - #15
Conversation
|
/review |
PR Summary by QodoAdd protected session deletion and collapsible console navigation
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1.
|
There was a problem hiding this comment.
🟡 Changes recommended
The collapsed sidebar toggle currently references an ARIA-controlled element that is not present in the DOM, which is an accessibility correctness issue.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR adds safe, UI-visible session controls to the Clearance Console, including session sidebar hide/show behavior and guarded session deletion that blocks deletion of published evidence sessions while delegating deletion of ordinary sessions to the SDK client.
Changes:
- Introduces a shared session-deletion guard (
sessionCanBeDeleted) and a safe deletion wrapper (deleteConsoleSession) with tests covering protected vs. ordinary sessions. - Updates the console app server wiring to support SDK-backed session deletion and hides the delete action for protected sessions.
- Adds a collapsible sessions sidebar control plus CSS tweaks to keep portaled menu actions readable.
File summaries
| File | Description |
|---|---|
| scripts/console-session-deletion.test.ts | Adds deterministic tests for protected evidence sessions vs. ordinary deletion delegation. |
| console/src/sessionDeletion.ts | Implements evidence-session guard and safe deletion wrapper. |
| console/src/Layout.tsx | Adds hide/show control for the sessions sidebar. |
| console/src/console.css | Mirrors theme variables to body for portaled menus; styles sidebar toggle controls. |
| console/src/App.tsx | Composes SDK client deletion into the UI server and conditionally hides row actions for protected sessions. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
/review |
|
Code review by qodo was updated up to the latest commit 1e81ef6 |
|
/review |
|
Code review by qodo was updated up to the latest commit 1a5b615 |
There was a problem hiding this comment.
🟢 Approval recommended
The deletion safeguard is enforced in both UI (action hidden) and adapter logic (guarded delete), and the evidence ID list is verified against published bundles with automated tests.
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 0 new
- Review effort level: Lite
What
Adds collapsible session navigation and safe session deletion to the Clearance Console.
Root cause
The session list consumes recording space, while the pinned UI only exposes deletion when its adapter implements
deleteSession. Published evidence sessions must remain available for live receipt verification.Fix
The safeguard is deliberately console-scoped; direct administrative TrueForge API access is documented as outside it. The merged empty-toast fix remains intact. No agent prompt, manifest, contract, approval, verifier, or evidence bundle is changed.
Verification
npm test: 26 test files passed, 365 tests passednpm run buildinconsole/: TypeScript and Vite build passedgit diff --check: passed