Skip to content

Add diagnostics pane and optimize with line indexing#9

Open
simwai wants to merge 2 commits into
mainfrom
feature/diagnostics-and-line-indexing-7894184619913533842
Open

Add diagnostics pane and optimize with line indexing#9
simwai wants to merge 2 commits into
mainfrom
feature/diagnostics-and-line-indexing-7894184619913533842

Conversation

@simwai
Copy link
Copy Markdown
Owner

@simwai simwai commented May 24, 2026

This change introduces a diagnostic system and performance optimizations to the babae TUI editor.

Key enhancements:

  • Diagnostic Pane: A new live diagnostic view can be toggled using Ctrl+D. This provides real-time visibility into internal events (input handling, clipboard errors, etc.) without corrupting the main editor rendering.
  • Performance Optimization: Buffer offset-to-row conversions are now backed by a binary-searched line-start index ($script:lineIndex). This improves performance for large files by replacing O(n) scans with O(log n) lookups.
  • Mouse Support: Added support for mouse events (ANSI modes ?1000h, ?1003h, ?1006h), specifically allowing users to drag the diagnostic pane divider to resize the pane.
  • Improved Error Handling: Swallowed exception paths in installation, input threads, and clipboard operations have been replaced with logging to the diagnostic ring buffer and optional debug log file.
  • Configuration: Added -DiagPane and -DebugLog parameters to the main script.

All buffer mutation points (Enter, Backspace, Delete, Tab, Paste, printable characters) have been updated to maintain the line-start index. Existing Pester tests pass, and the new logic has been manually verified for correctness.


PR created automatically by Jules for task 7894184619913533842 started by @simwai

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Implement TUI diagnostic pane (Ctrl+D) for live event logging
- Add -DiagPane and -DebugLog parameters
- Optimize buffer offset-to-row logic with a binary-searched line-start index
- Add mouse support for diagnostic pane resizing
- Improved error handling for input and clipboard operations
- Update README.md with new features

Co-authored-by: simwai <16225108+simwai@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant