fix(sessions): open test pane when enabling debug so the debug UI is visible#9998
fix(sessions): open test pane when enabling debug so the debug UI is visible#9998AlexRV12 wants to merge 1 commit into
Conversation
Deploying windmill with
|
| Latest commit: |
41c98fb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://6443725a.windmill.pages.dev |
| Branch Preview URL: | https://ah-debug-pane-opens-in-sessi.windmill.pages.dev |
|
Claude finished @AlexRV12's task in 58s —— View job Code ReviewGood to merge. I reviewed the single changed file ( What the change does (verified)
Correctness checks
AGENTS.md compliance
Test coverageFrontend Svelte change with no new pure-logic utility (no sibling Manual verification still worth doing before merge (matches the PR's own test plan): in an AI session with a script open and the test pane collapsed, click Toggle Debug Mode once and confirm the pane expands and the |
Pi ReviewGood to merge. No issues found. The change is tightly scoped — a single 1-file diff in What it does
Design checks
Test coverageFrontend-only Svelte component change. The codebase does not test Svelte components, and the extracted helpers ( Manual verification: the PR body includes a thorough test plan with screenshots covering all four scenarios (AI session enable, AI session disable, standalone |
Codex ReviewGood to merge No issues found. I checked the Svelte diff for bugs, security/performance regressions, AGENTS.md compliance, and new public surfaces. Test coverageFrontend-only UI behavior change in |
Summary
In an AI session (
frontend/src/lib/components/sessions) with a script open in the right-hand preview panel, clicking Toggle Debug Mode did nothing visible — the debug pane never appeared. Clicking Test afterwards revealed it.The debug UI (
DebugToolbar+DebugPanel) is rendered inside the script editor's right-hand test/preview pane. In an AI session that pane is force-collapsed to width 0 (initialTestPanelCollapsed), and enabling debug flippeddebugModeon and connected the DAP client but never widened the pane — so the debug UI mounted inside a zero-width pane and stayed invisible. The debug pane and the collapsed test panel are the same layout slot.Changes
toggleDebugMode(): on the enable path, expand the test pane when it's collapsed (testPanelSize === 0) so the debug UI is immediately visible without a follow-up Test click.expandTestPanel()/collapseTestPanel()out oftoggleTestPanel()so the debug enable path can express "expand" directly instead of relying on the toggle's branch semantics. Behavior-preserving:toggleTestPanel()keeps itstestPanelSize > 0 ? collapse : expanddispatch and all four existing callers are unchanged.Design decisions (deliberate)
$effect. A standing "debugMode && collapsed → open" effect would fight the user — they could never collapse the pane while debugging. The invariant belongs at the transition (toggle time), not as a continuous rule.=== 0guard avoids re-toggling or snapping a pane the user already has open at a custom width.Known limitation (future work)
The debug UI and the test pane still share one layout slot, so
debugModecan betruewhile the UI is invisible on other width-change paths. This PR patches the one transition that matters today. If this slot keeps accreting modes (test / debug / preview / args), the real fix is to give debug its own slot or add an explicit "what is this pane showing" discriminant — out of scope here.Test plan
npm run check— clean forScriptEditor.svelte(pre-existing unrelated errors elsewhere untouched)/scripts/editunchanged (pane already open; the=== 0branch never fires)previewLayout="bottom") for the documented cosmetic re-open-on-enable case (min-clamped, non-breaking)Screenshots
Before — AI session with a script open in the right panel; the test/preview pane is collapsed to width 0. Clicking Toggle Debug Mode used to do nothing visible.
After enabling debug — one click on Toggle Debug Mode now expands the pane and, once the DAP client connects, shows the DebugPanel (step controls, breakpoints hint, args + logs).
After disabling debug — debug turns off and the toolbar reverts to the normal Test button, but the pane is deliberately left open (see design decisions).
Standalone
/scripts/edit(regression check) — unchanged: the pane is open by default, so the new=== 0branch never fires.