Skip to content

Comments

feat: improve Timepoint Explorer selection UX#1574

Merged
g3john merged 7 commits intomainfrom
feat/improve-timepoint-explorer-selection
Feb 6, 2026
Merged

feat: improve Timepoint Explorer selection UX#1574
g3john merged 7 commits intomainfrom
feat/improve-timepoint-explorer-selection

Conversation

@g3john
Copy link
Contributor

@g3john g3john commented Jan 30, 2026

What this PR does / why we need it :

This PR makes the following changes

  • Dim non-selected bars slightly
  • Scroll to logs when a bar/entry is clicked
  • Updated empty logs placeholder text

Which issue(s) this PR fixes:

This PR addresses the first Interaction patterns to improve responsiveness & discoverability item in this doc

Screen.Recording.2026-01-30.at.12.03.44.PM.mov

@github-actions github-actions bot added the feature A feature added to the application. label Jan 30, 2026
@github-actions
Copy link

github-actions bot commented Jan 30, 2026

Script size changes

Name +/- Main This PR Outcome
[411.js] = 2,181.31 kB 2,181.31 kB
[854.js] +0.08% 799.96 kB 800.61 kB
[datasource/module.js] = 25.02 kB 25.02 kB
[692.js] +0.43% 20.59 kB 20.68 kB
[663.js] = 5.83 kB 5.83 kB
[module.js] = 4.55 kB 4.55 kB
[156.js] = 1.90 kB 1.90 kB

Totals

Name +/- Main This PR Outcome
[Scripts] +0.02% 3,039.17 kB 3,039.90 kB
[Non-script Assets] = 2,675.38 kB 2,675.38 kB
[All] +0.01% 5,714.54 kB 5,715.28 kB

Generated by 🚫 dangerJS against 75eb710

display: flex;
flex-direction: column;
gap: ${theme.spacing(2)};
scroll-margin-top: 25vh;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This scrolls to 25% of the view height above the logs, so that the user will be able to see a little bit of the graph

@g3john g3john marked this pull request as ready for review February 2, 2026 14:36
@g3john g3john requested a review from a team as a code owner February 2, 2026 14:36
@g3john g3john requested review from VikaCep and removed request for a team February 2, 2026 14:36
Comment on lines 7 to 8
from: dateTime('2024-01-01T00:00:00Z'),
to: dateTime('2024-01-02T00:00:00Z'),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The XAxis component is expecting a DateTime object. It didn't throw an error before because we are not mocking timepoints which now renders the XAxisContent

Copy link
Contributor

@ckbedwell ckbedwell left a comment

Choose a reason for hiding this comment

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

Great changes. 👏

Main CR is just exploring if MSW would be better rather than mocking the hook.

Comment on lines 52 to 64
jest.mock('scenes/components/TimepointExplorer/TimepointExplorer.hooks', () => ({
...jest.requireActual('scenes/components/TimepointExplorer/TimepointExplorer.hooks'),
useTimepoints: jest.fn(() => mockTimepoints),
}));

jest.mock('scenes/components/TimepointExplorer/TimepointViewer.hooks', () => ({
useTimepointLogs: jest.fn(() => ({
data: [],
isFetching: false,
isLoading: false,
refetch: jest.fn(),
})),
}));
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not necessarily against mocking the hook here but my preference is we use MSW to mock the base dependency. The hook is an implementation detail so if we were to change it at some point in the future we would break the tests, which undermines one of their main benefits. If we aim to mock as high as possible (our out-of-repo dependencies) and test from the perspective of a user we create the most durable tests.

So, try and mock the server response instead here and see how that looks/feels. The Time Point Explorer does have a lot of inter-connected dependencies which is why it doesn't have many tests so we might find this approach is a pain in the ass as it creates a horrible web and what you've done here is the cleanest solution but give it a go and see how you find it!

Comment on lines 66 to 67
const mockScrollIntoView = jest.fn();
Element.prototype.scrollIntoView = mockScrollIntoView;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this get reset and/or moved out of the global scope if possible?

timepoints: StatelessTimepoint[];
}

export function useIsInitialised({
Copy link
Contributor

Choose a reason for hiding this comment

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

How confident are we we don't need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll put it back. I initially had to remove it because the initialization selects a timepoint, so it would auto-scroll on page-load. I then added the shouldScrollToViewer flag that only enables on timepoint click, so that issue won't be the case anymore

@g3john g3john requested a review from ckbedwell February 3, 2026 15:23
@g3john g3john force-pushed the feat/improve-timepoint-explorer-selection branch from b551dca to 57f7c41 Compare February 3, 2026 15:52
Copy link
Contributor

@ckbedwell ckbedwell left a comment

Choose a reason for hiding this comment

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

Was just about to approve this then noticed there is one place you've missed that doesn't scroll to the logs viewer (it is fairly hidden 😅)

Screen.Recording.2026-02-03.at.17.16.39.mov

Once that is done, this is going in!

@g3john
Copy link
Contributor Author

g3john commented Feb 3, 2026

Was just about to approve this then noticed there is one place you've missed that doesn't scroll to the logs viewer (it is fairly hidden 😅)

Screen.Recording.2026-02-03.at.17.16.39.mov
Once that is done, this is going in!

Ah thanks for calling that one out. Added!

@g3john g3john requested a review from ckbedwell February 3, 2026 22:06
Copy link
Contributor

@ckbedwell ckbedwell left a comment

Choose a reason for hiding this comment

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

LGTM!

@g3john g3john merged commit 60d7fa2 into main Feb 6, 2026
36 checks passed
@g3john g3john deleted the feat/improve-timepoint-explorer-selection branch February 6, 2026 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A feature added to the application.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants