diff --git a/e2e/breakpointDialogLayout.spec.ts b/e2e/breakpointDialogLayout.spec.ts index 9d894dfba..c8b51b8fd 100644 --- a/e2e/breakpointDialogLayout.spec.ts +++ b/e2e/breakpointDialogLayout.spec.ts @@ -18,18 +18,27 @@ test("keeps breakpoint details editable when the dialog gets narrow", async ({ w const list = dialog.getByRole("listbox", { name: "All breakpoints" }); const condition = dialog.locator('input[aria-label="Condition"]'); await expect(condition).toHaveValue("amount > 100"); + const actions = dialog.getByRole("group", { name: "Actions", exact: true }); + await expect(actions).toBeVisible(); + await expect(dialog.getByText("Condition", { exact: true })).toHaveCSS("font-size", "13px"); + await expect(dialog.getByText("Hit count", { exact: true })).toHaveCSS("font-size", "13px"); await expect.poll(async () => (await condition.boundingBox())?.width ?? 0).toBeGreaterThanOrEqual(240); await expect(dialog.getByRole("button", { name: "Done", exact: true })).toBeInViewport({ ratio: 1 }); await condition.fill("amount > 250"); - await dialog.getByRole("checkbox", { name: "Evaluate and log", exact: true }).check(); - await dialog.getByRole("textbox", { name: "Evaluate and log", exact: true }).fill("total: {amount}"); + await actions.getByRole("checkbox", { name: '"Breakpoint hit" message', exact: true }).check(); + await actions.getByRole("checkbox", { name: "Evaluate and log", exact: true }).check(); + const log = actions.getByRole("textbox", { name: "Evaluate and log", exact: true }); + await log.fill("total: {amount}"); + const temporary = actions.getByRole("checkbox", { name: "Remove once hit", exact: true }); + await temporary.check(); const first = list.getByRole("option", { name: /CheckInternationalSettlementBeforeDispatch\.java:8/ }); await expect(first.getByText(":8", { exact: true })).toBeInViewport({ ratio: 1 }); await list.getByRole("option", { name: /Receipt\.java:5/ }).click(); await expect(condition).toHaveValue(""); await first.click(); await expect(condition).toHaveValue("amount > 250"); - await expect(dialog.getByRole("textbox", { name: "Evaluate and log", exact: true })).toHaveValue("total: {amount}"); + await expect(log).toHaveValue("total: {amount}"); + await expect(temporary).toBeChecked(); await page.setViewportSize({ width: 1080, height: 760 }); const divider = dialog.locator('[data-separator][aria-orientation="vertical"]'); diff --git a/src/features/debugger/ui/Overlays.module.css b/src/features/debugger/ui/Overlays.module.css index 9c8f88b62..b288a515a 100644 --- a/src/features/debugger/ui/Overlays.module.css +++ b/src/features/debugger/ui/Overlays.module.css @@ -29,6 +29,23 @@ gap: var(--space-2); } +.bpActions { + display: flex; + flex-direction: column; + gap: var(--space-2); + min-width: 0; + margin: 0; + padding: var(--space-2) var(--space-3); + border: 1px solid var(--border); + border-radius: var(--radius-small); +} + +.bpActions > legend { + padding-inline: var(--space-1); + color: var(--fg-muted); + font-size: var(--fs-ui); +} + .bpTitle { display: flex; align-items: center; @@ -212,7 +229,7 @@ font-family: var(--font-ui); } -.detail .label { +:is(.detail, .bpEditor) .label { font-size: var(--fs-ui); } diff --git a/src/features/debugger/ui/Overlays.tsx b/src/features/debugger/ui/Overlays.tsx index d7fb2f0df..8bbf31afa 100644 --- a/src/features/debugger/ui/Overlays.tsx +++ b/src/features/debugger/ui/Overlays.tsx @@ -192,12 +192,14 @@ function BreakpointFields({ focus, onEnter, commitRef, + showRemoveOnceHit = false, }: { path: string; bp: BreakpointEntry; focus?: "condition" | "log"; onEnter?: () => void; commitRef?: MutableRefObject<(() => void) | null>; + showRemoveOnceHit?: boolean; }) { const [condition, setCondition] = useState(bp.condition ?? ""); const [hitCondition, setHitCondition] = useState(bp.hitCondition ?? ""); @@ -288,32 +290,44 @@ function BreakpointFields({ aria-label="Hit count condition" /> - updateBreakpoint(path, bp.id, { logHit: on || undefined })} - label={'"Breakpoint hit" message'} - /> - { - setLogEval(on); - draft.current = { ...draft.current, logEval: on }; - commitText(); - }} - label="Evaluate and log" - /> - {logEval && ( - setLogMessage(e.target.value)} - onBlur={commitText} - onKeyDown={onKey} - placeholder="Value: {expression}" - data-autofocus={focus === "log" ? "" : undefined} - aria-label="Evaluate and log" +
+ + Actions + + updateBreakpoint(path, bp.id, { logHit: on || undefined })} + label={'"Breakpoint hit" message'} /> - )} + { + setLogEval(on); + draft.current = { ...draft.current, logEval: on }; + commitText(); + }} + label="Evaluate and log" + /> + {logEval && ( + setLogMessage(e.target.value)} + onBlur={commitText} + onKeyDown={onKey} + placeholder="Value: {expression}" + data-autofocus={focus === "log" ? "" : undefined} + aria-label="Evaluate and log" + /> + )} + {showRemoveOnceHit && ( + updateBreakpoint(path, bp.id, { temporary })} + label="Remove once hit" + /> + )} +
); } @@ -751,12 +765,7 @@ function BreakpointDetail({ {st &&
{st.verified ? tx("Verified") : (st.message ?? "Not verified")}
} - - updateBreakpoint(path, bp.id, { temporary })} - label="Remove once hit" - /> + ); }