Skip to content

Commit b1709a2

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

6 files changed

Lines changed: 3 additions & 21 deletions

File tree

apps/extension/src/entrypoints/popup/panels/PersonsPanel/components/PersonsPanel.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ function PersonsPanel() {
150150
persons={filteredAndOrderedPersons}
151151
bookmarkListProps={{
152152
fullscreen: true,
153-
// The edit route is the extension's concern, so it is supplied
154-
// here rather than hardcoded inside the shared component
155153
onBookmarkEdit: ({ url, parentId }) => {
156154
navigate(
157155
getBookmarksPanelUrl({

apps/extension/src/entrypoints/popup/provider/DynamicProvider.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ function DynamicProvider({ children }: PropsWithChildren) {
2525
set: setToChromeStorage,
2626
},
2727
tabs: {
28-
// Arming the watcher before opening is the invariant this seam exists
29-
// to enforce; startHistoryMonitor is idempotent so looping callers can
30-
// call this per url
28+
// Idempotent, so loop callers can call this per url
3129
open: (url: string) => {
3230
startHistoryMonitor();
3331
browser.tabs.create({ url, active: false });

apps/web/src/app/provider/DynamicProvider.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ function DynamicProvider({ children }: PropsWithChildren) {
2020
get: async <T,>(key: string) => getFromLocalStorage<T>(key),
2121
set: async (key: string, value: any) => setToLocalStorage(key, value),
2222
},
23-
// Delegates to openNewTab so the noopener/noreferrer flags and the
24-
// focus() call are not silently dropped
2523
tabs: { open: openNewTab },
2624
favicon: { getUrl: getYandexFaviconUrl },
2725
}),

packages/shared/src/components/Bookmarks/utils/index.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@ export const isFolderEmpty = (
1515
return !folder || folder.length === 0;
1616
};
1717

18-
/**
19-
* Takes the favicon provider as an argument rather than reading DynamicContext:
20-
* the cache/preload path is plain async functions, not components, so it cannot
21-
* consume a React context.
22-
*/
18+
// Provider is a param, not from DynamicContext: callers here are not components
2319
export const getBookmarkFaviconUrls = (
2420
urlList: IBookmarksObj['urlList'],
2521
getFaviconUrl: (url: string) => string

packages/shared/src/components/Persons/components/BookmarksList.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ interface Props {
2424
personToOpen: IPerson | undefined;
2525
imageUrl: string;
2626
fullscreen: boolean;
27-
/**
28-
* Rendered only when supplied, so the shared component no longer needs to
29-
* know the extension's edit route to decide whether editing is possible.
30-
*/
27+
/** The edit button renders only when this is supplied. */
3128
onBookmarkEdit?: (bookmark: IBookmarkWithFolder) => void;
3229
}
3330

packages/shared/src/provider/DynamicContext.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ interface IDynamicContext {
1212
get: <T>(key: string) => Promise<T | null | undefined>;
1313
set: (key: string, data: any) => Promise<void>;
1414
};
15-
/**
16-
* Opening a link differs per platform (browser.tabs.create vs window.open),
17-
* and the extension must arm its history watcher first. Routing it through
18-
* the seam keeps that invariant in one place instead of at every call site.
19-
*/
2015
tabs: {
2116
open: (url: string) => void;
2217
};

0 commit comments

Comments
 (0)