eval-diagnostics-panel.md
Feature: LSP Diagnostics Panel (command palette: "Show Diagnostics Panel" / "Toggle Diagnostics Panel") Version: Fresh 0.2.18 Test environment: 120x40 terminal, pylsp with pyflakes (Python), tmux session Evaluation method: Hands-on manual testing via tmux, nngroup heuristic evaluation
The diagnostics panel displays LSP diagnostics in a split panel below the editor. It supports file grouping, severity indicators, cursor-synced preview, and jump-to-location. The core concept is sound and the preview-on-navigate behavior is excellent, but three critical bugs and several usability issues significantly degrade the experience.
Overall rating: 3/10 (unusable for reliable workflows due to blocking bugs; strong potential if bugs are fixed)
isOpen state desyncs when closing with Escape (Critical)Steps to reproduce:
Expected: Panel reopens.
Actual: Nothing happens. The plugin's isOpen flag is still true because Escape closes the Finder panel but doesn't call the plugin's diagnostics_close() handler. The show_diagnostics_panel function sees isOpen === true and only calls provider.notify() on an already-closed panel.
Impact: Users cannot reopen the panel after closing it with Escape. They must use "Toggle" twice (once to clear phantom state, once to reopen). This completely breaks the show/close cycle.
Root cause: The Finder's built-in Escape handler closes the panel view without notifying the plugin. The plugin registers _finder_diagnostics_panel_close for Escape in the mode, but the Finder's own Escape handling runs first and doesn't call diagnostics_close().
Steps to reproduce:
Expected: 'a' toggles between "Current File" and "All Files"; 'r' refreshes. Actual: Both keys show "Editing disabled in this buffer" error in the status bar. The keys are treated as text input attempts on a read-only buffer.
Impact: The all-files toggle and manual refresh are completely inaccessible. The status bar misleadingly shows "a: toggle filter" as a hint, but the feature doesn't work.
Root cause: The diagnostics-extra mode defined via editor.defineMode() is never activated when the panel opens. The Finder likely uses its own mode for the panel buffer and doesn't compose with the plugin's custom mode.
Steps to reproduce:
[E] 17:5 undefined name 'undefined_variable' (Item 2/2)Expected: Cursor jumps to line 17, column 5 in the source file. Actual: Cursor jumps to line 2, column 5. The column is correct but the line is wrong.
Impact: Jump-to-location, the primary action of the panel, doesn't land on the correct line. Observed across multiple test runs — the line number consistently maps incorrectly (appears to use the panel's internal line number rather than the diagnostic's source line).
Positives:
Diagnostics: 4 items)Item 1/2, Item 2/2) is helpful[W] and [E] severity prefix tags are clearerrors.py: header provides contextE:2 W:1 counts at all times (outside the panel)Negatives:
Positives:
[E] / [W] severity codes are standard and immediately understandableline:column message format is the universal diagnostic conventionNegatives:
Positives:
Negatives:
Positives:
Ctrl+P command palette access is standardNegatives:
Ctrl+Shift+M); here you must navigate the command palette each timeCtrl+ or F-key shortcuts[E]/[W] differ from the ● inline markers in the gutter — inconsistent visual languageNegatives:
Positives:
[E]/[W] are self-documentingNegatives:
Positives:
Negatives:
Positives:
[E], [W]) rather than verboseNegatives:
~ tilde filler for empty lines adds visual noise (19 lines of tildes for 3 diagnostics)*Diagnostics* × alongside file tabs, which clutters the tab strip[E] and [W] in the panel itself (both appear in the same color in the tmux capture — though this may be theme-dependent)Negatives:
Positives:
Negatives:
| Task | Success | Notes |
|---|---|---|
| Open diagnostics panel | Partial | Works on first attempt; fails after Escape close |
| View diagnostics for current file | Yes | Displays correctly when panel opens |
| Navigate between diagnostics | Yes | Arrow keys work; preview sync is excellent |
| Jump to diagnostic location | Fail | Lands on wrong line (Bug #3) |
| Toggle all-files filter | Fail | 'a' key non-functional (Bug #2) |
| Refresh diagnostics | Fail | 'r' key non-functional (Bug #2) |
| Close panel | Partial | Escape works visually but corrupts state (Bug #1) |
| Reopen after closing | Fail | "Show" command silently fails after Escape |
| Return to panel after jump | Partial | Requires knowing Alt+] (undiscoverable) |
| Toggle panel on/off | Partial | Works if used consistently; breaks if mixed with "Show" |
Core workflow success rate: 3/10 tasks fully succeed
Fix isOpen state tracking: The Finder's close callback must call diagnostics_close() to sync the plugin state. Alternatively, have show_diagnostics_panel check if the panel is actually visible (not just the isOpen flag).
Fix custom mode keybindings: Ensure the diagnostics-extra mode is activated when the panel is focused. Either compose it with the Finder's panel mode, or register 'a'/'r' as Finder-level keybindings.
Fix jump-to-location line mapping: The Enter handler should use the diagnostic item's location.line property, not the panel's cursor line number.
Add a dedicated keyboard shortcut (e.g., Ctrl+Shift+M like VS Code) for toggling the diagnostics panel without the command palette.
Add visual highlight on the currently selected diagnostic row (background color change).
Auto-size the panel height or provide a reasonable minimum to avoid 70% empty space with few diagnostics.
Improve empty state: When "Current File" shows no results but other files have diagnostics, show "No diagnostics in current file. Press 'a' for all files." instead of just "No results".