chore: simplify and clarify frontend views, panes, and components#399
Conversation
Remove stale, redundant, and overly verbose comments across 30 files: - Remove 'Helper:' prefixed function comments that restate the function name - Remove 'Memoize X to prevent re-renders' comments on useCallback/useMemo - Remove JSDoc blocks on internal helper functions - Remove inline comments that restate what code obviously does - Preserve comments on genuinely complex logic (MSE protocol, draft lifecycle, compositor auto-sizing, WebSocket state management) - Preserve all SPDX license headers No functional changes. No test logic modified. Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
There was a problem hiding this comment.
📝 Info: MonitorView: large JSDoc block removal loses useful documentation
The removed JSDoc block above MonitorViewContent documented the component's statement count, why it exceeds limits, and how complexity is managed (extracted helpers, useCallback/useMemo, separation of concerns). Similarly, the topology effect's JSDoc documented its 38-statement count, cyclomatic complexity of 21, and the specific tasks it performs (topo sorting, node building, edge building, YAML generation). While these are "just comments," they served as architectural documentation for a very complex component. Future maintainers (including agents per AGENTS.md) will have less context about why this code is structured the way it is.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
There was a problem hiding this comment.
Acknowledged. The JSDoc was removed per the cleanup task's directive to remove verbose comments. The eslint-disable rationale (which was the actionable part) has been restored in bf23b9e. The detailed breakdown of statement count / complexity management was AI-generated documentation that restated the code structure rather than adding insight — keeping the rationale comment is sufficient context for future maintainers.
There was a problem hiding this comment.
📝 Info: ConvertView JSDoc removal loses public API documentation
The ConvertView component had a JSDoc documenting its responsibilities (template selection/YAML editing, file upload/asset selection, pipeline conversion with streaming, audio playback/transcription display). The handleConvert function had a JSDoc explaining it handles the conversion workflow end-to-end. These were stripped along with all other comments, but since these are component-level documentation rather than inline implementation notes, their removal reduces discoverability of the component's purpose. Not a bug, but worth considering whether top-level JSDoc should be preserved when stripping inline comments.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
There was a problem hiding this comment.
Acknowledged. The component-level JSDoc was removed as part of the cleanup pass — it was AI-generated documentation listing what the component does, which is visible from reading the code. The eslint-disable rationale has been restored in bf23b9e.
| useEffect(() => { | ||
| if (selectedNodes.length === 0) { | ||
| // No selection - keep YAML view | ||
| setRightPaneView('yaml'); | ||
| } else if (selectedNodes.length > 1) { | ||
| // Multiple selection - show YAML view | ||
| setRightPaneView('yaml'); | ||
| } else if (selectedNodes.length === 1) { | ||
| // Single selection - switch to YAML view (with highlighting) | ||
| } else { | ||
| setRightPaneView('yaml'); | ||
| } | ||
| }, [selectedNodes]); |
There was a problem hiding this comment.
📝 Info: Dead-branch simplification in DesignView useEffect is correct
The old code at ui/src/views/DesignView.tsx:1199-1201 had three explicit branches (selectedNodes.length === 0, > 1, === 1) that all called setRightPaneView('yaml'). The PR collapses these into a single unconditional setRightPaneView('yaml'). This is semantically equivalent because selectedNodes is typed as string[] (initialized via useState<string[]>([])), so .length is always >= 0, meaning the three branches were already exhaustive. No behavior change.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
There was a problem hiding this comment.
Good catch — collapsed the dead if/else to a single setRightPaneView('yaml') call in bf23b9e.
…implify dead branch - Restore rationale comments on eslint-disable directives per AGENTS.md - Fix blank line between eslint-disable-next-line and target in MonitorView - Collapse dead if/else in DesignView where both branches set same value Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
| * Handles the conversion workflow end-to-end: input validation, API call, and streaming/download handling. | ||
| */ | ||
| // eslint-disable-next-line max-statements -- Intentionally co-locates conversion state + error/cancel handling. | ||
| // eslint-disable-next-line max-statements -- Co-locates conversion state + error/cancel handling |
There was a problem hiding this comment.
📝 Info: AGENTS.md linting discipline rule is satisfied
AGENTS.md requires that eslint-disable comments include a rationale. I verified all eslint-disable comments in the diff either already had rationale comments that were preserved, or had their rationale slightly reworded (e.g., ConvertView.tsx line 883 changed from Intentionally co-locates conversion state + error/cancel handling. to Co-locates conversion state + error/cancel handling). The rationale is still present in all cases, so no rule violation exists.
Was this helpful? React with 👍 or 👎 to provide feedback.
Debug
* docs: add comment guidelines to AGENTS.md Codifies learnings from the v0.5 pre-release cleanup pass (PRs #399–#404), where ~3,500 lines of agent-generated comment noise were removed across 163 files. Adds a 'Comment Guidelines' section with concrete DO/DON'T rules derived from the most common antipatterns found: - Line narration (~40% of removals) - Verbose JSDoc on trivial interfaces (~15%) - Helper labels, section dividers, step numbering (~30%) - Complexity apologies, framework behavior explanations (~10%) - Dead code kept 'for reference' Also documents which comment categories must be preserved: - SAFETY comments, lint rationales, non-obvious constraints - Performance contracts, Playwright guards, design decisions - @public tags for external consumer contracts Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com> * docs: ground comment guidelines in industry standards Reference established style guides that support each rule: - Linux kernel coding style §8: 'NEVER try to explain HOW, tell WHY' - Google C++ Style Guide: 'best code is self-documenting', comments for 'tricky, non-obvious, interesting, or important parts' - Rust RFC 505 / API Guidelines: single-line doc summary convention - Google documentation best practices: 'dead docs are bad' - Coding Horror (2006, paraphrasing Kernighan): 'code tells you how, comments tell you why' Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-Authored-By: Claudio Costa <cstcld91@gmail.com> --------- Signed-off-by: StreamKit Devin <devin@streamkit.dev> Co-authored-by: StreamKit Devin <devin@streamkit.dev> Co-authored-by: Claudio Costa <cstcld91@gmail.com>
Summary
Code simplification and comment cleanup across 30 frontend files (views, panes, and components). Part of the coordinated v0.5 pre-release cleanup.
Scope:
ui/src/views/,ui/src/panes/,ui/src/components/,ui/src/Layout.tsx,ui/src/App.tsx,ui/src/index.tsxWhat was removed (~580 lines deleted)
// Helper: Xprefixed comments on internal functions — the function name already conveys purpose// Memoize X to prevent re-renderscomments onuseCallback/useMemo— standard React patterns don't need explanationfindLineRange,computeReactFlowProps)// Update segments,// Set initial volume,// Create a client)What was preserved
Code simplification
length === 0,> 1,=== 1) set the same valuesetRightPaneView('yaml')into a single unconditional callFiles changed (30 files)
Views (4): MonitorView, DesignView, ConvertView, StreamView
Panes (4): InspectorPane, ControlPane, YamlPane, SamplePipelinesPane
Components (21): MSEPlayer, NodeFrame, TranscriptionDisplay, OverlayControls, NodePalette, SessionItem, PlaceholderPinRow, PinRow, FlowCanvas, TelemetryTimeline, Checkbox, Button, ConnectionStatus, TopControls, PipelineEditor, AssetLibrary, ResizableLayout, SaveFragmentModal, SaveTemplateModal, CustomAudioPlayer, compositorCanvasLayers
Top-level (1): App.tsx
No functional changes. No bugs found.
Review & Testing Checklist for Human
just lint-ui) — confirmed 0 errors, only pre-existing warningsNotes
Link to Devin session: https://staging.itsdev.in/sessions/458a7df3a5d548beabd23f0d8bdb815e
Requested by: @streamer45
Devin Review
bf23b9e