chore(frontend): remove dead code (monaco chunk, setSelection, isNew branch)

- vite.config.ts: drop the manualChunks 'monaco' branch — monaco was removed
  in the monaco→tiptap migration (82b82c5), so the regex never matches.
- use-file-manager-selection.ts: remove `setSelection` — no caller destructures
  it (file-manager.tsx never did); all writes go through rawSelectedPaths.
- settings-prompt.tsx: remove the unreachable `isNew` (promptId === 'new')
  branch — nothing routes to /settings/prompts/new, and it would render a
  "Create Prompt" header over a "Prompt not found" card. The real create path
  is `isUpdate === false`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Sergey Kozyrenko
2026-07-10 13:10:12 +07:00
co-authored by Claude Opus 4.8
parent bfd5b9d42f
commit c517ccbb1e
3 changed files with 3 additions and 15 deletions
@@ -39,7 +39,6 @@ interface UseFileManagerSelection {
*/
onToggleSelection: (path: string, subtreePaths?: readonly string[]) => void;
selectedPaths: Set<string>;
setSelection: (paths: Set<string>) => void;
/** Toggle "select all": clears if everything was selected, otherwise picks every file. */
toggleSelectAll: () => void;
}
@@ -163,10 +162,6 @@ export function useFileManagerSelection({
setRawSelectedPaths((prev) => (prev.size === 0 ? prev : new Set()));
}, []);
const setSelection = useCallback((paths: Set<string>) => {
setRawSelectedPaths(paths);
}, []);
return {
clearSelection,
isAllSelected,
@@ -174,7 +169,6 @@ export function useFileManagerSelection({
onRowClick,
onToggleSelection,
selectedPaths,
setSelection,
toggleSelectAll,
};
}
@@ -640,7 +640,6 @@ function SettingsPrompt() {
onSave: onSaveAndLeave,
});
const isNew = promptId === 'new';
const hasOverride =
(activeTab === 'system' && !!promptInfo?.userSystemPrompt) ||
(activeTab === 'human' && !!promptInfo?.userHumanPrompt);
@@ -648,9 +647,7 @@ function SettingsPrompt() {
const pageHeader = (
<AppHeader>
<AppHeaderContent>
<AppHeaderTitle icon={<FileText className="size-4 shrink-0" />}>
{isNew ? 'Create Prompt' : 'Edit Prompt'}
</AppHeaderTitle>
<AppHeaderTitle icon={<FileText className="size-4 shrink-0" />}>Edit Prompt</AppHeaderTitle>
</AppHeaderContent>
{promptInfo && (
<AppHeaderActions>
@@ -675,7 +672,7 @@ function SettingsPrompt() {
size="sm"
variant="secondary"
>
{isNew ? 'Create' : 'Save'}
Save
</FormSubmitButton>
<DropdownMenu>
<DropdownMenuTrigger asChild>
@@ -782,7 +779,7 @@ function SettingsPrompt() {
const promptMeta = (
<>
<div className="flex flex-col gap-2 text-center">
<h2 className="text-2xl font-semibold">{isNew ? 'Create a prompt' : 'Edit prompt'}</h2>
<h2 className="text-2xl font-semibold">Edit prompt</h2>
<p className="text-muted-foreground">
{promptInfo.type === 'agent'
? 'Customize the templates this agent uses'
-3
View File
@@ -83,9 +83,6 @@ export default defineConfig(({ mode }) => {
if (/[\\/]@react-pdf[\\/]/.test(id)) {
return 'pdf';
}
if (/[\\/](monaco-editor|@monaco-editor[\\/]react)[\\/]/.test(id)) {
return 'monaco';
}
if (/[\\/](@tiptap|prosemirror-[a-z-]+)[\\/]/.test(id)) {
return 'tiptap';
}