feat(telemetry): clickable source jump buttons on Unified Telemetry#3265
Conversation
…3262) Turn the source legend pills at the top of the Unified Telemetry page into buttons that smooth-scroll to their section, pin the header so they stay reachable, and highlight the pill for the section nearest the top via an IntersectionObserver. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Claude finished @Yeraze's task —— View job Code Review Complete ✅Todo List:
Review SummaryThis is a well-implemented feature that transforms the static source legend into functional navigation buttons. The code demonstrates good React patterns, proper accessibility considerations, and thoughtful UX design. Positive AspectsCode Quality & Architecture ✅
Performance ✅
Accessibility ✅
User Experience ✅
Minor Suggestions for ImprovementPerformance OptimizationConsider debouncing the IntersectionObserver callback if performance becomes an issue with many sources: // In the observer callback
const debounced = useMemo(() => debounce((sid: string) => setActiveSource(sid), 100), []);Error HandlingThe const scrollToSource = useCallback((sid: string) => {
try {
const el = sectionRefs.current.get(sid);
if (!el) return;
const headerH = headerRef.current?.offsetHeight ?? 0;
const top = el.getBoundingClientRect().top + window.scrollY - headerH - 12;
window.scrollTo({ top, behavior: 'smooth' });
setActiveSource(sid);
} catch (error) {
console.warn('Failed to scroll to source:', error);
}
}, []);CSS EnhancementConsider adding a subtle animation for the active state transition: button.unified-source-pill {
transition: filter 0.15s, box-shadow 0.15s, transform 0.1s;
}
button.unified-source-pill:active {
transform: scale(0.98);
}Test Coverage AssessmentStrengths ✅
Coverage Gaps
|
Summary
On large meshes the Unified Telemetry view gets long, making it tedious to jump between source/node groups. This PR turns the source legend pills at the top of the page into in-page navigation buttons and pins the header so they stay reachable while the card grids scroll underneath. The pill for the section nearest the top is highlighted as the active jump target.
Changes
<button>s instead of<span>s; clicking one smooth-scrolls to that source's section.IntersectionObservertracks the section nearest the top and highlights the matching pill (is-active+aria-current="true").disabledso they can't jump to nothing..unified-header--stickyCSS modifier pins the header — scoped so the chat-style Unified Messages page (own scroll surface) is unaffected.is-activeinset ring usingcurrentColor(matches each source's color).unified.telemetry.jump_to_sourcefor the pill tooltip/aria.Issues Resolved
Fixes #3262
Documentation Updates
[Unreleased] > Added. No feature docs underdocs/reference the Unified Telemetry legend, so none required updates.Testing
🤖 Generated with Claude Code