File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,5 +10,4 @@ export const MAX_PANEL_SIZE = {
1010
1111export const TEST_AUTH_DATA_KEY = '__test_auth_data' ;
1212
13- /** Extension popup entry route. Not in @bypass/shared: meaningless on web. */
1413export const POPUP_HOMEPAGE = '/popup.html' ;
Original file line number Diff line number Diff line change @@ -6,8 +6,7 @@ interface State {
66}
77
88const useExtStore = create < State > ( ) ( ( set ) => ( {
9- // Defaults to true: Authenticate reads this on mount and would auto-sign-out
10- // if it started false while storage is still resolving
9+ // Must default true: Authenticate would auto-sign-out while storage resolves
1110 isExtensionActive : true ,
1211 setIsExtensionActive : ( isExtensionActive : boolean ) =>
1312 set ( ( ) => ( { isExtensionActive } ) ) ,
Original file line number Diff line number Diff line change 1- /**
2- * Web-app-only routes. Named distinctly from `ROUTES` in @bypass/shared so an
3- * auto-import cannot silently swap one for the other.
4- */
1+ /** Named distinctly from `ROUTES` in @bypass/shared to avoid a wrong auto-import. */
52export const WEB_ROUTES = {
63 HOMEPAGE : '/' ,
74 BYPASS_LINKS_WEB : '/web-ext' ,
Original file line number Diff line number Diff line change 1- /**
2- * Panel routes shared by the extension popup and the web app. The extension's
3- * own entry route lives in the extension (POPUP_HOMEPAGE) since '/popup.html'
4- * is meaningless on web.
5- */
61export const ROUTES = {
72 SHORTCUTS_PANEL : '/shortcuts-panel/' ,
83 BOOKMARK_PANEL : '/bookmark-panel/' ,
Original file line number Diff line number Diff line change 11import { useMediaQuery } from '@mantine/hooks' ;
22
33/**
4- * Viewport width check, not a platform check.
5- *
6- * The `true` initial value is load-bearing. Mantine defaults to
7- * `getInitialValueInEffect: true` and returns `matches || false`, so with no
8- * initial value the first render reports "not desktop" everywhere — including
9- * the 800px-wide extension popup — making every consumer paint a mobile layout
10- * for one frame before correcting. Passing `false` would be a no-op for the
11- * same reason; `true` is what makes first paint match steady state on desktop.
12- *
13- * Deliberately not using `getInitialValueInEffect: false`, which reads
14- * window.matchMedia during render and risks a Next.js hydration mismatch.
4+ * The `true` initial value is load-bearing: Mantine returns `matches || false`
5+ * before its effect runs, so without it every first paint reports mobile.
6+ * Passing `false` is a no-op for the same reason.
157 */
168const useIsMobile = ( ) => ! useMediaQuery ( '(min-width: 768px)' , true ) ;
179
You can’t perform that action at this time.
0 commit comments