Skip to content

Commit

Permalink
Update view range during trace indexing
Browse files Browse the repository at this point in the history
While the trace context component updateTrace() loop is iterating,
update the unit controller's view range if the current view range is the
full range and the full range has changed.

If the user zooms the view range, it will stop updating to prevent
snapping out of the user's view range. If the users zooms back out to
the full range it will restart updating again.

Signed-off-by: Patrick Tasse <[email protected]>
  • Loading branch information
PatrickTasse committed Jul 5, 2024
1 parent 2f5bb1d commit 70fb3c1
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,22 @@ export class TraceContextComponent extends React.Component<TraceContextProps, Tr
)
});

// Only update the view range if it's currently showing the full range
const updateViewRange = this.unitController.viewRange.start === BigInt(0) &&
this.unitController.viewRange.end === this.unitController.absoluteRange &&
(this.unitController.viewRange.end !== (updatedExperiment.end - updatedExperiment.start ||
this.unitController.offset !== updatedExperiment.start));
this.unitController.absoluteRange = this.state.experiment.end - this.state.timeOffset;
this.unitController.offset = this.state.timeOffset;
signalManager().fireExperimentUpdatedSignal(updatedExperiment);
if (updateViewRange) {
this.unitController.viewRange = {
start: BigInt(0),
end: this.unitController.absoluteRange
};
this.emitTimeRangeData();
}

// Update status bar
this.props.messageManager.addStatusMessage(this.INDEXING_STATUS_BAR_KEY, {
text: `Indexing ${this.props.experiment.name}: ${this.state.experiment.nbEvents}`,
Expand Down

0 comments on commit 70fb3c1

Please sign in to comment.