Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Conversation

artemruts
Copy link
Contributor

@artemruts artemruts commented Nov 14, 2020

Fixes #15409

Emails

Reworked Setting/Emails page, removed FilteredConnection and hopefully simplified a few things.
There's a "Set primary address" select now, ty @ryanslade.
A 80% of the time I spend recalling React.

CSS:

  • Maybe select element can have fixed(-ish) width?
  • Replace filtered-connection styles, what approach should I take?
  • Not sure why modal looks that way, why did we set width: 32 rem?

@quinnkeast some of the styles are definitely not 1 to 1 as in Figma, which elements stand out to you the most?

@codecov
Copy link

codecov bot commented Nov 14, 2020

Codecov Report

Merging #15778 (4da6551) into main (e6ba3e5) will decrease coverage by 0.00%.
The diff coverage is 6.72%.

@@            Coverage Diff             @@
##             main   #15778      +/-   ##
==========================================
- Coverage   52.97%   52.97%   -0.01%     
==========================================
  Files        1649     1651       +2     
  Lines       82442    82452      +10     
  Branches     7413     7334      -79     
==========================================
+ Hits        43671    43676       +5     
- Misses      34928    34932       +4     
- Partials     3843     3844       +1     
Flag Coverage Δ
go 52.56% <ø> (-0.01%) ⬇️
integration 29.10% <0.00%> (-0.05%) ⬇️
storybook 28.00% <22.22%> (-0.01%) ⬇️
typescript 53.95% <6.72%> (+<0.01%) ⬆️
unit 36.02% <6.72%> (+0.04%) ⬆️
Impacted Files Coverage Δ
.../web/src/user/settings/emails/AddUserEmailForm.tsx 0.00% <0.00%> (ø)
...c/user/settings/emails/SetUserPrimaryEmailForm.tsx 0.00% <0.00%> (ø)
client/web/src/user/settings/emails/UserEmail.tsx 0.00% <0.00%> (ø)
...rc/user/settings/emails/UserSettingsEmailsPage.tsx 0.00% <0.00%> (ø)
client/shared/src/util/useInputValidation.ts 94.00% <88.88%> (-1.24%) ⬇️
cmd/repo-updater/repos/syncer.go 76.92% <0.00%> (-0.54%) ⬇️

@artemruts artemruts marked this pull request as ready for review November 18, 2020 06:17
@quinnkeast
Copy link
Contributor

I've created a visual QA in Figma here:

https://www.figma.com/file/zXvqCASHDzmvKbrAl1EVsd/Public-and-Private-Repos-for-Users-on-Cloud?node-id=291%3A228

I don't know if this is the best format, but let me know if it works or if I should make any adjustments to how I share this QA feedback!

Re: confirmation modal, I don't believe we need to show the confirmation modal. Only the non-primary email can be removed, and it's easy enough to add it back that we don't need the extra confirmation step.

Copy link
Contributor

@felixfbecker felixfbecker left a comment

Choose a reason for hiding this comment

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

I'm really excited to see these pages cleaned up, great job!
I left a lot of comments with patterns and links to docs that you could not have been aware of yet so I hope you're not intimidated! I'm happy to go over this in our buddy sync later :)

@artemruts
Copy link
Contributor Author

@quinnkeast would it be possible to ship this UI without the resend email verification link?
I'll file a separate issue and pair with somebody on this.

Also can you please check this UI one more time? 🙇

@quinnkeast
Copy link
Contributor

@quinnkeast would it be possible to ship this UI without the resend email verification link?
I'll file a separate issue and pair with somebody on this.

Yes, that sounds fine! Let me know if I can help with the issue.

Also can you please check this UI one more time? 🙇

For sure. Two last bits of feedback:

Screenshot 2020-11-25 at 10 25 12

The placeholder on the Email input isn't needed, and should be removed.

Screenshot 2020-11-25 at 10 25 32

The external corners of the email list should have a 4px corner radius, like so:

Screenshot 2020-11-25 at 10 29 02

@artemruts artemruts force-pushed the cloud-emails-redesign-15409 branch from a8a9ff0 to 391ca02 Compare November 25, 2020 17:05
Comment on lines 2 to 10
.form-inline input:not(.is-invalid),
.form-inline input:not(.is-valid) {
padding-right: 2rem;
}
.loader-input {
&__spinner {
right: 1rem;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes are to make LoaderInput component look good when parent element has form-inline class.
By default it looked like this:

add-email

Copy link
Contributor

Choose a reason for hiding this comment

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

That seems like a bug in LoaderInput, could we fix that generally for the LoaderInput instead of just here? cc @tjkandala

Copy link
Contributor

Choose a reason for hiding this comment

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

Fixed in latest commit by moving mr-sm-2 up from the <input> to <LoaderInput>.

The width of <LoaderInput>s container <div> was inflated by the margin, so right wasn't big enough on the absolutely positioned spinner.

Before

Screenshot from 2020-11-27 16-18-43

After

Screenshot from 2020-11-27 16-18-07

@felixfbecker I moved some imports around (brought loading spinner to branded), can you take a look to make sure I didn't miss anything?

@tjkandala
Copy link
Contributor

Pushed a quick commit to fix a UI state issue when emails are deleted in quick succession. We were filtering on emails at the time that the user clicked "remove", so when the mutation promise resolved, there was a chance that we added deleted emails back to the array. Now, we use a setState callback so we're always passed the latest emails.

Email deletion before
Email deletion after

Also ensures that users can't click "Add" when the email is not valid

@felixfbecker
Copy link
Contributor

That's the kind of bug refetching avoids :)

@artemruts
Copy link
Contributor Author

@tjkandala thanks for UI fixes 🙇

@artemruts artemruts force-pushed the cloud-emails-redesign-15409 branch from 0de13a3 to edabd7c Compare November 30, 2020 21:41
@@ -1,8 +1,11 @@
/* eslint-disable @typescript-eslint/no-floating-promises */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a false-positive with act calls in @testing-library/react-hooks

Copy link
Contributor

@tsenart tsenart left a comment

Choose a reason for hiding this comment

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

LGTM visually, trust you can coordinate with the @sourcegraph/web team on any follow up changes they want to infrastructure, shared components, etc. We should not block this feature on those.

Copy link
Contributor

@felixfbecker felixfbecker left a comment

Choose a reason for hiding this comment

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

Feel free to address comments at your discretion and merge

.form-inline input:not(.is-invalid),
.form-inline input:not(.is-valid) {
padding-right: 2rem;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

question: What is this CSS still needed for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's still used to prevent the input element from "jumping" when spinner/valid/invalid icons appear

Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't that apply to all inputs then, not just this particular input? I.e. this style should live in global-styles/?

@artemruts artemruts merged commit a5fba26 into main Dec 1, 2020
@artemruts artemruts deleted the cloud-emails-redesign-15409 branch December 1, 2020 18:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update email settings UI and handle account reunification
5 participants