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

Remove “Cancel” button from loading state #1687

Merged
merged 1 commit into from
Nov 22, 2023

Conversation

jotaen4tinypilot
Copy link
Contributor

@jotaen4tinypilot jotaen4tinypilot commented Nov 21, 2023

In our style guide, we say that dialog loading states shouldn’t have close/cancel buttons.

The <change-hostname> dialog violated this rule, which this PR fixes.

Screen.Recording.2023-11-21.at.19.05.06.mov

Tangentially related #1684.

Currently blocked by #1686 (e2e tests failing).

Review on CodeApprove

Copy link
Contributor Author

Automated comment from CodeApprove ➜

@jdeanwallace please review this Pull Request

Copy link
Contributor

@jdeanwallace jdeanwallace left a comment

Choose a reason for hiding this comment

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

Automated comment from CodeApprove ➜

Approved on CodeApprove
✔️ Approved

LGTM!


👀 @jotaen4tinypilot it's your turn please take a look

@jotaen4tinypilot jotaen4tinypilot merged commit 59025c7 into master Nov 22, 2023
@jotaen4tinypilot jotaen4tinypilot deleted the dialog-buttons/1-no-close-while-load branch November 22, 2023 14:27
jotaen4tinypilot added a commit that referenced this pull request Nov 22, 2023
Related #1684. Stacked
onto #1687.

As discussed in tiny-pilot/tinypilot-pro#1139,
this PR consolidates the wording for “Cancel”/“Close”/“Back”/“OK”
buttons across all our dialogs, to only use “Close” or “Back”. It also
outlines the rules in the style guide.

- In the style guide, I restructured some of the existing text, to
accommodate the new rules in a clearer way.
- The code for the demo overlays has become borderline complex. To me,
it’s still okay-ish for now, but for the future we could consider to
simplify the setup, and make it more straightforward / less interactive.
- I didn’t change the `id` attributes or CSS class names of the affected
button elements, so their wording might now diverge from the label:
e.g., we have a button labelled `Close`, with a `cancel-hostname-change`
id attribute. To me, the UI label and the internal technical name are
conceptually different enough that it wouldn’t be worth the hassle to
keep them aligned, and we already diverge in other places anyway (e.g.,
we have a button [labelled `Paste`, with a `confirm-btn` id
attribute](https://github.com/tiny-pilot/tinypilot/blob/a1aa0249bc64c8dd1ee4c75e7ea0daa982bb2d22/app/templates/custom-elements/paste-dialog.html#L30);
or a button [labelled `Apply`, with a `save-btn` id
attribute](https://github.com/tiny-pilot/tinypilot/blob/a1aa0249bc64c8dd1ee4c75e7ea0daa982bb2d22/app/templates/custom-elements/video-settings-dialog.html#L190).)
- If we’d feel that it’s worth to unify all button labels with their
`id` attribute / CSS class name, I’d suggest to do that in a separate
refactoring step, and for all buttons in one go.


https://github.com/tiny-pilot/tinypilot/assets/83721279/e426c8db-b449-4e5f-968c-1d1bbcc129eb

~Currently blocked by
#1686 (e2e tests
failing).~

<a data-ca-tag
href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1688"><img
src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review
on CodeApprove" /></a>

---------

Co-authored-by: Jan Heuermann <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants