Repository navigation
Conversation
- Per-plot undo/redo stack for view states (time window + Y-axis ranges) - Back/Forward buttons in the tab bar with Undo/Redo icons - Reset zoom button that restores full range, re-enables autoscroll, and resets all Y-axes to auto-scale (fixes #109) - Keyboard shortcuts: Alt+←/→ for back/forward, Alt+0 for reset zoom - 300ms coalesce timer so rapid zoom adjustments merge into one history entry - Reset zoom button per grid cell - Programmatic zoom restore via ECharts dispatchAction with zoomTarget prop - Session-only history, not persisted to workspaces
- Clean up zoomTargetByPlot entries when a plot is removed - Read post-update plots inside setPlots updater in updateAxisInPlot so the history snapshot reflects the actual axis state - Narrow useEffect dependency from full zoomTarget object to zoomTarget?.generation to avoid unnecessary effect runs
- Add timeOffset field to PVTrace for offsets like "-1d", "-7d" - Offset traces fetch [from+offset, to+offset] and shift timestamps onto the plot's axis - Legend and tooltip show the offset, e.g. "PV:TEST (−1 d)" - "Duplicate with offset" action via clock icon on trace rows with preset and custom offsets - Offset traces are archive-only (live data disabled) - Offset traces use dashed line style to distinguish from the original - Time Offset input in RightPanel General tab with validation
|
|
||
| const updateTrace = (traceId: string, updates: Partial<PVTrace>) => { | ||
| if (updates.timeOffset && parseOffsetMs(updates.timeOffset) != null) { | ||
| updates = { ...updates, useLive: false, useArchive: true }; |
Contributor
There was a problem hiding this comment.
Two gaps in how the archive-only rule is applied:
- It is enforced only when the offset is edited through
updateTrace. A workspace file or share link withtimeOffsetset anduseLive: trueloads as-is, andtraceSamplesshifts live points along with archive ones, so live data would be drawn displaced by the offset. Enforcing it on load, or ignoring live points for offset traces intraceSamples, would close that. - Clearing the offset leaves
useLiveoff. A trace that was live before an offset was typed in stays archive-only afterwards with nothing indicating why.
| className="offset-popover" | ||
| onClick={(e) => e.stopPropagation()} | ||
| onKeyDown={(e) => { | ||
| if (e.key === 'Escape') onClose(); |
Contributor
There was a problem hiding this comment.
A few things on the popover:
- Escape only fires when focus is inside this div, but after clicking the clock button focus stays on the button, so Escape does nothing until something inside is focused.
- There is no outside-click close, so popovers can be left open on several rows at once.
role="menu"is set but the items have nomenuitemrole or arrow-key handling.- Styling and hover are done with inline styles and mouse handlers; the rest of the panel uses classes in
App.css. - Dragging to select text in the custom input starts a row drag, since the popover sits inside the sortable row.
| ...source, | ||
| id, | ||
| color: colorForIndex(getPalette(paletteId), plot.traces.length), | ||
| displayName: '', |
Contributor
There was a problem hiding this comment.
Minor: this drops a custom display name from the source trace. traceLabel appends the offset to whichever name is in use, so keeping source.displayName would give e.g. "Beam current (−1 d)" instead of falling back to the PV name.
- Sanitize offset traces on workspace/share-link load to force archive-only mode - Restore useLive when clearing a trace's time offset - Preserve custom display name when duplicating a trace with offset - Fix OffsetPopover: close on Escape and outside click, prevent drag conflict, add ARIA roles, and move inline styles to CSS classes
- Document the "Compare with a Time Offset" feature: creating offset traces, how they display, editing/removing offsets
- Add missing zoomTarget and liveChart dependencies to useEffect - Run prettier on PlotArea.tsx
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation
Closes #124
Screenshots
Pre-merge checklist
npm test)npm run lint)