Skip to content

Conversation

@HiDeoo
Copy link
Member

@HiDeoo HiDeoo commented Jun 9, 2025

Description (required)

Why is this PR a draft? Due to the nature of the Starlight updates (cascade layers), there is a lot of potential for some undesired UI changes. I need to spend some time testing many pages and this PR could also be a really good candidate for a T&D review with many eyes on it.

This PR updates the documentation from Starlight 0.31.1 to Starlight 0.34.4.

This update is relatively heavy compared to some of the previous ones, as some important changes were made to Starlight in the meantime, included adding features that were previously only available in Astro Docs. Some of the most notable changes include:

Related issues & labels (optional)

  • Closes #
  • Suggested label: site improvement

Potential future improvements

  • Removing src/components/Button.astro and use Starlight link buttons
    • Feels like this can wait a follow-up PR to keep things easier to review.

Remaining tasks

  • Remove visual diffing tool
  • Lunaria directives for the changes to src/content/i18n/

@netlify
Copy link

netlify bot commented Jun 9, 2025

Deploy Preview for astro-docs-2 ready!

Name Link
🔨 Latest commit d75c1e3
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/685d1430e4f1d2000827e527
😎 Deploy Preview https://deploy-preview-11870--astro-docs-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions bot added the i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! label Jun 9, 2025
@astrobot-houston
Copy link
Contributor

astrobot-houston commented Jun 9, 2025

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
src/content/i18n/ar.yml Localization changed, will be marked as complete.
src/content/i18n/de.yml Localization changed, will be marked as complete.
src/content/i18n/en.yml Source changed, localizations will be marked as outdated.
src/content/i18n/es.yml Localization changed, will be marked as complete.
src/content/i18n/fr.yml Localization changed, will be marked as complete.
src/content/i18n/hi.yml Localization changed, will be marked as complete.
src/content/i18n/it.yml Localization changed, will be marked as complete.
src/content/i18n/ja.yml Localization changed, will be marked as complete.
src/content/i18n/ko.yml Localization changed, will be marked as complete.
src/content/i18n/pl.yml Localization changed, will be marked as complete.
src/content/i18n/pt-BR.yml Localization changed, will be marked as complete.
src/content/i18n/ru.yml Localization changed, will be marked as complete.
src/content/i18n/zh-CN.yml Localization changed, will be marked as complete.
src/content/i18n/zh-TW.yml Localization changed, will be marked as complete.
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@HiDeoo HiDeoo added the site improvement Some thing that improves the website functionality - ask @delucis for help! label Jun 9, 2025
@ArmandPhilippot
Copy link
Member

ArmandPhilippot commented Jun 12, 2025

I noticed some small differences on the homepage, using Firefox on Linux.

There are slight spacing differences (not a big deal I think) in the:

  • Join our Discord button
  • Learn Astro banner (both the spacing between the two lines of text and the button)

And, in 810x1080, look at the height of the cards icons:

Before After
Screenshot of the icons in Astro homepage in the live docs Screenshot of the icons in Astro homepage in the preview docs

@yanthomasdev
Copy link
Member

We can handle the Lunaria stuff by adding:

@lunaria-ignore:src/content/i18n/*.yml

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 13, 2025

Thanks for the reports @ArmandPhilippot 🙌

I noticed some small differences on the homepage, using Firefox on Linux.

There are slight spacing differences (not a big deal I think) in the:

  • Join our Discord button
  • Learn Astro banner (both the spacing between the two lines of text and the button)

Interesting, this does not happen in Chrome, but I found why this happens:

  • The "Join our Discord" Houston image is given a .hide class.
  • This class applies an height: 5rem.
  • What happens:
    • Current version: This height is overriden by Starlight to auto and is inferred to 80.2667px in Firefox.
    • New version: This height is not overriden by Starlight, authored styles win and the image is properly sized to 5rem (80px).

This float seems to slightly offset things rendered after the image causing the slight changes you noticed in the "Learn Astro" ad too. Enforcing a height of 5rem in the live version in the devtools and comparing it again the new version shows that they are identical at this point.

In this case, I think we can conclude that the new version is actually correct and we use the authored height of 5rem, and also avoid these floating numbers.

And, in 810x1080, look at the height of the cards icons:

I've opened withastro/starlight#3248 to fix the issue in Starlight itself.

@ArmandPhilippot
Copy link
Member

Nice finding! Houston is so powerful that he can move things from a distance. 😆
I agree with your conclusion!

I noticed two other things, still on Linux.

Using Firefox in 810x1080, the search box in the header is shorter. Here's a short video showing the preview (first) vs the live docs:

astro-docs-search-width.webm

This doesn't seem to be the case on Chromium though!

And conversely, using Chromium in 1180x820, I noticed the text baseline doesn't seem the same in various places (header, sidebar, page title, ad). Here's a short video showing the preview (first) vs the live docs:

astro-docs-text-alignment.webm

But this doesn't seem to be the case on Firefox. 😅

I haven't been able to identify what's different in both cases...

  • I don't think the shorter search box is important
  • The text alignment in Chromium seems better in the live docs (if you check the selects in the header: the text seems higher than the icon). I can reproduce that using different resolutions in landscape mode... but only with Chromium's dev tools. I tried on a tablet with both Firefox and Chrome, and I don't see this issue. 👀 So maybe this can be ignored unless someone else can reproduce this?

So, after your fix in Starlight, I think everything looks fine. Great job, again! 🙌🏽

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 13, 2025

Intriguing 🤔 I was not able to reproduce both of the issues in both Chrome or Firefox.

I'll try on a Windows machine when I can get access to one, maybe it's not visible on macOS due to Retina resolution or something like that.

In the meantime, I'm also setting up in this branch the visual diffing tool we used when introducing cascade layers in Starlight, should be easier to spot tiny differences that can easily be missed by eye.

@ArmandPhilippot
Copy link
Member

Oh, the search box shift doesn't seem to happen on all the pages! This happens on Install Astro and Develop and build. However, Why Astro and Project Structure seems fine! So maybe you tried on a different page than the video?

And that explains why I couldn't get a reproduction yesterday... I had noticed that in T&D but I must have been on another page while writing my initial comment because I couldn't reproduce that anymore so I skipped it...

It seems to happen only between 800 and 812... 👀

I tried to check on my tablet but the viewport size is not the same so everything is fine there.

However, I noticed another strange thing: in portrait mode on my tablet, the preview appears as in mobile view (ie. hamburger menu) while the live docs appears with the sidebar visible. 😅 I don't get why I get a different view... But, it doesn't seem related to your PR! I tried a deploy preview on another PR and I have the same thing.
So, to be sure (ie. it could be another CSS difference related to deploy previews), I checked the search box and text alignment changes, they only appear in this deploy preview.

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 13, 2025

Oh, the search box shift doesn't seem to happen on all the pages! This happens on Install Astro and Develop and build. However, Why Astro and Project Structure seems fine! So maybe you tried on a different page than the video?

Funny thing, as I could not reproduce, I actually checked which page you were on in the video you shared and tested on the same page 😅 I hope me testing on a non-apple device will share more insight into the issue.

@HiDeoo HiDeoo changed the title Update to Starlight 0.34.3 Update to Starlight 0.34.4 Jun 13, 2025
@ArmandPhilippot
Copy link
Member

ArmandPhilippot commented Jun 18, 2025

I tried to investigate a bit more about those two issues. I have a new build and a fresh install of Windows 11 and Linux, so I tried to see if I was able to reproduce them.

I think I solved the Firefox mystery! I was surprised because the Install page is now fine on my side, but I still see the shorter searchbox on some pages... 😅 The pages where the search box seems longer on live docs have a slight horizontal overflow because of headings links (what I was describing on Discord during T&D):

astro-docs-overflow

So the live version is wrong, and your PR fixes that as well!

However, regarding the text alignment issue:

  • on Windows, I can't reproduce it (using Edge instead of Chromium)
  • on Linux (I'm now on EndeavourOS instead of Manjaro, another Arch-based distro), I still see the text alignment shift between the live docs and the preview in Chromium (v137.0.7151.103)

So maybe this is one is Linux-only or at least Arch-based only?

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 18, 2025

As brilliantly suggested by Chris, I ported the visual diffing tool we used in Starlight when implementing cascade layers and used it to compare the local version of this branch with the live version of the docs.

I temporarily pushed the tool to this branch too in case anyone wants to try it out (pnpm visual-diff to run it and for pages with differences, the diff screenshots are available in the visual-diff/screenshots/diff/ directory. Note that's it's not a lightweight tool, so it might take a while to run depending on your machine).

Here are the results of the visual diffing:

/en/getting-started/

The only differences are all related to an authored image height not being used in the live version (overriden by Starlight) but used in the preview version using cascade layers.

As I mentioned in the linked comment, the preview version is the correct one in this case.

Click to see the visual diff

en-getting-started

/en/reference/error-reference/ and /en/reference/errors/cannot-load-font-provider/

The only differences are visible when comparing the live version with a local development version due to the <DontEditWarning> component being rendered in the dev version but not in the live version. Either commenting out the <DontEditWarning> component in the dev version or testing against a production build of the docs will show no differences.

Click to see the visual diff

en-reference-error-reference

en-reference-errors-cannot-load-font-provider

/en/guides/deploy/ and /en/tutorial/1-setup/1/

The only differences are related to a change in Starlight 0.33.0 which is actually a bug fix.

The live version is wrong in this case.

Click to see the visual diff

en-guides-deploy

en-tutorial-1-setup-1

Pages with no differences

  • /en/install-and-setup/
  • /en/concepts/islands/
  • /en/guides/migrate-to-astro/from-docusaurus/
  • /en/guides/routing/
  • /en/guides/fonts/
  • /en/guides/upgrade-to/v5/
  • /en/reference/modules/astro-actions/
  • /en/reference/content-loader-reference/
  • /en/guides/integrations-guide/
  • /en/guides/backend/
  • /en/tutorial/0-introduction/
  • /en/tutorial/0-introduction/1/
  • /en/tutorial/6-islands/3/

If you also think of other pages that should be tested, please let me know.

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 18, 2025

So the live version is wrong, and your PR fixes that as well!

That's quite the investigation and good news 🕵️ Thanks a lot @ArmandPhilippot

So maybe this is one is Linux-only or at least Arch-based only?

Interesting, would you be able to provide 4 extra screenshots?

  1. Two screenshots where you can notice such difference, one from the live version and one from the PR version (ideally with the same scroll position).
  2. For both versions, a screenshot of the dev tools with the computed styles and rendered font for an identical node that have differences in the two versions.

To get the the computed styles and rendered font visible, if needed, here is a screenshot with numbered steps:

image

@ArmandPhilippot
Copy link
Member

ArmandPhilippot commented Jun 18, 2025

Thanks for the steps, really helpful (I don't use Chromium often)!

With the page title selected since it seems different between the two:

Live Preview
Website docs astro build_en_develop-and-build_(iPad Air) deploy-preview-11870--astro-docs-2 netlify app_en_develop-and-build_(iPad Air)
Devtools docs astro build_en_develop-and-build_(iPad Air)-dev-tools deploy-preview-11870--astro-docs-2 netlify app_en_develop-and-build_(iPad Air)-dev-tools

(the screenshots should be the same sizes if you open them in full screen, in another tab)

I also checked the values for:

@media (min-width: 50em) {
    :root {
        --sl-nav-height: 4rem;
        --sl-nav-pad-x: 1.5rem;
        --sl-text-h1: var(--sl-text-5xl);
        --sl-text-h2: var(--sl-text-4xl);
        --sl-text-h3: var(--sl-text-3xl);
        --sl-text-h4: var(--sl-text-2xl);
    }
}

Everything looks the same... except the rendering.

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 18, 2025

I just installed EndeavourOS in a virtual machine, with xfce4 as the desktop environment based on your screenshots (not entirely sure about the guess but should not matter hopefully), installed Chromium using sudo pacman -S chromium (this ended up installing version 137.0.7151.119), and I still did not manage to reproduce the issue 😭

Live Preview
live preview

I guess the fact that I was in a virtual machine, or using a slightly different versions of Chromium, or maybe it's something else entirely, can still play a role in this. I'll see if I can think of any other way to reproduce the issue.

@ArmandPhilippot
Copy link
Member

You guessed correctly it's XFCE, sorry I didn't think of precising the DE! I upgraded my packages to have the same version of Chromium and it still there.

However, looking at your screenshots, have you only tested in full desktop view (ie. without responsive tools opened)? In my tests:

  • It wasn't reproducible in a normal full desktop view
  • I only noticed that while trying to reproduce the search box issue in another browser, and so, each time, I was in responsive mode
  • I mostly tried using whether 1180x820 or 820x1180... (Ipad Air) but I noticed that too with other widths.
  • This was reproducible with dev tools attached to the right or unattached

I just tried to resize the window instead (by superposing the live and preview websites and using alt+tab) and I don't see any shift or misaligned text!

So, it seems this is only reproducible with dev tools opened (at least on my side 😅 )! If that's the case, maybe it's not important after all? (and sorry that you spent time on this...)

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 19, 2025

Ok, spent a bit more time on this and I think I may have found a set of steps not involving the preview branch at all, which I think would show that this may be a Chrome/Linux/EndeavourOS or w/e issue:

  1. Visit any webpage
  2. Open the DevTools
  3. Configure the DevTools so that it's docked to the right side of the window if it's not already the case
  4. Open the Device Toolbar/Responsive Design Mode
  5. With dimensions set to Responsive, set the width to 820 and the height to whatever you want
  6. Close the DevTools
  7. Navigate to https://docs.astro.build/en/develop-and-build/
  8. Open the DevTools again (which will show exactly has it was before, docked to the right side of the window and with the Device Toolbar open at a width of 820px)
  9. Take a really good look at the "Auto" and "English" text at the top right of the page
  10. Reload the page by pressing Ctrl+R

The text we were focusing on (and all other text basically) should have shifted slightly. Could you confirm this behavior on your end?

@ArmandPhilippot
Copy link
Member

Amazing! 🙌🏽 Yeah, I can totally reproduce that on the live site with your steps!

I think I identified simpler steps:

  1. Open the website, navigate to any page (e.g. Develop and build), open the dev tools (I'm not sure you need a specific width, I'm currently at 1180px).
  2. In another tab, once on docs.astro.build, open the dev tools then navigate to that same page.
  3. You should be able to see the text shift between the two tabs!

The only difference is WHEN I opened the dev tools: before or after navigating to a page.

But the why remains a mystery to me... I tried to reproduce the same steps on other websites and I can't see any difference between the tabs. Even on Starlight. But looking at Astro Docs vs Starlight:

Astro Docs before shift Astro Docs after shift Starlight
docs astro build-before-shift docs astro build-after-shift starlight astro build

By focusing only on the header, where the content is the same, Starlight alignment matches the one after the shift on Astro Docs. So, I guess the "bug" is the state before opening the dev tools... and then it gets fixed!? This is really weird. 😅

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 19, 2025

From the limited investigation I made by simplifying the DOM to the point where I only add 1 text node and a very few CSS rules applied, this may be a Linux-only (no idea if the distribution or desktop environment matters), Chrome-only, Devtools-only, Responsive-mode-only issue related to antialiasing.

Small additional question: for the Starlight docs screenshot, is that in a fresh tab? I was only able to repoduce it on the Starlight docs after doing all the shenanigans of opening the devtools and refreshing the page. Otherwise, it looks normal for me.

@ArmandPhilippot
Copy link
Member

Yes, in a new tab and from the moment I open the dev tools on a page (without navigating anywhere after that, unlike Astro Docs). But the alignment seems fine if I resize the windows instead of using dev tools!

@HiDeoo
Copy link
Member Author

HiDeoo commented Jun 19, 2025

Yes, in a new tab and from the moment I open the dev tools on a page (without navigating anywhere after that, unlike Astro Docs). But the alignment seems fine if I resize the windows instead of using dev tools!

Ok, yeah, so it's fine without opening the devtools, that's what I wanted to make sure, thanks for the clarification 👍

@HiDeoo HiDeoo marked this pull request as ready for review June 26, 2025 09:42
@JusticeMatthew
Copy link
Contributor

Tested a few pages in Edge (someone had to do it)

Everything seems to appear and function normally from some random clicking around

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.

Confirmed confetti in the tutorial on Talking and Doc'ing! 🫡

@louisescher
Copy link
Member

Went through the entire blog tutorial on Zen (Firefox) and it looks fine!

Copy link
Member

@ArmandPhilippot ArmandPhilippot left a comment

Choose a reason for hiding this comment

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

I didn't noticed any other differences! So, LGTM! Good job! 🚀

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.

Looks great! Thanks for taking all the care taken here and shout out to @ArmandPhilippot for battle testing the tiniest of differences 🚀

@HiDeoo HiDeoo merged commit 336ab11 into withastro:main Jun 26, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n Anything to do with internationalization & translation efforts - ask @YanThomas for help! site improvement Some thing that improves the website functionality - ask @delucis for help!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants