Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions apps/landing/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,25 @@ const installSteps = [
document.documentElement.classList.add("js-enabled");

const canAnimate = !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
let scrollbarIdleTimer = 0;

function showScrollbarsBriefly() {
document.documentElement.classList.add("scrollbars-active");
window.clearTimeout(scrollbarIdleTimer);
scrollbarIdleTimer = window.setTimeout(() => {
document.documentElement.classList.remove("scrollbars-active");
}, 900);
}

window.addEventListener("scroll", showScrollbarsBriefly, { passive: true });
window.addEventListener("wheel", showScrollbarsBriefly, { passive: true });
window.addEventListener("touchmove", showScrollbarsBriefly, { passive: true });
window.addEventListener("pointerdown", showScrollbarsBriefly);
window.addEventListener("keydown", (event: KeyboardEvent) => {
if (["ArrowDown", "ArrowUp", "End", "Home", "PageDown", "PageUp", "Space"].includes(event.code)) {
showScrollbarsBriefly();
}
});
Comment on lines +425 to +429
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Anonymous keydown handler cannot be removed

The anonymous arrow function passed to window.addEventListener("keydown", ...) has no stored reference, so it cannot be passed to removeEventListener later. The other four listeners all use the named showScrollbarsBriefly reference and can be cleaned up. If Astro View Transitions are ever added to this page, navigating back and forth would stack up duplicate keydown listeners on window, causing the scrollbar to re-appear multiple times per keypress. Extracting the arrow function into a named handler (or the same showScrollbarsBriefly with a guard, since all the listed keys trigger page scrolling anyway) would make cleanup straightforward.

Fix in Codex


const agentTabsRoot = document.querySelector<HTMLElement>("[data-agent-tabs]");
const agentTablist = document.querySelector<HTMLElement>("[data-agent-tablist]");
Expand Down
33 changes: 33 additions & 0 deletions apps/landing/src/styles/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,43 @@
--ease-out: cubic-bezier(0.25, 1, 0.5, 1);
--ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
--content: min(1180px, calc(100vw - 32px));
--scrollbar-thumb: transparent;
--scrollbar-thumb-active: oklch(51% 0.045 100 / 0.42);
--scrollbar-thumb-hover: oklch(43% 0.05 100 / 0.56);
--scrollbar-track: transparent;
}

* {
box-sizing: border-box;
scrollbar-width: thin;
scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

html.scrollbars-active,
:where(.agent-setup-panel, .agent-setup-panel pre):hover,
:where(.agent-setup-panel, .agent-setup-panel pre):focus-within {
--scrollbar-thumb: var(--scrollbar-thumb-active);
}
Comment on lines +54 to +58
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Redundant :where(.agent-setup-panel pre) in hover/focus selector

In CSS, :hover on a child element propagates up the ancestor chain, so hovering .agent-setup-panel pre also triggers :hover on the parent .agent-setup-panel. The --scrollbar-thumb variable then inherits down to the pre, making the :where(.agent-setup-panel pre):hover and :where(.agent-setup-panel pre):focus-within selectors unreachable in any meaningful way that the .agent-setup-panel variants don't already cover. The rule could be simplified to just :where(.agent-setup-panel):hover and :where(.agent-setup-panel):focus-within.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Codex


::-webkit-scrollbar {
width: 10px;
height: 10px;
}

::-webkit-scrollbar-track {
background: var(--scrollbar-track);
}

::-webkit-scrollbar-thumb {
border: 3px solid transparent;
border-radius: 999px;
background: var(--scrollbar-thumb);
background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
background: var(--scrollbar-thumb-hover);
background-clip: padding-box;
}

html {
Expand Down