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

fix: Forms - Add 'escape' button / key handler in forms #240

Merged
merged 5 commits into from
Feb 16, 2022

Conversation

bryphe-coder
Copy link
Contributor

In v1, we had a quick and easy way to leave creation forms - an escape button (and key handler) in the top right corner.

This was especially helpful in cases where the form was long enough that the 'Cancel' button was off-screen.

This ports over that component into v2 and hooks up into our two existing forms:
Screen Shot 2022-02-09 at 5 48 03 PM

In addition, this adds test cases + a storybook story for it.

@bryphe-coder bryphe-coder self-assigned this Feb 10, 2022
@codecov
Copy link

codecov bot commented Feb 10, 2022

Codecov Report

Merging #240 (7a0bf9c) into main (2e254a0) will increase coverage by 0.14%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #240      +/-   ##
==========================================
+ Coverage   68.06%   68.20%   +0.14%     
==========================================
  Files         130      132       +2     
  Lines        7079     7099      +20     
  Branches       69       70       +1     
==========================================
+ Hits         4818     4842      +24     
+ Misses       1774     1770       -4     
  Partials      487      487              
Flag Coverage Δ
unittest-go-macos-latest 66.44% <ø> (+0.21%) ⬆️
unittest-go-ubuntu-latest 67.21% <ø> (-0.13%) ⬇️
unittest-go-windows-latest 65.76% <ø> (-0.16%) ⬇️
unittest-js 66.23% <100.00%> (+0.99%) ⬆️
Impacted Files Coverage Δ
site/components/Form/FormCloseButton.tsx 100.00% <100.00%> (ø)
site/components/Form/index.ts 100.00% <100.00%> (ø)
site/components/Icons/Close.tsx 100.00% <100.00%> (ø)
site/forms/CreateProjectForm.tsx 95.45% <100.00%> (ø)
site/forms/CreateWorkspaceForm.tsx 86.66% <100.00%> (ø)
peer/conn.go 80.76% <0.00%> (-1.03%) ⬇️
provisionerd/provisionerd.go 69.35% <0.00%> (-0.59%) ⬇️
coderd/provisionerdaemons.go 57.84% <0.00%> (+0.61%) ⬆️
peer/channel.go 87.19% <0.00%> (+2.43%) ⬆️
peerbroker/dial.go 80.95% <0.00%> (+4.76%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2e254a0...7a0bf9c. Read the comment docs.

Copy link
Member

@kylecarbs kylecarbs left a comment

Choose a reason for hiding this comment

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

Seems reasonable to me.

esc makes it seem like a modal would close, but this really goes back. It's a minor UX nit we can work through later on.

@bryphe-coder
Copy link
Contributor Author

Thanks for reviewing @kylecarbs !

esc makes it seem like a modal would close, but this really goes back. It's a minor UX nit we can work through later on.

Good point - we can def iterate on it

@bryphe-coder bryphe-coder merged commit 35291d3 into main Feb 16, 2022
@bryphe-coder bryphe-coder deleted the bryphe/fix/add-esc-handler branch February 16, 2022 00:43
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.

None yet

2 participants