diff --git a/oxlint-suppressions.json b/oxlint-suppressions.json index f58c3ac3faa..f9ed3b475b5 100644 --- a/oxlint-suppressions.json +++ b/oxlint-suppressions.json @@ -602,11 +602,6 @@ "count": 1 } }, - "web/app/components/app/create-app-modal/index.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 7 - } - }, "web/app/components/app/create-from-dsl-modal/uploader.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 4 @@ -642,11 +637,6 @@ "count": 1 } }, - "web/app/components/app/deploy/shared/deployment-configuration/credential-field.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 2 - } - }, "web/app/components/app/deploy/shared/deployment-configuration/index.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 3 @@ -860,9 +850,6 @@ } }, "web/app/components/base/audio-gallery/AudioPlayer.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 1 - }, "jsx-a11y/media-has-caption": { "count": 1 }, @@ -1402,9 +1389,6 @@ } }, "web/app/components/base/markdown-blocks/code-block.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 1 - }, "typescript/no-explicit-any": { "count": 2 } @@ -1808,11 +1792,6 @@ "count": 1 } }, - "web/app/components/billing/pricing/plans/self-hosted-plan-item/index.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 2 - } - }, "web/app/components/billing/priority-label/index.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 2 @@ -2000,11 +1979,6 @@ "count": 1 } }, - "web/app/components/datasets/create/file-uploader/components/file-list-item.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 2 - } - }, "web/app/components/datasets/create/file-uploader/components/upload-dropzone.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 3 @@ -2240,9 +2214,6 @@ } }, "web/app/components/datasets/documents/create-from-pipeline/data-source/local-file/components/file-list-item.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 1 - }, "jsx-a11y/click-events-have-key-events": { "count": 2 }, @@ -2406,9 +2377,6 @@ } }, "web/app/components/datasets/documents/detail/batch-modal/csv-uploader.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 3 - }, "no-restricted-globals": { "count": 1 }, @@ -2917,11 +2885,6 @@ "count": 4 } }, - "web/app/components/plugins/card/index.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 6 - } - }, "web/app/components/plugins/install-plugin/base/loading-error.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 2 @@ -3130,11 +3093,6 @@ "count": 3 } }, - "web/app/components/plugins/plugin-detail-panel/detail-header/index.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 4 - } - }, "web/app/components/plugins/plugin-detail-panel/endpoint-card.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 4 @@ -3238,18 +3196,10 @@ } }, "web/app/components/plugins/plugin-item/index.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 9 - }, "typescript/no-explicit-any": { "count": 1 } }, - "web/app/components/plugins/plugin-page/category-marketplace-panel.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 1 - } - }, "web/app/components/plugins/plugin-page/empty/index.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 3 @@ -3330,11 +3280,6 @@ "count": 2 } }, - "web/app/components/plugins/provider-card.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 1 - } - }, "web/app/components/plugins/readme-panel/content.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 1 @@ -3848,31 +3793,16 @@ "count": 2 } }, - "web/app/components/workflow/block-selector/tool/action-item.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 6 - } - }, "web/app/components/workflow/block-selector/tool/tool-list-flat-view/list.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 1 } }, - "web/app/components/workflow/block-selector/tool/tool.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 14 - } - }, "web/app/components/workflow/block-selector/trigger-plugin/action-item.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 6 } }, - "web/app/components/workflow/block-selector/trigger-plugin/item.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 3 - } - }, "web/app/components/workflow/collaboration/components/user-cursors.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 1 @@ -4131,9 +4061,6 @@ } }, "web/app/components/workflow/nodes/_base/components/editor/code-editor/index.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 1 - }, "react/only-export-components": { "count": 1 }, @@ -4959,11 +4886,6 @@ "count": 1 } }, - "web/app/components/workflow/nodes/llm/components/json-schema-config-modal/code-editor.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 2 - } - }, "web/app/components/workflow/nodes/llm/components/json-schema-config-modal/json-importer.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 3 @@ -5779,11 +5701,6 @@ "count": 1 } }, - "web/app/components/workflow/run/status-container.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 5 - } - }, "web/app/components/workflow/run/status.tsx": { "jsx-a11y/anchor-has-content": { "count": 1 @@ -6093,11 +6010,6 @@ "count": 3 } }, - "web/features/agent-v2/agent-detail/configure/components/orchestrate/tools/provider-tool/item.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 9 - } - }, "web/features/agent-v2/agent-detail/configure/components/preview/build-background.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 2 @@ -6183,11 +6095,6 @@ "count": 1 } }, - "web/features/app-access-error/page.tsx": { - "better-tailwindcss/enforce-logical-properties": { - "count": 3 - } - }, "web/features/app-access-error/trial-boundary.tsx": { "better-tailwindcss/enforce-logical-properties": { "count": 1 diff --git a/packages/tooling/lint.config.ts b/packages/tooling/lint.config.ts index fd7affb5ea2..49065d6dd15 100644 --- a/packages/tooling/lint.config.ts +++ b/packages/tooling/lint.config.ts @@ -70,6 +70,10 @@ const webRestrictedImports = [ importNames: ['useLocalStorageState'], message: 'Do not use ahooks useLocalStorageState. Use foxact storage hooks instead.', }, + { + name: 'next-themes', + message: 'Use the @/features/theme module instead of next-themes.', + }, ], patterns: [ { @@ -1809,6 +1813,19 @@ export const lintConfig = { ], }, }, + { + files: ['web/features/theme/*.{ts,tsx}'], + rules: { + 'no-restricted-imports': [ + 'error', + { + ...webRestrictedImports[1], + paths: webRestrictedImports[1].paths.filter((path) => path.name !== 'next-themes'), + patterns: [...webRestrictedImports[1].patterns, rawHttpImports], + }, + ], + }, + }, { ...handwrittenApiScope, excludeFiles: [...handwrittenApiScope.excludeFiles, ...marketplaceBoundaryFiles], diff --git a/web/app/components/app/create-app-modal/index.tsx b/web/app/components/app/create-app-modal/index.tsx index 4421331ceed..771304dde93 100644 --- a/web/app/components/app/create-app-modal/index.tsx +++ b/web/app/components/app/create-app-modal/index.tsx @@ -29,7 +29,7 @@ import { toast } from '@/app/notifications' import { workspacePermissionKeysAtom } from '@/context/permission-state' import { userProfileQueryOptions } from '@/features/account-profile/client' import { systemFeaturesQueryOptions } from '@/features/system-features/client' -import useTheme from '@/hooks/use-theme' +import { useResolvedTheme } from '@/features/theme/hooks' import { useRouter } from '@/next/navigation' import { consoleQuery } from '@/service/console' import { getRedirection } from '@/utils/app-redirection' @@ -246,7 +246,7 @@ function CreateApp({ onClose, onCreateFromTemplate, defaultAppMode }: CreateAppP
@@ -344,7 +344,7 @@ function CreateApp({ onClose, onCreateFromTemplate, defaultAppMode }: CreateAppP > {t(($) => $['newApp.captionDescription'], { ns: 'app' })} - + ({t(($) => $['newApp.optional'], { ns: 'app' })}) @@ -361,7 +361,7 @@ function CreateApp({ onClose, onCreateFromTemplate, defaultAppMode }: CreateAppP
-
+
@@ -457,7 +457,7 @@ function AppTypeCard({ icon, title, description, active, onClick }: AppTypeCardP