Skip to content

Prevent Timeline selections that are out of bounds#147

Merged
TeofilC merged 1 commit intohaskell:masterfrom
TuongNM:selections-out-of-bounds
Feb 18, 2026
Merged

Prevent Timeline selections that are out of bounds#147
TeofilC merged 1 commit intohaskell:masterfrom
TuongNM:selections-out-of-bounds

Conversation

@TuongNM
Copy link
Contributor

@TuongNM TuongNM commented Feb 14, 2026

Fixes #40

While testing this I noticed an issue for #145 where a wrong background color was used when making a PointSelection. I included a fix for that in this PR.

timelineSetSelection now returns Nothing in case of an invalid selection
that's solely outside of the TimelineView for both a PointSelection and
a RangeSelection. A RangeSelection is additionally clamped to the bounds
of the TimelineView to stop dragging when the bounds have been reached.

The new return value is processed inside the Mouse and Event handling
accordingly. Within this the EventCursorChangedIndex handling now
includes updating previously omitted views. This fixes an issue where
following a RangeSelection with a selection inside the EventsView would
cause the previously omitted views to still display the information of
the RangeSelection and not the equivalent PointSelection of the
EventsView selection.

Lastly, fix an issue from the previous commit that added styling usage
inside the EventsView. The wrong background color was applied to a
selected Event when making the second PointSelection after a
RangeSelection or a PointSelection without a preceding RangeSelection.
StateSelected is now always applied when selected.
Copy link
Collaborator

@TeofilC TeofilC left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

@TeofilC TeofilC merged commit 5682975 into haskell:master Feb 18, 2026
8 checks passed
@TuongNM TuongNM deleted the selections-out-of-bounds branch February 18, 2026 21:13
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.

Threadscope allows selection after the end of the trace

2 participants

Comments