Skip to content

repo-header-info - Avoid duplicates, empty space - #9823

Merged
fregante merged 6 commits into
mainfrom
repo-header-info-svelte
Jul 13, 2026
Merged

fregante merged 6 commits into
mainfrom
repo-header-info-svelte

Conversation

@fregante fregante changed the title repo-header-info svelte repo-header-info - Rewrite and cleanup Jul 13, 2026
@fregante fregante changed the title repo-header-info - Rewrite and cleanup repo-header-info - Avoid duplicates, empty space Jul 13, 2026

const {info}: {info: RepositoryInfo} = $props();
</script>
<!-- Order set because React rebuilds both breadcrumbs on resize, leaving this as the first child -->

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

  1. load on wide window
  2. resize to mobile
  3. resize to wide

React will have removed the original li that we observed and appended our widget to. Then new ones were created, observe found them and appended a new widget.

I changed the observer to look at the ol container, which stays still, but React will still append the li, leaving our widget as the first child 😮‍💨

Image

li:last-child:not(.rgh-repo-header-info-updated) {
nav[data-component='Breadcrumbs']
ol:not(.rgh-repo-header-info-updated)
li:last-child {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@fregante

Copy link
Copy Markdown
Member Author

For once a Svelte rewrite (and cleanup) brings a negative diff

Screenshot

but still bundle size increase (1.8KB)

Screenshot 3

@fregante
fregante merged commit cb68dd8 into main Jul 13, 2026
14 checks passed
@fregante
fregante deleted the repo-header-info-svelte branch July 13, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

repo-header-info occasionally fails to load, leaving blank behind

1 participant