[ADR-0006] Phase 1: Layout mode state and toggle controls#3558
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3558 +/- ##
==========================================
+ Coverage 88.60% 88.67% +0.06%
==========================================
Files 299 300 +1
Lines 9484 9551 +67
Branches 2502 2526 +24
==========================================
+ Hits 8403 8469 +66
- Misses 1077 1078 +1
Partials 4 4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
021b4f6 to
cbf64cb
Compare
There was a problem hiding this comment.
Pull request overview
Implements ADR-0006 (Phase 1) groundwork for Trace Timeline layout controls by adding configuration knobs, Redux state for layout mode/visibility, and a new header settings dropdown to toggle these preferences (persisted via localStorage).
Changes:
- Add
config.traceTimelineoptions (enableSidePanel,defaultDetailPanelMode) and defaults. - Extend
traceTimelineRedux state withdetailPanelMode,timelineBarsVisible, andsidePanelWidth, plus new actions/reducers and persistence. - Replace the header’s shortcuts button with a new Trace view settings dropdown that hosts layout toggles + keyboard shortcuts modal.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/jaeger-ui/src/types/config.ts | Adds traceTimeline config schema and docs. |
| packages/jaeger-ui/src/types/TTraceTimeline.ts | Extends timeline Redux state type for new layout prefs. |
| packages/jaeger-ui/src/constants/default-config.ts | Provides default values for new traceTimeline config. |
| packages/jaeger-ui/src/components/TracePage/index.tsx | Wires new Redux state/actions into TracePage and passes feature flag to header. |
| packages/jaeger-ui/src/components/TracePage/index.test.js | Updates TracePage tests for new props/state wiring. |
| packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/duck.ts | Adds new layout state/actions and localStorage persistence; updates detail toggle behavior by mode. |
| packages/jaeger-ui/src/components/TracePage/TracePageHeader/TraceViewSettings.tsx | New settings dropdown component with layout toggles + keyboard shortcuts modal. |
| packages/jaeger-ui/src/components/TracePage/TracePageHeader/TraceViewSettings.css | Styles for the new settings trigger/icon. |
| packages/jaeger-ui/src/components/TracePage/TracePageHeader/TracePageHeader.tsx | Replaces KeyboardShortcutsHelp with TraceViewSettings and wires new props. |
| packages/jaeger-ui/src/components/TracePage/TracePageHeader/TracePageHeader.test.js | Updates header tests to mock/render the new settings component. |
| docs/adr/README.md | Adds ADR-0006 to the ADR index. |
| docs/adr/0006-side-panel-span-details.md | Adds new ADR describing side panel details + tree-only mode and phased plan. |
| docs/adr/0002-otlp-api-v3-migration.md | Updates ADR-0002 status wording. |
| docs/adr/0001-design-token-based-theming.md | Updates ADR-0001 status and removes placeholder next review. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
cbf64cb to
f17d275
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated 10 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| let kbdTable: React.ReactNode | null = null; | ||
|
|
||
| function getHelpModal() { | ||
| if (kbdTable) { | ||
| return kbdTable; | ||
| } |
There was a problem hiding this comment.
Caching kbdTable in a module-level variable makes the rendered keyboard shortcuts table effectively global and never refreshed (even if keyboardMappings changes due to build-time differences, future dynamic loading, or test isolation needs). Consider moving the cache to component scope (e.g. useMemo) or rebuilding on open so state remains local and predictable.
Closes out the ADR-0006 implementation (side panel span details + tree-only mode). Previous phases: [Phase 1 #3558](#3558), [Phase 2 #3562](#3562), [Phase 3 #3569](#3569), [Phase 4 #3576](#3576). ## What changed ### Analytics tracking (`duck.track.ts`) Three new Redux actions are now tracked: | Action | Category | Tracked value | |---|---|---| | `SET_DETAIL_PANEL_MODE` | `jaeger/ux/trace/timeline/panel-mode` | mode string (`'inline'` / `'sidepanel'`) | | `SET_TIMELINE_BARS_VISIBLE` | `jaeger/ux/trace/timeline/timeline-visible` | `'true'` / `'false'` | | `SET_SIDE_PANEL_WIDTH` | `jaeger/ux/trace/timeline/column` | width × 1000 (integer), same pattern as `SET_SPAN_NAME_COLUMN_WIDTH` | ### Test coverage (`index.test.js`) Added a `describe('layout combinations')` block that renders `TraceTimelineViewerImpl` for all four `{detailPanelMode, timelineBarsVisible}` combinations and asserts: - Side panel container is present/absent as expected - `VerticalResizer` is present only when `detailPanelMode='sidepanel'` **and** `timelineBarsVisible=true` - `VirtualizedTraceView` is always rendered ### ADR `docs/adr/0006-side-panel-span-details.md` status updated to **Implemented**; Phase 5 marked complete. ## Testing ```bash npm run prettier npm run lint npm test npm run build ``` All 2560 tests pass. ### Manual testing of all four layout combinations Enable the side panel feature flag in `default-config.ts` (`enableSidePanel: true`) or via query param, then verify each combination: | `detailPanelMode` | `timelineBarsVisible` | Expected | |---|---|---| | `inline` | `true` | Default behavior — inline expand, timeline bars visible | | `inline` | `false` | Tree-only — inline expand, no timeline bars | | `sidepanel` | `true` | Side panel on right, `VerticalResizer` divider visible | | `sidepanel` | `false` | Side panel fills remaining width, no resizer | To test in embedded mode, append `?uiEmbed=v0` (optionally with `uiTimelineCollapseTitle=1`, `uiTimelineHideMinimap=1`, `uiTimelineHideSummary=1`) to a trace URL and verify the side panel and settings gear work normally. ## AI Usage in this PR (choose one) See [AI Usage Policy](https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING_GUIDELINES.md#ai-usage-policy). - [ ] **None**: No AI tools were used in creating this PR - [ ] **Light**: AI provided minor assistance (formatting, simple suggestions) - [ ] **Moderate**: AI helped with code generation or debugging specific parts - [x] **Heavy**: AI generated most or all of the code changes --------- Signed-off-by: Yuri Shkuro <github@ysh.us>
) ## Description of the changes - Enables displaying span details in a side panel as an option - Default view is still inline span details, can be changed via `traceTimeline.defaultDetailPanelMode="sidepanel"` config option. <img width="1920" height="964" alt="image" src="https://github.com/user-attachments/assets/c71a9f98-e30d-4030-8947-6dc8e5b6bd0c" /> Previous phases: [Phase 1 #3558](#3558), [Phase 2 #3562](#3562), [Phase 3 #3569](#3569), [Phase 4 #3576](#3576), [Phase 5 #3577](#3577). --------- Signed-off-by: Yuri Shkuro <github@ysh.us>
…ing#3558) Implements Phase 1 of [ADR-0006](packages/jaeger-ui/docs/adr/0006-side-panel-span-details.md): wire up Redux state, config options, and UI toggle controls for the upcoming side-panel and tree-only trace timeline modes. No visual layout changes in this PR — the work is purely state plumbing and a new settings component. ## New config options ```js // jaeger-config.js traceTimeline: { // Reveals the "Show Span in Sidebar" toggle. Off by default (experimental, opt-in). enableSidePanel: false, // When enableSidePanel is true and the user has no stored preference, // open new sessions in side-panel mode instead of inline. defaultDetailPanelMode: 'inline', // or 'sidepanel' } ``` ## New Redux state (`TTraceTimeline`) Three new fields in the trace timeline slice, all persisted to `localStorage`: | Field | Type | Default | Storage key | |---|---|---|---| | `detailPanelMode` | `'inline' \| 'sidepanel'` | `'inline'` | `detailPanelMode` | | `timelineVisible` | `boolean` | `true` | `timelineVisible` | | `sidePanelWidth` | `number` (ratio 0–1) | `0.45` | `sidePanelWidth` | New actions: `SET_DETAIL_PANEL_MODE`, `SET_TIMELINE_VISIBLE`, `SET_SIDE_PANEL_WIDTH`. `newInitialState()` reads config and `localStorage` on startup. `setTrace` preserves all three layout preferences when navigating between traces. `detailToggle` is made mode-aware: in `sidepanel` mode it keeps at most one entry in `detailStates` (enforcing single-span-at-a-time selection semantics). Width values loaded from `localStorage` are clamped to safe ranges on both read and write: | Preference | Min | Max | |---|---|---| | `spanNameColumnWidth` | 0.15 | 0.85 | | `sidePanelWidth` | 0.20 | 0.70 | ## New `TraceViewSettings` component Replaces the standalone `KeyboardShortcutsHelp` (⌘) button in the trace header with a gear-icon (⚙) dropdown that consolidates all view settings: - **Show Timeline** — toggle timeline bars on/off (always shown) - **Show Span in Sidebar** — toggle detail panel mode (shown only when `enableSidePanel: true` in config) - **Keyboard Shortcuts** — open the shortcuts reference modal (always shown) Active settings are indicated with a checkmark. Preferences survive page reload via `localStorage`. `KeyboardShortcutsHelp` is refactored from a self-contained button+modal into a controlled modal component (`open` / `onClose` props). The analytics `track()` call fires via `useEffect` when the modal becomes visible, keeping the caller free of tracking concerns. The `showShortcutsHelp` prop is removed — the settings gear is always rendered. --------- Signed-off-by: Yuri Shkuro <github@ysh.us>
…acing#3577) Closes out the ADR-0006 implementation (side panel span details + tree-only mode). Previous phases: [Phase 1 jaegertracing#3558](jaegertracing#3558), [Phase 2 jaegertracing#3562](jaegertracing#3562), [Phase 3 jaegertracing#3569](jaegertracing#3569), [Phase 4 jaegertracing#3576](jaegertracing#3576). ## What changed ### Analytics tracking (`duck.track.ts`) Three new Redux actions are now tracked: | Action | Category | Tracked value | |---|---|---| | `SET_DETAIL_PANEL_MODE` | `jaeger/ux/trace/timeline/panel-mode` | mode string (`'inline'` / `'sidepanel'`) | | `SET_TIMELINE_BARS_VISIBLE` | `jaeger/ux/trace/timeline/timeline-visible` | `'true'` / `'false'` | | `SET_SIDE_PANEL_WIDTH` | `jaeger/ux/trace/timeline/column` | width × 1000 (integer), same pattern as `SET_SPAN_NAME_COLUMN_WIDTH` | ### Test coverage (`index.test.js`) Added a `describe('layout combinations')` block that renders `TraceTimelineViewerImpl` for all four `{detailPanelMode, timelineBarsVisible}` combinations and asserts: - Side panel container is present/absent as expected - `VerticalResizer` is present only when `detailPanelMode='sidepanel'` **and** `timelineBarsVisible=true` - `VirtualizedTraceView` is always rendered ### ADR `docs/adr/0006-side-panel-span-details.md` status updated to **Implemented**; Phase 5 marked complete. ## Testing ```bash npm run prettier npm run lint npm test npm run build ``` All 2560 tests pass. ### Manual testing of all four layout combinations Enable the side panel feature flag in `default-config.ts` (`enableSidePanel: true`) or via query param, then verify each combination: | `detailPanelMode` | `timelineBarsVisible` | Expected | |---|---|---| | `inline` | `true` | Default behavior — inline expand, timeline bars visible | | `inline` | `false` | Tree-only — inline expand, no timeline bars | | `sidepanel` | `true` | Side panel on right, `VerticalResizer` divider visible | | `sidepanel` | `false` | Side panel fills remaining width, no resizer | To test in embedded mode, append `?uiEmbed=v0` (optionally with `uiTimelineCollapseTitle=1`, `uiTimelineHideMinimap=1`, `uiTimelineHideSummary=1`) to a trace URL and verify the side panel and settings gear work normally. ## AI Usage in this PR (choose one) See [AI Usage Policy](https://github.com/jaegertracing/jaeger/blob/main/CONTRIBUTING_GUIDELINES.md#ai-usage-policy). - [ ] **None**: No AI tools were used in creating this PR - [ ] **Light**: AI provided minor assistance (formatting, simple suggestions) - [ ] **Moderate**: AI helped with code generation or debugging specific parts - [x] **Heavy**: AI generated most or all of the code changes --------- Signed-off-by: Yuri Shkuro <github@ysh.us>
…egertracing#3578) ## Description of the changes - Enables displaying span details in a side panel as an option - Default view is still inline span details, can be changed via `traceTimeline.defaultDetailPanelMode="sidepanel"` config option. <img width="1920" height="964" alt="image" src="https://github.com/user-attachments/assets/c71a9f98-e30d-4030-8947-6dc8e5b6bd0c" /> Previous phases: [Phase 1 jaegertracing#3558](jaegertracing#3558), [Phase 2 jaegertracing#3562](jaegertracing#3562), [Phase 3 jaegertracing#3569](jaegertracing#3569), [Phase 4 jaegertracing#3576](jaegertracing#3576), [Phase 5 jaegertracing#3577](jaegertracing#3577). --------- Signed-off-by: Yuri Shkuro <github@ysh.us>
Implements Phase 1 of ADR-0006: wire up Redux state, config options, and UI toggle controls for the upcoming side-panel and tree-only trace timeline modes. No visual layout changes in this PR — the work is purely state plumbing and a new settings component.
New config options
New Redux state (
TTraceTimeline)Three new fields in the trace timeline slice, all persisted to
localStorage:detailPanelMode'inline' | 'sidepanel''inline'detailPanelModetimelineVisiblebooleantruetimelineVisiblesidePanelWidthnumber(ratio 0–1)0.45sidePanelWidthNew actions:
SET_DETAIL_PANEL_MODE,SET_TIMELINE_VISIBLE,SET_SIDE_PANEL_WIDTH.newInitialState()reads config andlocalStorageon startup.setTracepreserves all three layout preferences when navigating between traces.detailToggleis made mode-aware: insidepanelmode it keeps at most one entry indetailStates(enforcing single-span-at-a-time selection semantics).Width values loaded from
localStorageare clamped to safe ranges on both read and write:spanNameColumnWidthsidePanelWidthNew
TraceViewSettingscomponentReplaces the standalone
KeyboardShortcutsHelp(⌘) button in the trace header with a gear-icon (⚙) dropdown that consolidates all view settings:enableSidePanel: truein config)Active settings are indicated with a checkmark. Preferences survive page reload via
localStorage.KeyboardShortcutsHelpis refactored from a self-contained button+modal into a controlled modal component (open/onCloseprops). The analyticstrack()call fires viauseEffectwhen the modal becomes visible, keeping the caller free of tracking concerns.The
showShortcutsHelpprop is removed — the settings gear is always rendered.