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

chore(www): upgrade servers-view to Lit #1941

Merged
merged 9 commits into from
Apr 8, 2024
Merged

Conversation

sbruens
Copy link
Contributor

@sbruens sbruens commented Apr 1, 2024

No description provided.

@github-actions github-actions bot added the size/M label Apr 1, 2024
@sbruens sbruens marked this pull request as ready for review April 1, 2024 14:14
@sbruens sbruens requested a review from a team as a code owner April 1, 2024 14:14
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 47.82609% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 32%. Comparing base (41a9721) to head (1ca893a).
Report is 4 commits behind head on master.

❗ Current head 1ca893a differs from pull request most recent head be96024. Consider uploading reports for the commit be96024 to get more accurate results

Files Patch % Lines
src/www/views/servers_view/index.ts 50% 11 Missing ⚠️
src/www/app/app.ts 0% 1 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1941   +/-   ##
======================================
  Coverage      32%     32%           
======================================
  Files          45      45           
  Lines        2620    2646   +26     
  Branches      340     347    +7     
======================================
+ Hits          860     873   +13     
- Misses       1760    1773   +13     
Flag Coverage Δ
apple 15% <ø> (ø)
ios ?
maccatalyst 15% <ø> (ø)
macos 15% <ø> (ø)
unittests 32% <47%> (+<1%) ⬆️
www 40% <47%> (+<1%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fortuna fortuna removed the request for review from a team April 1, 2024 14:57
src/www/views/servers_view/index.ts Outdated Show resolved Hide resolved
src/www/views/servers_view/index.ts Outdated Show resolved Hide resolved
src/www/views/servers_view/index.ts Outdated Show resolved Hide resolved
src/www/views/servers_view/index.ts Outdated Show resolved Hide resolved
src/www/views/servers_view/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@daniellacosse daniellacosse left a comment

Choose a reason for hiding this comment

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

more thoughts than anything, looks good

render() {
if (this.shouldShowZeroState) {
return html`
<button type="button" @click=${this.requestPromptAddServer}>
Copy link
Contributor

Choose a reason for hiding this comment

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

you only really need type="button" in a form afaik

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe it's the opposite actually. TIL a missing type means type="submit", which is meant for form submission. See https://html.spec.whatwg.org/multipage/form-elements.html#the-button-element.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, but we aren't in a form context. It is technically correct I just don't do this usually cuz it reads weird. I'm ambivalent.

<button type="button" @click=${this.requestPromptAddServer}>
<server-connection-indicator connection-state="disconnected"></server-connection-indicator>
<header>
<h1>${this.localize('server-add')}</h1>
Copy link
Contributor

Choose a reason for hiding this comment

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

h1 should probably be the root "outline" header, maybe? so that would make this h2/h3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<h1> here is used explicitly in the context of <header> that's heading sectioned content. It would be odd to have the first h* element inside <header> be <h2>. Although as I write this, I realize I'm actually missing a sectioning element here. Added that.

Copy link
Contributor

Choose a reason for hiding this comment

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

https://moz.com/learn/seo/h1-tags#:~:text=H1%20tags%20are%20used%20to,prominent%20heading%20on%20the%20page.

"H1 tags are used to indicate the primary topic of your webpage to visitors and search engines." However, we don't really care about SEO here, so I'm ambivalent.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The primary topic of this page is not "Outline" though, it doesn't help accessibility because all pages would be the same. The "Add server" is the appropriate (though clunky) topic of the page, even setting aside that you can have multiple section headers. The source you link gives a good example and also admits it further down:

Can a page have multiple H1 tags?
[...] In some circumstances, where a page truly covers multiple high-level topics, multiple H1s can be used. Google’s John Muller has stated that it will not penalize pages with multiple H1 tags. [...]

The only argument I could see is that "Add server" shouldn't be a header at all, but just regular content, in which case we should revert to a text node or <p> element. Maybe "Servers" should be the appropriate heading for both the server list and the empty state?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that "Servers" is a better H1, yeah.

src/www/views/servers_view/index.ts Outdated Show resolved Hide resolved
@sbruens sbruens merged commit 8c5916e into master Apr 8, 2024
19 checks passed
@sbruens sbruens deleted the sbruens/servers-lit branch April 8, 2024 12:55
daniellacosse pushed a commit that referenced this pull request Apr 10, 2024
* chore(www): upgrade `servers-view` to Lit

* Remove use of `paper-button` from `servers-view`.

* Use semantic elements for header and footer.

* Use `<button>` element.

* Change `line-height` values.

* Rename `useAltAccessMessage` to `shouldShowAccessKeyWikiLink`.

* Hoist `<user-coms-dialog>` to the root element.

* Remove unused import.

* Add a section element.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants