Skip to content

Timeline diagram#2887

Open
ramonsmits wants to merge 5 commits into
masterfrom
feature/timeline-diagram
Open

Timeline diagram#2887
ramonsmits wants to merge 5 commits into
masterfrom
feature/timeline-diagram

Conversation

@ramonsmits
Copy link
Copy Markdown
Member

@ramonsmits ramonsmits commented Mar 14, 2026

Adds a timeline view as an alternative to the sequence diagram. This is based on the traces view of jaeger, application insights, zipkin, etc.

However, this nicely only shows the messages processing durations which is a nice highlevel view. It can show the queue time and also see how message are changed if needed.

It also has a tooltip showing a bit of message information. Messages are clickable and will navigate to that message.

Screencast From 2026-03-14 00-58-37

Reviewer Checklist

  • Components are broken down into sensible and maintainable sub-components.
  • Styles are scoped to the component using it. If multiple components need to share CSS, then a .css file is created containing the shared CSS and imported into component scoped style sections.
  • Naming is consistent with existing code, and adequately describes the component or function being introduced
  • Only functions utilizing Vue state or lifecycle hooks are named as composables (i.e. starting with 'use');
  • No module-level state is being introduced. If so, request the PR author to move the state to the corresponding Pinia store.

@ramonsmits ramonsmits force-pushed the feature/timeline-diagram branch from 754f91b to 344f8d1 Compare March 14, 2026 00:10
@dvdstelt dvdstelt added this to the 2.7.0 milestone Mar 16, 2026
@ramonsmits ramonsmits added the Type: Feature Type: Feature label Mar 16, 2026
@ramonsmits ramonsmits changed the title Feature/timeline diagram Timeline diagram Mar 16, 2026
Move canvas context from module-level singleton to function-local
variable in measureLabelWidth to satisfy PR review checklist.
@ramonsmits
Copy link
Copy Markdown
Member Author

Regarding the checklist for:

No module-level state is being introduced.

Made a change in f712fd9: the measureCtx singleton (let measureCtx: CanvasRenderingContext2D | null = null) was module-level mutable state. Moved to a function-local const inside measureLabelWidth().

All reactive state lives in TimelineDiagramStore (Pinia).

@ramonsmits ramonsmits removed this from the 2.7.0 milestone Mar 17, 2026
Comment on lines +94 to +101
<div class="toolbar-controls">
<button class="toolbar-btn" :class="{ active: useUtc }" :title="useUtc ? 'Showing UTC time' : 'Showing local time'" @click="store.toggleUtc()">
{{ useUtc ? "UTC" : "Local" }}
</button>
<button class="toolbar-btn" :class="{ active: showDeliveryTime }" title="Show delivery time (queue wait + network transit)" @click="store.toggleDeliveryTime()">Delivery time</button>
<button class="toolbar-btn" :class="{ active: showConnections }" title="Show connections between related messages" @click="store.toggleConnections()">Connections</button>
<button v-if="isZoomed" class="toolbar-btn" @click="store.resetZoom()">Reset zoom</button>
</div>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ramonsmits I think there are already patterns in the codebase about toolbar buttons.
It may be good to review these and make sure we are not creating another pattern here.
My instinct is to stick to the bootstrapper button; there's no need to come up with new CSS for these buttons.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnsimons addressed

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “Timeline” visualization for message conversations (trace-style view) as an alternative to the existing sequence diagram in the Message view.

Changes:

  • Introduces a new Pinia store to build timeline state (bars/rows), manage zoom, and handle navigation/tooltip state.
  • Adds a timeline model layer for building tree-structured rows and generating axis ticks/formatting helpers.
  • Adds a set of Vue components to render the timeline (axis, endpoints/labels, bars, connections, minimap) and wires it into MessageView as a new tab.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/Frontend/src/stores/TimelineDiagramStore.ts New Pinia store managing timeline data, zoom, local preferences, tooltip, and navigation.
src/Frontend/src/resources/TimelineDiagram/TimelineModel.ts New model utilities/types for transforming conversation messages into timeline rows/bars and tick generation.
src/Frontend/src/components/messages/TimelineDiagram/TimelineDiagram.vue Main timeline view container: layout, toolbar, minimap, tooltip, wheel zoom integration.
src/Frontend/src/components/messages/TimelineDiagram/TimelineMinimap.vue Minimap overview + drag-to-pan zoom window.
src/Frontend/src/components/messages/TimelineDiagram/TimelineEndpoints.vue Renders row labels (type/endpoint) including tree guides and row click navigation.
src/Frontend/src/components/messages/TimelineDiagram/TimelineBars.vue Renders delivery/processing bars and hover interactions/tooltip updates.
src/Frontend/src/components/messages/TimelineDiagram/TimelineConnections.vue Renders dashed “related message” connector lines.
src/Frontend/src/components/messages/TimelineDiagram/TimelineAxis.vue Renders top elapsed-time ticks and bottom wall-clock ticks/gridlines.
src/Frontend/src/components/messages/MessageView.vue Adds the new “Timeline” tab to the message view.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Frontend/src/stores/TimelineDiagramStore.ts
Comment thread src/Frontend/src/stores/TimelineDiagramStore.ts Outdated
Comment thread src/Frontend/src/resources/TimelineDiagram/TimelineModel.ts Outdated
Comment thread src/Frontend/src/resources/TimelineDiagram/TimelineModel.ts Outdated
Comment thread src/Frontend/src/stores/TimelineDiagramStore.ts
Comment thread src/Frontend/src/stores/TimelineDiagramStore.ts Outdated
Comment thread src/Frontend/src/resources/TimelineDiagram/TimelineModel.ts
@github-actions github-actions Bot added the stale label Apr 30, 2026
@ramonsmits ramonsmits removed the stale label Apr 30, 2026
@ramonsmits ramonsmits removed their assignment Apr 30, 2026
@Particular Particular deleted a comment from github-actions Bot Apr 30, 2026
@github-actions github-actions Bot added the stale label May 31, 2026
@ramonsmits ramonsmits removed the stale label Jun 1, 2026
@Particular Particular deleted a comment from github-actions Bot Jun 1, 2026
- Toolbar buttons now use Bootstrap btn/btn-secondary/btn-sm classes
  (matches SagaDiagram.vue convention) instead of custom .toolbar-btn.
- Selection highlight now reacts to selectedId changes: drop the baked-in
  TimelineBar.isSelected flag and compute selection in consumers
  (TimelineBars, TimelineMinimap) against the store's selectedId getter.
  Fixes stale highlight when navigating between sibling messages within
  the same conversation.
- TimelineMinimap clears document mousemove/mouseup listeners on unmount
  to avoid leaking handlers when the component is torn down mid-drag.
- TimelineModel: stop pushing the root's continuation flag into its
  children's continuations array. The extra entry caused the v-line
  for a not-last root to be drawn on top of the descendants' branch
  column, producing a double vertical line at the parent column.
- TimelineDiagramStore: reset bars/rows/zoom/tooltip/highlight state
  when the watched conversation data becomes empty so a failed or
  cleared fetch doesn't leave stale UI behind.
- Mark window.open() with noopener,noreferrer for the cross-tab
  navigation path.
- Extract pickTickInterval helper shared by generateTimeTicks and
  generateWallClockTicks, with a whole-hour fallback so conversations
  longer than maxTicks hours don't produce an unbounded tick set.
- Wrap localStorage access in safeGetItem/safeSetItem helpers so
  privacy/quota errors don't break the timeline (matches
  PlatformCapabilitiesStore/RemoteInstancesStore conventions).
- Replace v-bind(MINIMAP_HEIGHT + 'px') with a literal height to
  avoid the prettier quote-style warning.
- CI's stricter TS pipeline rejected the default Message import as a
  value when it's used only as a type (TS1484). Mark it inline as a
  type-only import while keeping the enums (MessageStatus,
  MessageIntent) as value imports.
- TimelineAxis.vue: collapse the ticks computed onto one line to
  satisfy prettier; lint was blocking the Windows job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Feature Type: Feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants