fix: restore share page navigation and dark theme - #2261
Open
pavzagor wants to merge 1 commit into
Open
Conversation
Comment on lines
+7
to
+19
| useEffect(() => { | ||
| const preference = window.matchMedia("(prefers-color-scheme: dark)"); | ||
| const applyTheme = () => { | ||
| const savedTheme = Cookies.get("theme"); | ||
| const theme = | ||
| savedTheme === "dark" || savedTheme === "light" | ||
| ? savedTheme | ||
| : preference.matches | ||
| ? "dark" | ||
| : "light"; | ||
| document.body.classList.remove("light", "dark"); | ||
| document.body.classList.add(theme); | ||
| }; |
Contributor
There was a problem hiding this comment.
Theme flashes during navigation
When navigating from the dashboard to a share page, the dashboard cleanup resets the body to light. This component restores the saved dark theme only in a passive effect after the destination renders, so the share page can briefly appear in light mode before switching to dark.
Knowledge Base Used:
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/app/s/ShareTheme.tsx
Line: 7-19
Comment:
**Theme flashes during navigation**
When navigating from the dashboard to a share page, the dashboard cleanup resets the body to light. This component restores the saved dark theme only in a passive effect after the destination renders, so the share page can briefly appear in light mode before switching to dark.
**Knowledge Base Used:**
- [Web product and collaborative workspace](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/web-product.md)
- [Web application routes and components](https://app.greptile.com/cap/-/custom-context/knowledge-base/capsoftware/cap/-/docs/web-application-routes.md)
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Member
|
Hey @pavzagor thanks so much! can you get this to 5/5? you can request from greptile in the comments |
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.
Opening a shared video could reset a saved dark theme to light and leave the return-to-dashboard action hidden inside Manage Cap. This adds a visible My Caps link in both player and timeline views and keeps share pages consistent with the viewer's theme.
The share route now restores the theme on direct loads and client navigation, honors an explicit light/dark preference, and falls back to the system theme when none is saved. Fixed white panels and fixed gray text use theme-aware colors. The mobile return control has a 44 × 44 px minimum target. Signed-out viewers retain the existing navigation.
Validation
noImgElementwarning inTimelineHoverGhost.tsx; diff whitespace check passes.Evidence
Captured against the real local app with the synthetic Diarization Tester account and its existing test recording. Local media storage on port 9000 was unavailable, so the player displays an error in both versions. This validates navigation and appearance, not successful playback or production delivery.
Mobile before · Mobile after
The videos contain actual browser frames sampled at approximately 4 fps and encoded at 30 fps; idle gaps are shortened. They are not continuous 30 fps screen recordings. Evidence is committed with this change so the links remain tied to the reviewed commit.
The PR appears safe to merge, with a non-blocking theme flash remaining during dashboard-to-share client navigation.
Findings
Prompt To Fix All With AI
Summary