fix(web): resolve selection issues in SelectionManager and History view - #859
Merged
Merged
Conversation
- Refactor SelectionManager to remove circular synchronization and control flags (ignoreXxxSelect). - Support selecting logs and revisions in descendant timelines when a parent timeline is selected by expanding lookup and validation scope to selectedTimelinesWithChildren(). - Compute previousOfSelectedRevision using revision.timeline instead of selectedTimeline() to correctly resolve previous revisions for child timelines. - Update DiffSmartComponent (selectedTimeline) to prioritize the timeline of the currently selected revision or log so that the History view correctly renders descendant revision histories. - Update unit tests in selection-manager.service.spec.ts to verify child timeline selection and cleanup behaviors.
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors the selection management logic in SelectionManager to improve how timelines, logs, and revisions are selected and validated, including updating the selectedTimeline computed signal in DiffSmartComponent and adding corresponding unit tests. The review feedback suggests a usability improvement in onSelectLog to fall back to searching all filtered timelines when an unrelated log is selected while a timeline is already active, rather than clearing the selection entirely, along with an additional unit test to verify this behavior.
kyasbal
marked this pull request as ready for review
August 4, 2026 08:14
kyasbal
requested review from
K53,
RyuSA,
jyane,
kkuchima and
renamoo
as code owners
August 4, 2026 08:14
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.
Related Issue
Fixes #858
Summary
This PR addresses several non-intuitive selection behaviors in
SelectionManagerand the History (Diff) view when interacting with logs and revisions across timeline hierarchies.Previously,
SelectionManagerrelied on bidirectional synchronization loops and multipleignoreXxxSelectcontrol flags, which caused log selections to be inadvertently cleared—especially when a log belonged to multiple timelines or a descendant timeline. Furthermore, the History view did not update its target timeline when inspecting a revision belonging to a child resource.Key Changes
SelectionManagerRefactoring & SimplificationsynchronizeSelection,changeSelectionByXxxInternal) and over 100 lines of complex control flags (ignoreLogSelect,ignoreResourceSelect,ignoreTimelineSelect).onSelectTimeline,onSelectLog,onSelectRevision,onSelectEvent) into clear, unidirectional state updates.selectedTimelinetoselectedTimelinesWithChildren().previousOfSelectedRevisionto compute fromrevision.timelinerather thanselectedTimeline(), correctly resolving the previous revision even for child timeline elements.DiffSmartComponent(selectedTimeline) to prioritize the timeline of the currently selected revision or log. Consequently, the History view now accurately displays the revision history and diffs of selected child resources.selection-manager.service.spec.tsverifying log selection within child timelines and proper selection cleanup behavior.Verification
make test-web: All 724 unit tests passed successfully.make format-web,make lint-web, andmake build-storybook: All checks passed with 0 issues.make pre-commit: Verified formatting and static analysis across all modified files (0 issues).