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: Add a dev overlay #8757

Merged
merged 36 commits into from
Oct 25, 2023
Merged

feat: Add a dev overlay #8757

merged 36 commits into from
Oct 25, 2023

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Oct 5, 2023

Changes

This is the first draft of the dev overlay. Not everything is perfect, some parts of the code are quite noticeably incomplete, but, the basis of everything is there.

Testing

Will be done in a separate PR, since this is experimental and very early, that's okay!

Docs

withastro/docs#5183

@changeset-bot
Copy link

changeset-bot bot commented Oct 5, 2023

🦋 Changeset detected

Latest commit: 8f444a5

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added pkg: example Related to an example package (scope) pkg: astro Related to the core `astro` package (scope) labels Oct 5, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Oct 11, 2023

⚖️ Bundle Size Check

Latest commit: 8f444a5

File Old Size New Size Change
overlay 0 B 25.3 KB + 25.3 KB
plugins/astro 0 B 1.34 KB + 1.34 KB
plugins/audit 0 B 1.96 KB + 1.96 KB
plugins/utils/highlight 0 B 687 B + 687 B
plugins/xray 0 B 2.49 KB + 2.49 KB
ui-library/card 0 B 5.13 KB + 5.13 KB
ui-library/highlight 0 B 5.09 KB + 5.09 KB
ui-library/icons 0 B 3.66 KB + 3.66 KB
ui-library/tooltip 0 B 6.71 KB + 6.71 KB
ui-library/window 0 B 5.48 KB + 5.48 KB

@github-actions github-actions bot added the pr: docs A PR that includes documentation for review label Oct 19, 2023
@github-actions github-actions bot removed the pkg: example Related to an example package (scope) label Oct 23, 2023
@Princesseuh Princesseuh marked this pull request as ready for review October 24, 2023 21:41
Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

Code looks really good! Had a few comments and suggestions, but overall very excited for this!

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Leaving some feedback, but I think you said the aim is to ship and then iterate, so none of these likely need to be blockers, but sharing as I notice for you to tackle when the time is right.

The only things I’d like to see addressed before merging are the individual a11y comments. The bullets below are just general feedback.

Overall, so cool to see this coming together — really amazing work! 👏


  • First impressions: hey, look at that — so cute! ✨

    Initial state of dev overlay showing three icons: an Astro logo, a cursor arrow, and some kind of list + magnifying glass icon
  • At some point a down arrow appears. It wasn’t clear to me when/what interaction triggered this arrow:

    The Astro Dev Overlay with a circular button featuring a downward-pointing arrow to the right
  • Clicking the down arrow “hides” the overlay at the bottom of the page:

    A small rounded bevel showing above the bottom of the browser window

    I’m guessing this state hasn’t been designed yet? Once you get into this state it felt kind of weird to click on for me, because I still recognise it as the full dev overlay, just kind of oddly positioned, so it felt like I might be clicking on the actual buttons rather than bringing the overlay back.

  • Clicking the different buttons selects multiple where I expected them to toggle so one is active at a time (not sure if that assumption is correct, but especially when the Astro icon opens a panel, I expected clicking another button to close the panel):

    Astro dev overlay with two of the three buttons highlighted
  • Without docs or having read up about this yet, I don’t know what the cursor arrow and text search (?) icons mean. In the first site I’m trying this on (Starlight starter project) they appear to do nothing, so toggling them on/off feels kind of broken.

  • I then added an island to the page, which made the cursor arrow reveal the island and its props, which worked nicely 🎉

    Text on the page highlighted alongside a tooltip showing information about hydration directives and props passed

    Click-to-open also worked as expected 🙌

  • Read up some of the source code and noticed that the final icon is an “Audit” plugin, so tried adding an image with not alt tag to try it out.

    The red dot highlighting that issues exist is a great touch:

    icon for the audit tool with a red dot
  • On a narrow image the tooltip is pretty tiny, I guess we could afford to add a minimum width?

    Missing alt tag tooltip displayed very narrowly, fitting to the width of the longest word in the tooltip

Princesseuh and others added 2 commits October 25, 2023 12:15
@Princesseuh
Copy link
Member Author

At some point a down arrow appears. It wasn’t clear to me when/what interaction triggered this arrow

It appears on hover after a delay, the time after which is appear is currently mostly a randomly chosen number, probably that a shorter time would make it more clear (also not impossible that it's buggy and the timer refreshes sometimes?)

I’m guessing this state hasn’t been designed yet? Once you get into this state it felt kind of weird to click on for me, because I still recognise it as the full dev overlay, just kind of oddly positioned, so it felt like I might be clicking on the actual buttons rather than bringing the overlay back.

This is actually the only part of the overlay that matches the supplied design 100% 😅 I'll tell Mark that this felt unclear to you.

Clicking the different buttons selects multiple where I expected them to toggle so one is active at a time (not sure if that assumption is correct, but especially when the Astro icon opens a panel, I expected clicking another button to close the panel)

I'm still thinking the API on this, but essentially in the future I am planning for us to have a way for a plugin to mark itself as compatible with other plugins, that way it would be possible for an integration to add two plugins that works in tandem (and communicate between them, even)

Once that's implemented, all the plugins will be marked as being incompatible with each others by default, so only one of the built-ins will be able to be used at once

Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Since this will be the basis of blog post material, just had some thoughts for beefing up the changeset! See what you think!

.changeset/large-stingrays-fry.md Show resolved Hide resolved
.changeset/large-stingrays-fry.md Outdated Show resolved Hide resolved
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Looks good to me code-wise! Also played with it locally a bit and it looks great.

My only UX nit is that in a page without islands or a11y issue, when I click the "audit" or "xray" buttons, they didn't do anything and I was confused what their use are. The icons don't really tell much. Showing a tooltip of its use after a long hover over the button would be nice.

Copy link
Member

@natemoo-re natemoo-re left a comment

Choose a reason for hiding this comment

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

You addressed all my feedback, looks great! Excited to have this. 🎉

@Princesseuh
Copy link
Member Author

Looks good to me code-wise! Also played with it locally a bit and it looks great.

My only UX nit is that in a page without islands or a11y issue, when I click the "audit" or "xray" buttons, they didn't do anything and I was confused what their use are. The icons don't really tell much. Showing a tooltip of its use after a long hover over the button would be nice.

Yep, this is planned! Thank you for reviewing and trying it out.

Copy link
Member

@delucis delucis left a comment

Choose a reason for hiding this comment

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

Thanks for your responsiveness and all the great work @Princesseuh — look forward to trying this out more! 🎉

@Princesseuh Princesseuh merged commit e995867 into main Oct 25, 2023
15 checks passed
@Princesseuh Princesseuh deleted the feat/dev-overlay branch October 25, 2023 15:40
@astrobot-houston astrobot-houston mentioned this pull request Oct 25, 2023
natemoo-re added a commit that referenced this pull request Nov 22, 2023
* feat: initial commit for dev overlay

* fix: lockfile

* fix: build

* chore: get ci in a better state

* feat: client-server communication

* fix: better position for xray

* refactor: move icons to separate files

* refactor: cleanup components

* feat: home screen

* refactor: rename icon

* feat: flag the feature

* fix: cleanup

* fix: lockfile

* feat: minimize button

* Update packages/astro/src/@types/astro.ts

Co-authored-by: Sarah Rainsberger <[email protected]>

* refactor: cleanup

* feat: add ability to go to component for hydrated components

* refactor: consistent logic between audit and xray

* chore: changeset

* Apply suggestions from code review

Co-authored-by: Chris Swithinbank <[email protected]>
Co-authored-by: Nate Moore <[email protected]>

* fix: unchonky the SVGs

* fix: button a11y

* refactor: move common highlight utilities to a dedicated file

* fix: allow tabbing on highlights

* fix: allow tooltip clickable sections to be tabbed to

* feat: allow using defined icons as plugin icons

* refactor: remove unnecessary resolve

* Update .changeset/large-stingrays-fry.md

Co-authored-by: Sarah Rainsberger <[email protected]>

* Update .changeset/large-stingrays-fry.md

Co-authored-by: Sarah Rainsberger <[email protected]>

* nit: use append

* style: small tweaks to minimize button styling

---------

Co-authored-by: Sarah Rainsberger <[email protected]>
Co-authored-by: Chris Swithinbank <[email protected]>
Co-authored-by: Nate Moore <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope) pr: docs A PR that includes documentation for review semver: minor Change triggers a `minor` release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants