Skip to content

feat(inspector): seek the Timeline from a governor usage chart - #950

Merged
lcottercertinia merged 1 commit into
certinia:mainfrom
lukecotter:feat-inspector-trend-seek
Aug 21, 2026
Merged

feat(inspector): seek the Timeline from a governor usage chart#950
lcottercertinia merged 1 commit into
certinia:mainfrom
lukecotter:feat-inspector-trend-seek

Conversation

@lukecotter

@lukecotter lukecotter commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

📝 PR Overview

The inspector's governor usage charts show when a metric climbed, but the chart was a picture only. A spike at 4s gave no way to reach the code behind it: you read the time off the chart, then hunted for it on the Timeline by hand.

The charts are now seekable. Click a point, or step a focused chart with the arrow keys and press Enter, and the Timeline moves to that instant and zooms to a window of max(2% of the log, 100ms) around it — 480ms on the 24s sample log. Nothing is selected, so the inspector keeps the whole-log reading the charts belong to.

🛠️ Changes made

  • GovernorTrends emits timeline:navigate-to with a new seek mode. A click takes the pointer position; the arrow keys step one seek window at a time, so no part of the log falls between reachable windows.
  • New seekWindow(at, logTotal) owns the rule, so the width comes from the log and never from whatever frame the instant lands in.
  • ApexLogTimeline.navigateToTimestamp gains the seek branch: zoom with no selection, and no padding, so the window shown is the width asked for. A seek with no frame spanning the instant still moves, centred at depth 0.
  • timeline:navigate-to narrows so mode sits only on the timestamp form: only an instant can be sought.
  • Each chart is a <button>, so the focus ring shows for keyboard focus and not for a click, and the readout is a live region, so a stepped cursor is announced.

🧩 Type of change (check all applicable)

  • 🐛 Bug fix - something not working as expected
  • ✨ New feature – adds new functionality
  • ♻️ Refactor - internal changes with no user impact
  • ⚡ Performance Improvement
  • 📝 Documentation - README or documentation site changes
  • 🔧 Chore - dev tooling, CI, config
  • 💥 Breaking change

📷 Screenshots / gifs / video [optional]

🔗 Related Issues

related #373

✅ Tests added?

  • 👍 yes
  • 🙅 no, not needed
  • 🙋 no, I need help

📚 Docs updated?

  • 🔖 README.md
  • 🔖 CHANGELOG.md
  • 📖 help site
  • 🧪 Marked any pre-release-only features (README 🧪 badge — see RELEASING.md)
  • 🙅 not needed

Anything else we need to know? [optional]

Test plan: pnpm lint, pnpm test, pnpm build, then sample-app/debug-logs/sample-log.log, Timeline tab, inspector with nothing selected:

  1. Click the middle of a usage chart: the Timeline zooms to about 480ms around that instant, and nothing is selected.
  2. Move the pointer along a chart: the readout follows the line and the Timeline does not move.
  3. Tab to a chart, press ArrowRight a few times, then Enter: the Timeline moves to the cursor, not the last sample.
  4. Move the mouse across the chart and away after step 3: the arrow-key cursor stays.
  5. Click a chart: no focus ring.

Repeat in a light and a dark theme, and with the panel docked to the side and to the bottom.

Click a point on a usage chart, or step a focused chart with the arrow
keys and press Enter, to move the Timeline to that instant and zoom in
on it. The chart selects nothing, so the inspector keeps its whole-log
reading.
@lcottercertinia
lcottercertinia merged commit 0a15564 into certinia:main Aug 21, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants