Skip to content

Commit f1f178a

Browse files
committed
fix(pplx:ext): circular dependencies
1 parent 61d95c1 commit f1f178a

File tree

51 files changed

+952
-954
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+952
-954
lines changed

packages/eslint-config/rules/imports.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ export default tseslint.config({
99
import: importPlugin,
1010
"@limegrass/import-alias": importAliasPlugin,
1111
},
12+
ignores: ["**/node_modules/**"],
1213
settings: {
1314
"import/resolver": {
1415
typescript: {
1516
alwaysTryTypes: true,
1617
project: "./tsconfig.json",
1718
},
1819
},
20+
"import/parsers": {
21+
"@typescript-eslint/parser": [".ts", ".tsx"],
22+
},
23+
"import/ignore": ["node_modules", "\.json$"],
1924
},
2025
rules: {
2126
"import/no-unresolved": "error",
22-
// "import/no-cycle": ["error", { maxDepth: 10, ignoreExternal: true }],
27+
"import/no-cycle": ["error", { ignoreExternal: true }],
2328
"import/no-self-import": "error",
2429
"import/order": [
2530
"warn",

perplexity/extension/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ unimport.d.ts
2727
/coverage
2828
/dist
2929
/release
30+
/changelogs/listing.json
3031

3132
cdn
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Bug Fixes
2+
3+
- Fixed an issue where the extension settings were not being updated correctly when:
4+
- Importing data from an older version of the extension
5+
- Changing TTS Voice won't persist across page reloads
6+
- Post update release notes won't dismiss

perplexity/extension/changelogs/listing.json

Lines changed: 0 additions & 75 deletions
This file was deleted.

perplexity/extension/cli/src/r2/remote-resources/versioned.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function processAllRemoteResourceFiles(): Promise<void> {
3131
listing = readResourceListing();
3232
} catch (error: any) {
3333
logger.error(`Failed to read resource listing: ${error.message}`);
34-
process.exit(1); // Exit if we can't even read the listing
34+
process.exit(1);
3535
}
3636

3737
let updatedListing = { ...listing };
@@ -128,11 +128,11 @@ async function registerVersionedResource(params: {
128128
// If content hasn't changed, skip registration
129129
if (!contentChanged) {
130130
logger.info(
131-
`Skipping resource ${chalk.yellow(
131+
`Content unchanged for ${chalk.yellow(
132132
`["${resource.name}/${resourceFileName}"]`,
133-
)} (content unchanged)`,
133+
)}`,
134134
);
135-
return listing; // Return the original listing unchanged
135+
return listing;
136136
}
137137

138138
// 2. Update listing object

perplexity/extension/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "pplx-ext",
3-
"version": "1.13.1",
3+
"version": "1.13.2",
44
"author": "pnd280",
55
"dependencies": {
6-
"@ark-ui/react": "^5.6.0",
6+
"@ark-ui/react": "^5.7.0",
77
"@codesandbox/sandpack-react": "^2.20.0",
88
"@complexity/async-dep-registry": "workspace:*",
99
"@dnd-kit/core": "^6.3.1",
@@ -83,7 +83,7 @@
8383
"@types/jquery": "^3.5.32",
8484
"@types/lodash": "^4.17.16",
8585
"@types/mdast": "^4.0.4",
86-
"@types/node": "^20.17.30",
86+
"@types/node": "^20.17.31",
8787
"@types/pako": "^2.0.3",
8888
"@types/react": "^19.1.2",
8989
"@types/react-dom": "^19.1.2",

perplexity/extension/src/components/PostUpdateReleaseNotesDialog.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ export function PostUpdateReleaseNotesDialog() {
4444
{t("common:releaseNotes.title", { version: APP_CONFIG.VERSION })}
4545
</DialogTitle>
4646
</DialogHeader>
47-
<ChangelogRenderer changelog={changelog} />
47+
<ChangelogRenderer
48+
changelog={changelog}
49+
className="x:md:max-w-[900px]"
50+
/>
4851
<DialogFooter>
4952
<DontShowAgainForFutureUpdatesConfirmDialog
5053
onConfirm={() => {

perplexity/extension/src/entrypoints/options-page/dashboard/pages/plugins/PluginsPage.tsx renamed to perplexity/extension/src/entrypoints/options-page/dashboard/pages/plugins/PluginsListing.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import { useRoutes } from "react-router-dom";
1+
import { useCallback } from "react";
22

33
import { Input } from "@/components/ui/input";
4-
import PluginSettingsWrapper from "@/entrypoints/options-page/dashboard/pages/plugins/components/plugin-settings-uis/PluginSettingsWrapper";
54
import { PluginSections } from "@/entrypoints/options-page/dashboard/pages/plugins/components/PluginSections";
65
import { TagsFilter } from "@/entrypoints/options-page/dashboard/pages/plugins/components/TagsFilter";
76
import { useFilteredPlugins } from "@/entrypoints/options-page/dashboard/pages/plugins/hooks/useFilteredPlugins";
87
import { usePluginCategories } from "@/entrypoints/options-page/dashboard/pages/plugins/hooks/usePluginCategories";
98
import { usePluginFiltersStore } from "@/entrypoints/options-page/dashboard/pages/plugins/store";
109

11-
function PluginsListing() {
10+
export default function PluginsListing() {
1211
const filters = usePluginFiltersStore((state) => state.filters);
1312
const setFilters = usePluginFiltersStore((state) => state.setFilters);
1413

@@ -57,16 +56,3 @@ function PluginsListing() {
5756
</div>
5857
);
5958
}
60-
61-
export default function PluginsPage() {
62-
return useRoutes([
63-
{
64-
path: ":pluginId/*",
65-
element: <PluginSettingsWrapper />,
66-
},
67-
{
68-
path: "*",
69-
element: <PluginsListing />,
70-
},
71-
]);
72-
}

perplexity/extension/src/entrypoints/options-page/dashboard/pages/plugins/components/TagsFilter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export function TagsFilter() {
7171
<PopoverTrigger asChild>
7272
<Button variant="ghost" className="x:py-2">
7373
<div className="x:flex x:items-center x:gap-2">
74-
<span>Tags</span>
74+
<span>Filter</span>
7575
{getActiveFiltersCount() > 0 && (
7676
<div className="x:flex x:h-4 x:w-4 x:items-center x:justify-center x:rounded-full x:bg-primary/10 x:text-[10px] x:font-medium x:text-primary">
7777
{getActiveFiltersCount()}

perplexity/extension/src/entrypoints/options-page/dashboard/pages/plugins/components/plugin-settings-uis/PluginSettingsWrapper.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Page from "@/entrypoints/options-page/components/Page";
77
import PluginSettingsModal from "@/entrypoints/options-page/dashboard/pages/plugins/components/plugin-settings-uis/PluginSettingsModal";
88
import PluginSettingsPage from "@/entrypoints/options-page/dashboard/pages/plugins/components/plugin-settings-uis/PluginSettingsPage";
99
import usePluginsStates from "@/entrypoints/options-page/dashboard/pages/plugins/hooks/usePluginsStates";
10-
import PluginsPage from "@/entrypoints/options-page/dashboard/pages/plugins/PluginsPage";
10+
import PluginsListing from "@/entrypoints/options-page/dashboard/pages/plugins/PluginsListing";
1111
import useClearLocationState from "@/hooks/useClearLocationState";
1212

1313
export default function PluginSettingsWrapper() {
@@ -44,7 +44,7 @@ export default function PluginSettingsWrapper() {
4444
<>
4545
{isFromPluginList ? (
4646
<>
47-
<PluginsPage />
47+
<PluginsListing />
4848
<PluginSettingsModal pluginId={plugin.id} />
4949
</>
5050
) : (
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import { useRoutes } from "react-router-dom";
2+
3+
import PluginSettingsWrapper from "@/entrypoints/options-page/dashboard/pages/plugins/components/plugin-settings-uis/PluginSettingsWrapper";
4+
import PluginsListing from "@/entrypoints/options-page/dashboard/pages/plugins/PluginsListing";
5+
6+
export function PluginRoutes() {
7+
return useRoutes([
8+
{
9+
path: ":pluginId/*",
10+
element: <PluginSettingsWrapper />,
11+
},
12+
{
13+
path: "*",
14+
element: <PluginsListing />,
15+
},
16+
]);
17+
}

perplexity/extension/src/entrypoints/options-page/dashboard/pages/settings/components/ImportDataButtons.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ import { storage } from "@wxt-dev/storage";
33
import { Button } from "@/components/ui/button";
44
import { toast } from "@/components/ui/use-toast";
55
import type { ExtensionData } from "@/data/dashboard/extension-data.types";
6+
import { queryClient } from "@/data/query-client";
67
import ImportDataPasteDialogWrapper from "@/entrypoints/options-page/dashboard/pages/settings/components/ImportDataPasteDialogWrapper";
78
import { transfromFlatSchema } from "@/services/extension-settings/migrations";
9+
import { extensionSettingsQueries } from "@/services/extension-settings/query-keys";
810
import type { ExtensionSettings } from "@/services/extension-settings/types";
911
import { db } from "@/services/indexed-db";
1012
import { errorWrapper } from "@/utils/error-wrapper";
@@ -16,7 +18,7 @@ export default function ImportDataButtons() {
1618
const [, error] = await errorWrapper(async () => {
1719
const parsedData = JSON.parse(data) as ExtensionData;
1820

19-
if ("plugins" in parsedData.settings) {
21+
if (parsedData.settings != null && "plugins" in parsedData.settings) {
2022
parsedData.settings = {
2123
settings: transfromFlatSchema(parsedData.settings),
2224
settings$: {
@@ -25,14 +27,26 @@ export default function ImportDataButtons() {
2527
};
2628
}
2729

30+
const settings =
31+
"localStorage" in parsedData
32+
? (parsedData.localStorage as {
33+
settings: ExtensionSettings;
34+
settings$: { v: number };
35+
})
36+
: parsedData.settings;
37+
2838
await storage.setItem<ExtensionSettings>(
2939
"local:settings",
30-
parsedData.settings.settings,
40+
settings.settings,
3141
);
3242
await storage.setMeta("local:settings", {
33-
v: parsedData.settings["settings$"].v,
43+
v: settings["settings$"].v,
3444
});
3545
db.import(parsedData.db);
46+
47+
queryClient.invalidateQueries({
48+
queryKey: extensionSettingsQueries.all(),
49+
});
3650
})();
3751

3852
if (!error) {

perplexity/extension/src/entrypoints/options-page/router.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import LoadingOverlay from "@/components/LoadingOverlay";
77
import Page from "@/entrypoints/options-page/components/Page";
88
import ErrorPage from "@/entrypoints/options-page/dashboard/pages/ErrorPage";
99
import NotFoundPage from "@/entrypoints/options-page/dashboard/pages/NotFoundPage";
10-
import PluginsPage from "@/entrypoints/options-page/dashboard/pages/plugins/PluginsPage";
10+
import { PluginRoutes } from "@/entrypoints/options-page/dashboard/pages/plugins/routes";
1111
import { ThemesPageRoutes } from "@/entrypoints/options-page/dashboard/pages/themes/routes";
1212

1313
const { Playground } = lazily(
@@ -54,7 +54,7 @@ export const router: ReturnType<typeof createHashRouter> = createHashRouter([
5454
children: [
5555
{
5656
path: "plugins/*",
57-
element: <Page title="Plugins" page={PluginsPage} />,
57+
element: <Page title="Plugins" page={PluginRoutes} />,
5858
},
5959
{
6060
path: "themes/*",

perplexity/extension/src/plugins/_core/global-stores/global-css-store.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ export function useIsEntryActive(entryId: keyof GlobalCssStoreRegistry) {
111111
}, deepEqual);
112112
}
113113

114-
export function useRegisterGlobalCssEntry({
114+
export function useRegisteredGlobalCssEntry({
115115
entryIds,
116116
subscriberId,
117117
subscribe,

0 commit comments

Comments
 (0)