Restore the invitations tab, render library tracks on first paint and re-measure the tab indicator
CI/CD / BackEnd (push) Successful in 1m45s
CI/CD / WebPlayer (push) Successful in 52s
CI/CD / Deploy (push) Skipped

This commit is contained in:
2026-09-25 02:40:50 +02:00
parent 76b62ec384
commit a081b85efc
3 changed files with 22 additions and 2 deletions
@@ -57,6 +57,8 @@
(track) => track.id
);
untrack(() => list.reset(tracks));
let search = $state('');
let selectedIds = $state<string[]>([]);
let pendingDelete = $state<LibraryTrack[]>([]);
@@ -21,16 +21,29 @@
const activeHref = $derived(tabs.find((tab) => tab.active)?.href);
$effect(() => {
let nav = $state<HTMLElement>();
function measure() {
const link = activeHref ? links[activeHref] : undefined;
if (!link) return;
if (!link || link.offsetWidth === 0) return;
indicator = { x: link.offsetLeft, width: link.offsetWidth };
measured = true;
if (!animated) requestAnimationFrame(() => (animated = true));
}
$effect(measure);
$effect(() => {
if (!nav) return;
const observer = new ResizeObserver(() => measure());
observer.observe(nav);
for (const link of Object.values(links)) if (link) observer.observe(link);
return () => observer.disconnect();
});
</script>
<nav
bind:this={nav}
aria-label={label}
class="relative inline-flex max-w-full rounded-full bg-surface-2 p-1 {klass}"
>