refactor(ui): improve logs settings hierarchy and scoped controls#1417
refactor(ui): improve logs settings hierarchy and scoped controls#1417caffeinated92 wants to merge 4 commits intodevelopfrom
Conversation
Reorganize log settings into consistent top-level table sections with nested scoped groups, and replace bulky sliders with compact confirmable level buttons. This makes scoped logging behavior clearer while reducing visual noise and improving readability.
|
@claude review |
|
Claude finished @caffeinated92's task in 2m 41s —— View job Code Review
Overall this is a solid, well-structured refactor. The hierarchy is cleaner, component separation is good, and accessibility attributes ( Bugs1. Double space in confirm modal title
// LogsSettings.jsx:184
`${confirmTitle} ${LEVEL_LABEL_BY_VALUE[pendingValue ?? currentValue]}`This produces 2. "Proxy Log Scopes" label appears twice
Either rename the inner section (e.g., Code Quality3.
4. Redundant
5. Loose equality check
const isSettingsDisabled = user?.grants['cluster-settings'] == falseUse strict equality ( 6. Long className concatenation on line 167 The button inside the level gauge has a very long, hard-to-read className string built from 5 conditional parts. Consider adopting className={clsx(
styles.logLevelGaugeButton,
styles[`logLevelGaugeButtonLevel${option.value}`],
isFilled ? styles[`logLevelGaugeButtonFilled${option.value}`] : styles.logLevelGaugeButtonUnfilled,
compact && styles.logLevelGaugeButtonCompact,
isSelected && [styles.logLevelGaugeButtonSelected, styles[`logLevelGaugeButtonSelectedLevel${option.value}`]]
)}Unused CSS
If these were from the old implementation and are no longer needed, clean them up. If they're intended for future use, they shouldn't be committed yet. Minor
|
Eliminate spacing and duplicate-heading issues in log settings so confirmations and section structure read clearly. Also apply targeted cleanup to class composition and stale style definitions to keep the settings UI maintainable.
|
@claude review |
|
Claude finished @caffeinated92's task in 2m 37s —— View job Code Review
The latest polish commit ( A few remaining items worth addressing: Bugs1. Redundant
// Current (inconsistent)
{isConfirmModalOpen && (
<ConfirmModal isOpen={isConfirmModalOpen} ... />
)}
// Option A: always mount, let isOpen control visibility
<ConfirmModal isOpen={isConfirmModalOpen} ... />
// Option B: conditional render, no isOpen needed
{isConfirmModalOpen && (
<ConfirmModal ... />
)}2.
// current ${LEVEL_LABEL_BY_VALUE[pendingValue ?? currentValue]}`}
// clearer ${LEVEL_LABEL_BY_VALUE[pendingValue]}`}Code Quality3. External value update silently dismisses open confirm modal
4. Gauge button border colors show even when unfilled
5.
Minor
Overall the refactor is solid and the follow-up polish addressed all the previously flagged issues well. The hierarchy is cleaner, the level gauge component is well-structured with good ARIA support, and the SCSS is now properly organized with SCSS variables for colors. |
Keep pending log-level changes visible during external refreshes while aligning conditional ConfirmModal usage and unfilled gauge styling for clearer, consistent controls.
|
@claude review |
|
Claude finished @caffeinated92's task in 2m 22s —— View job Code Review
The latest commit ( One remaining code quality issue is worth addressing; the rest are minor. Code Quality1.
The // Current
useEffect(() => {
setCurrentValue(normalizeLogLevel(value))
if (!isConfirmModalOpen) {
setPendingValue(null)
}
}, [value, isConfirmModalOpen])
// Simplified — isConfirmModalOpen no longer needed here
useEffect(() => {
setCurrentValue(normalizeLogLevel(value))
setPendingValue(null)
}, [value])The only scenario where this differs: Minor
Overall the refactor is in good shape and the three rounds of cleanup have addressed all the meaningful issues. The hierarchy is cleaner, ARIA is properly applied, SCSS is organized with variables, and the level gauge component is well-structured. |
Refine log-level control state syncing so modal open/close no longer retriggers the value effect while preserving pending confirmation state, and remove redundant proxy wrapper and aria-label noise in collapsible sections.
Reorganize log settings into consistent top-level table sections with nested scoped groups, and replace bulky sliders with compact confirmable level buttons. This makes scoped logging behavior clearer while reducing visual noise and improving readability.