aglinxinyuan opened a new pull request, #7425:
URL: https://github.com/apache/texera/pull/7425

   ### What changes were proposed in this PR?
   
   `setupMonacoBreakpointMethods` was the component's one uncovered block. The 
existing suite stubs it out — with a comment saying so — because the minimal 
editor mock cannot back a real `MonacoBreakpoint`, so neither of the two 
overrides it installs was exercised.
   
   Adds 13 tests over both.
   
   **The glyph override** decides what the gutter shows:
   
   ```
   exists && condition present   ->  monaco-conditional-breakpoint
   exists && no condition        ->  monaco-breakpoint
   hovering only                 ->  monaco-hover-breakpoint
   ```
   
   Covered including the `Boolean(condition?.trim())` guard — a condition left 
as whitespace must render as an ordinary breakpoint rather than claiming a 
condition the debugger will not apply — and the lookup happening at 
`range.startLineNumber`, since reading `endLineNumber` would attribute another 
line's condition to this glyph.
   
   **The mouse-down override** replaces the library's own handler. The 
`dispose()` before re-registering is load-bearing: two live handlers would add 
and immediately remove a breakpoint on a single click. A left click toggles; a 
right click opens the condition input instead of toggling, and only for a line 
that already has a breakpoint; clicks below the last line and outside the 
gutter do nothing.
   
   **Verified by mutation**, all reverted (production diff empty):
   
   | Mutation | Result |
   |---|---|
   | treat a blank condition as a condition | red |
   | read the condition from the range's end line | red |
   | key the condition lookup to a fixed operator | red |
   | swap the conditional and plain glyphs | red |
   | swap the exists and hover arms | red |
   | skip disposing the previous mouse-down handler | red |
   | drop the gutter target-type check | red |
   | drop the after-lines guard | red |
   | invert the left/right button branch | red |
   
   The stand-in editor is a `Proxy` that answers any unstubbed `on*` listener 
with an inert disposable, so the spec does not have to track which events 
`monaco-breakpoints` subscribes to — the first attempt failed on 
`onDidChangeCursorPosition`, and guessing at the rest would have been fragile.
   
   No production file is touched.
   
   ### Any related issues, documentation, discussions?
   
   Closes #7422
   
   ### How was this PR tested?
   
   ```
   npx ng test --watch=false --include="**/code-debugger.component.spec.ts"
   ```
   
   ```
    Test Files  1 passed (1)
         Tests  29 passed (29)
   ```
   
   13 new on top of the existing 16. `yarn format:ci` passes.
   
   ### Was this PR authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (Opus 5)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to