-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: persist pane sizes and fix resizing bug #15480
Conversation
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ Flakiness
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
@@ -218,6 +230,21 @@ const App: React.FC<AppProps> = observer( | |||
<KeyboardHelper /> | |||
) | |||
|
|||
const MainAreaComponent: React.FC | typeof SplitPane = props.state.spec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes the second bug described in the PR description. We should not render the Reporter at all if there is no spec selected. It makes resizing buggy.
It will be also nice to make it possible to persist dev tools settings and overall UI plugins settings.
|
@dmtrKovalenko I agree on the plugins pane persisting, it was a little more tricky than the other panes so I decided to leave it out for now. It should not be too difficult to add in. |
Fixes:
Now when you resize the reporter or spec list, it will persist it to your next session. Test by resizing the reporter pane and spec list, refresh the page, ensure width is persisted.
If you render an un-resizable split pane with a width of 0, the resize handle and listener still exists. An example if when there is no spec selected, the reporter pane has a width of 0 and is un-resizable. Despite this, if you try to resize the spec list with your cursor approaching from the right, it will actually try to resize the un-resizable reporter.
I fixed this bug by not rendering the reporter pane at all if no spec is selected. Here is a video of before/after - note the cursor and how I try to resizing the pane.
Before - cannot resize:
broken.mov
After - can resize:
fixed.mov
User facing changelog
Persist width of panes in CT runner between sessions.
Additional details
N/A
How has the user experience changed?
Save the width of panes in the same style of the E2E runner.
PR Tasks