Skip to content

Commit b9f8117

Browse files
amitsingh-007claude
andcommitted
refactor: trim comments on behaviour changes
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 36f1ecb commit b9f8117

5 files changed

Lines changed: 5 additions & 23 deletions

File tree

apps/extension/src/constants/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,4 @@ export const MAX_PANEL_SIZE = {
1010

1111
export const TEST_AUTH_DATA_KEY = '__test_auth_data';
1212

13-
/** Extension popup entry route. Not in @bypass/shared: meaningless on web. */
1413
export const POPUP_HOMEPAGE = '/popup.html';

apps/extension/src/store/extension.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ interface State {
66
}
77

88
const 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 })),

apps/web/src/app/constants/routes.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
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. */
52
export const WEB_ROUTES = {
63
HOMEPAGE: '/',
74
BYPASS_LINKS_WEB: '/web-ext',

packages/shared/src/constants/routes.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
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-
*/
61
export const ROUTES = {
72
SHORTCUTS_PANEL: '/shortcuts-panel/',
83
BOOKMARK_PANEL: '/bookmark-panel/',

packages/shared/src/hooks/useIsMobile.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
import { 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
*/
168
const useIsMobile = () => !useMediaQuery('(min-width: 768px)', true);
179

0 commit comments

Comments
 (0)