Skip to content

front: focus the train on the std when clicking on the projection button - #18754

Open
Caracol3 wants to merge 1 commit into
devfrom
mcy/front-focus-train-in-std-when-projecting
Open

Caracol3 wants to merge 1 commit into
devfrom
mcy/front-focus-train-in-std-when-projecting

Conversation

@Caracol3

Copy link
Copy Markdown
Contributor

Description

Until this ticket (https://github.com/osrd-project/osrd-confidential/issues/1226) is implemented, it would be useful to be able to center the view on the newly projected train in the GET when clicking the projection button.

  • : When clicking on the projection button (in the timetable) there is a focus on the train in the std

@Caracol3 Caracol3 self-assigned this Sep 23, 2026
@Caracol3
Caracol3 requested a review from a team as a code owner September 23, 2026 16:14
@Caracol3 Caracol3 added kind:enhancement Improvement of existing features area:front Work on Standard OSRD Interface modules module:operational-studies Multi-train simulation with structured studies management labels Sep 23, 2026
@Caracol3 Caracol3 moved this to In Progress in Board PI 21 Sep 23, 2026
@theocrsb theocrsb changed the title Focus the train on the std when clicking on the projection button front: focus the train on the std when clicking on the projection button Sep 25, 2026

@SharglutDev SharglutDev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for the PR !

Comment on lines +538 to +540
if (previousProjectionId !== selectedProjectionId && spaceTimeChartProps.xOffset) {
pan({ dx: -spaceTimeChartProps.xOffset });
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not sure I see the difference from the previous behavior with this new condition ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With this condition if we remove or add a train to the timetable, we won't loose the actual pan on the std.

(train) => train.id === selectedProjectionId || train.id === firstOccurrenceId
);
if (trainUsedForProjection) {
setTimeOrigin(+trainUsedForProjection.departureTime);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: to discuss with @maelysLeratRosso but maybe it would be nice to leave a small gap on the left when centering by doing something like departureTime - 5min ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good idea, if find it better too with this little offset

@Caracol3 Caracol3 Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just to get an idea of both solutions:

Projection_GET.mov

Signed-off-by: Mathieu <mathieu.coulibaly@sncf.fr>
@Caracol3
Caracol3 force-pushed the mcy/front-focus-train-in-std-when-projecting branch from 3502624 to 89de9c4 Compare September 25, 2026 14:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:front Work on Standard OSRD Interface modules kind:enhancement Improvement of existing features module:operational-studies Multi-train simulation with structured studies management

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

2 participants