Skip to content

feat(diagnostics): add scrollable problems popover and click-to-jump navigation - #24

Merged
Yan123-tech merged 1 commit into
mainfrom
feature/diagnostic-panel-jump
Oct 12, 2026
Merged

Yan123-tech merged 1 commit into
mainfrom
feature/diagnostic-panel-jump

Conversation

@Yan123-tech

Copy link
Copy Markdown
Owner

Summary

This PR addresses the user requirement for interactive diagnostic inspection and editor jump navigation:

  • Converts the status bar error/warning indicator in the bottom-right corner into an interactive clickable button.
  • Adds DiagnosticsListView, a scrollable popover displaying all diagnostic errors, warnings, line/column coordinates (Ln X, Col Y), error messages, and LSP sources (e.g., gopls, sourcekit-lsp).
  • Implements click-to-jump navigation: clicking any problem item closes the popover, scrolls the editor to center the error line, selects the exact range, and flashes a focus emphasis highlight.
  • Makes DocumentDiagnostic conform to Identifiable with a deterministic identifier.
  • Adds comprehensive unit tests for diagnostic sorting and identification.

Key Changes

  1. Interactive Status Bar Counter:
    • In StatusBarView.swift, transformed static count text into an interactive button with hover states.
    • Popover is anchored to the bottom-right diagnostic counter and opens upwards.
  2. Scrollable Diagnostics Popover (DiagnosticsListView.swift):
    • Displays problems header with filename and total error/warning count pills.
    • Scrollable problem list with severity icons (red circle for errors, yellow triangle for warnings).
    • Clean hover feedback and empty state.
  3. Click-to-Jump & Flash Highlight:
    • In AppState.swift, added diagnosticJumpRequest and jumpTo(diagnostic:in:).
    • In CodeEditorView.swift, handles jump requests by delegating to LSPTextViewCoordinator.
    • In LSPTextViewCoordinator.swift, jumpTo(range:) sets the selection, centers the viewport via scrollToRange(range, center: true), makes the text view first responder, and flashes an Emphasis highlight.
  4. Testing:
    • All 125 unit tests passing.
    • Verified with strict swift-format lint and scripts/build-app.sh application bundle build.

Testing & Verification

  • swift test passes (125 tests across 34 suites)
  • xcrun swift-format lint --strict clean (0 warnings)
  • scripts/build-app.sh completes successfully with valid code signature

…navigation

- Add interactive button on status bar error and warning counts with hover wash
- Introduce DiagnosticsListView scrollable popover displaying errors, warnings, line/col badges, and sources
- Support click-to-jump navigation centering target line, selecting range, and flashing standard emphasis highlight
- Make DocumentDiagnostic conform to Identifiable with deterministic id calculation
- Cover diagnostic sorting and Identifiable determinism with unit tests
@Yan123-tech
Yan123-tech merged commit 76d6602 into main Oct 12, 2026
2 checks passed
@Yan123-tech
Yan123-tech deleted the feature/diagnostic-panel-jump branch October 12, 2026 13:12
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