ui: replace native theme select with custom floating dropdown#32148
Open
owaiss0 wants to merge 1 commit into
Open
ui: replace native theme select with custom floating dropdown#32148owaiss0 wants to merge 1 commit into
owaiss0 wants to merge 1 commit into
Conversation
Contributor
Review
Fix in your agentFix the following review findings in PR #32148 (https://github.com/cloudflare/cloudflare-docs/pull/32148).
Before making changes, review each finding and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g. the fix requires disproportionate effort for minimal benefit,
or the finding is factually incorrect), explain why
- If you need clarification before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order
After triaging, fix all legitimate findings. For any you decide to skip,
post a comment on this PR with the finding ID and your reasoning.
---
## Code Review
### Warnings (1)
#### CR-e807837aec21 · Missing accessibility UI update on initial theme apply
- **File:** `src/components/overrides/ThemeSelect.astro` line 357
- **Issue:** `applyTheme` only updates the custom picker through `updateAllThemePickers` when `StarlightThemeProvider` is absent. When the provider exists and is still unwrapped during the first `connectedCallback`, it calls the provider's `updatePickers` but never calls `this.updateUI(theme)`, leaving the active option's `aria-selected="false" even though it is visually checked.
- **Fix:** Call `this.updateUI(theme)` at the end of `applyTheme` so the custom dropdown's icon, label, checkmark, and `aria-selected` state always reflect the applied theme.
Code ReviewThis code review is in beta and may not always be helpful — use your judgment. Warnings (1)
ConventionsNo convention issues found. Style Guide ReviewNo style-guide issues found. CommandsOnly codeowners can run commands. Post a comment with the command to trigger it.
|
owaiss0
force-pushed
the
feat/theme-dropdown-ui
branch
4 times, most recently
from
July 20, 2026 05:40
8e427bb to
e25fb86
Compare
owaiss0
force-pushed
the
feat/theme-dropdown-ui
branch
from
July 20, 2026 05:46
e25fb86 to
aecff9f
Compare
owaiss0
force-pushed
the
feat/theme-dropdown-ui
branch
from
July 20, 2026 05:54
aecff9f to
434c5ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces the browser-native
<select>element for theme switching with a custom floating popover dropdown UI. This update aligns the theme selector's aesthetics with the Cloudflare developers' design system and enhances interactive feedback.🔍 Before vs After
1. Desktop Theme Selector
<select>with a custom floating popover menu featuring active checkmark selection indicators.PiCaretDownBoldcaret matching the size and weight of other header dropdowns.2. Mobile Theme Selector
bottom: 100%) on mobile viewports using CSS layout rules to prevent clipping, and automatically closes on page scroll.🛠️ Technical Details
localStorageand immediately toggle the active icons/text, querying all instances in the DOM to support multi-picker layouts.Home/End, andEscape.focusoutlistener.localStoragelookups to a module-level helper, ensuring the globalStarlightThemeProviderwrapper does not capture the Custom Element instance in its closure.uniqueId) for allid,aria-controls, andaria-labelledbyattributes.localStorageinteractions are guarded withtry/catchblocks for incognito/private browsing mode safety.Documentation checklist