Skip to content
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

Merged
merged 5 commits into from
Mar 15, 2021
Merged

Conversation

lmiller1990
Copy link
Contributor

@lmiller1990 lmiller1990 commented Mar 15, 2021

Fixes:

  1. Persist pane size

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.

  1. Subtle resizing bug

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

@lmiller1990 lmiller1990 requested a review from a team March 15, 2021 06:37
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 15, 2021

Thanks for taking the time to open a PR!

@lmiller1990 lmiller1990 changed the title feat: persist pane sizes feat: persist pane sizes and fix resizing bug Mar 15, 2021
@cypress
Copy link

cypress bot commented Mar 15, 2021



Test summary

9384 0 119 3Flakiness 1


Run details

Project cypress
Status Passed
Commit 80ba9e4
Started Mar 15, 2021 3:41 PM
Ended Mar 15, 2021 3:52 PM
Duration 11:06 💡
OS Linux Debian - 10.5
Browser Multiple

View run in Cypress Dashboard ➡️


Flakiness

cypress/integration/retries.ui.spec.js Flakiness
1 runner/cypress retries.ui.spec > opens attempt on each attempt failure for the screenshot, and closes after test passes

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
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 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.

@dmtrKovalenko
Copy link
Contributor

It will be also nice to make it possible to persist dev tools settings and overall UI plugins settings.

I will make PR to the react devtools to make it possible to override default storage

@lmiller1990
Copy link
Contributor Author

@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.

This was referenced Mar 16, 2021
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.

3 participants