Repository navigation
CM-77192: Open vulnerabilities in an editor tab - #106
aaron-butler-cy-int wants to merge 7 commits into
Conversation
8894564 to
c13b42a
Compare
- Spinners in the results tree while a scan runs, and scan buttons that are disabled (without flicker) while their scan runs - Scan all button, scan options that are scrollable and collapsible, and a layout that follows the dock side - Close button on the vulnerability view and wrapped hint text - Keep expanded results rows expanded while other scans finish - Route tool window updates through ToolWindowUpdate Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
- TreeState restores the expanded rows after a reload instead of matching nodes by name by hand; rows of a rescanned scan type are collapsed after - AnimatedIcon.ANIMATION_IN_RENDERER_ALLOWED animates the spinner, so the repaint timer and its lifecycle code are gone Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
c13b42a to
7c1a462
Compare
… collapse state machine Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
7c1a462 to
2ffef27
Compare
| * Shows a finding: in an editor tab when that setting is on, otherwise in the right panel with a close button that | ||
| * returns to the scan view. Returns true when it is shown in the tool window. | ||
| */ | ||
| fun showDetection(detection: DetectionBase): Boolean { |
There was a problem hiding this comment.
SRP / KISS (medium): the Boolean return value leaks the placement policy to callers.
showDetection now returns "was it shown in the tool window". The quick-fix caller uses that to decide whether to activate the window. The method both acts and reports its own routing, so every caller has to know the setting exists.
It is also wrong in one case: createViolationCard(...) ?: return true reports that an unknown detection was shown in the tool window, so the quick fix activates the tool window with nothing new in it.
Suggestion: return Unit and do the tool window activation inside showDetection (in the tool-window branch only). The quick fix then goes back to a plain getTab(project)?.showDetection(detection).
| else -> return | ||
| } | ||
| /** Called when the user selects a node in the tree; the owner decides what opens for it. */ | ||
| var onNodeSelected: ((AbstractNode) -> Unit)? = null |
There was a problem hiding this comment.
YAGNI / KISS (medium): two selection callbacks that do almost the same job.
TreeView now has onDetectionSelected and onNodeSelected, plus openDetection(node) and openDetection(detection). The two entry points also behave differently:
- Tree click →
onNodeSelected→focusSourceWindow()+openDetectionInFile+showDetection. - Context menu "Open Violation Card" →
openDetection(node)→onDetectionSelected→showDetectiononly, with nofocusSourceWindow().
Suggestion: keep one callback, onNodeSelected: (AbstractNode) -> Unit, and route the context menu through it too, or give the owner one clear onOpenFinding with a flag for "also open the source". Remove onDetectionSelected and the two openDetection overloads.
| return | ||
| } | ||
|
|
||
| // reuse an existing split to the right instead of creating another one every time |
There was a problem hiding this comment.
KISS / correctness (medium): getNextWindow is not "the split to the right".
FileEditorManagerEx.getNextWindow cycles through the windows in order. With an existing horizontal split, or with 3 or more windows, the finding tab lands below or to the left, which contradicts both this comment and the README ("a tab on the right side").
On top of that, the create-split / copy the current file / open the finding / close the copy sequence relies on createSplitter behavior that is not part of the API contract.
Suggestion: say "another editor window" instead of "to the right", and use manager.windows.firstOrNull { it != current } so the intent is explicit. If "right" matters, check the splitter orientation before reusing a window. Either way, a short test or manual check with an existing horizontal split would help.
…plit the scan tab layout Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…open nothing on right click Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Add "Open vulnerabilities in an editor tab" (off by default). Each vulnerability then opens in one reused "Cycode Vulnerability" tab in a right-hand editor split, which gives more room than the tool window. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
…n there, use another editor window Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
e127945 to
e7c40ab
Compare
Summary
Third part of the split of #103, which is now merged. Depends on the tool window polish PR (#105): until it merges, this diff also shows its two commits; only the last commit (
add a setting to open vulnerabilities in an editor tab) belongs here.createSplitterand the no-argumentFileEditorOpenOptions, which fixes the failed Verify plugin check.Jira
CM-77192
Testing
./gradlew test), including the editor tab file type and the setting default.🤖 Generated with Claude Code