mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-28 09:23:08 +08:00
feat: add injection preview functionality and enhance specs management
- Implemented injection preview feature in InjectionControlTab with file listing and content preview. - Added new API endpoint for fetching injection preview data. - Introduced content length caching for performance optimization. - Enhanced spec loading to support category filtering. - Updated localization files for new features and terms. - Created new personal and project specs for coding style and architecture constraints. - Improved CLI options for category selection in spec commands.
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||
import { useIntl } from 'react-intl';
|
||||
import { toast } from 'sonner';
|
||||
import { Settings, RefreshCw } from 'lucide-react';
|
||||
import {
|
||||
@@ -113,6 +114,7 @@ const settingsKeys = {
|
||||
// ========== Component ==========
|
||||
|
||||
export function GlobalSettingsTab() {
|
||||
const { formatMessage } = useIntl();
|
||||
const queryClient = useQueryClient();
|
||||
|
||||
// Local state for immediate UI feedback
|
||||
@@ -149,10 +151,13 @@ export function GlobalSettingsTab() {
|
||||
mutationFn: updateSystemSettings,
|
||||
onSuccess: (data) => {
|
||||
queryClient.setQueryData(settingsKeys.settings(), data.settings);
|
||||
toast.success('Settings saved successfully');
|
||||
toast.success(formatMessage({ id: 'specs.injection.saveSuccess', defaultMessage: 'Settings saved successfully' }));
|
||||
},
|
||||
onError: (error) => {
|
||||
toast.error(`Failed to save settings: ${error.message}`);
|
||||
toast.error(formatMessage(
|
||||
{ id: 'specs.injection.saveError', defaultMessage: 'Failed to save settings: {error}' },
|
||||
{ error: error.message }
|
||||
));
|
||||
},
|
||||
});
|
||||
|
||||
@@ -194,12 +199,6 @@ export function GlobalSettingsTab() {
|
||||
const isLoading = isLoadingSettings || isLoadingStats;
|
||||
const hasError = settingsError || statsError;
|
||||
|
||||
// Dimension display config
|
||||
const dimensionLabels: Record<string, string> = {
|
||||
specs: 'Specs',
|
||||
personal: 'Personal',
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
{/* Personal Spec Defaults Card */}
|
||||
@@ -207,16 +206,20 @@ export function GlobalSettingsTab() {
|
||||
<CardHeader>
|
||||
<div className="flex items-center gap-2">
|
||||
<Settings className="h-5 w-5 text-muted-foreground" />
|
||||
<CardTitle>Personal Spec Defaults</CardTitle>
|
||||
<CardTitle>
|
||||
{formatMessage({ id: 'specs.settings.personalSpecDefaults', defaultMessage: 'Personal Spec Defaults' })}
|
||||
</CardTitle>
|
||||
</div>
|
||||
<CardDescription>
|
||||
These settings will be applied when creating new personal specs
|
||||
{formatMessage({ id: 'specs.settings.personalSpecDefaultsDesc', defaultMessage: 'These settings will be applied when creating new personal specs' })}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-6">
|
||||
{/* Default Read Mode */}
|
||||
<div className="space-y-2">
|
||||
<Label htmlFor="default-read-mode">Default Read Mode</Label>
|
||||
<Label htmlFor="default-read-mode">
|
||||
{formatMessage({ id: 'specs.settings.defaultReadMode', defaultMessage: 'Default Read Mode' })}
|
||||
</Label>
|
||||
<Select
|
||||
value={localDefaults.defaultReadMode}
|
||||
onValueChange={(value) =>
|
||||
@@ -224,28 +227,30 @@ export function GlobalSettingsTab() {
|
||||
}
|
||||
>
|
||||
<SelectTrigger id="default-read-mode" className="w-full">
|
||||
<SelectValue placeholder="Select read mode" />
|
||||
<SelectValue placeholder={formatMessage({ id: 'specs.settings.selectReadMode', defaultMessage: 'Select read mode' })} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="required">
|
||||
Required (Always inject)
|
||||
{formatMessage({ id: 'specs.readMode.required', defaultMessage: 'Required' })}
|
||||
</SelectItem>
|
||||
<SelectItem value="optional">
|
||||
Optional (Inject on keyword match)
|
||||
{formatMessage({ id: 'specs.readMode.optional', defaultMessage: 'Optional' })}
|
||||
</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
The default read mode for newly created personal specs
|
||||
{formatMessage({ id: 'specs.settings.defaultReadModeHelp', defaultMessage: 'The default read mode for newly created personal specs' })}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{/* Auto Enable */}
|
||||
<div className="flex items-center justify-between">
|
||||
<div className="space-y-0.5">
|
||||
<Label htmlFor="auto-enable">Auto Enable New Specs</Label>
|
||||
<Label htmlFor="auto-enable">
|
||||
{formatMessage({ id: 'specs.settings.autoEnable', defaultMessage: 'Auto Enable New Specs' })}
|
||||
</Label>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Automatically enable newly created personal specs
|
||||
{formatMessage({ id: 'specs.settings.autoEnableDescription', defaultMessage: 'Automatically enable newly created personal specs' })}
|
||||
</p>
|
||||
</div>
|
||||
<Switch
|
||||
@@ -262,7 +267,9 @@ export function GlobalSettingsTab() {
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<CardTitle>Spec Statistics</CardTitle>
|
||||
<CardTitle>
|
||||
{formatMessage({ id: 'specs.settings.specStatistics', defaultMessage: 'Spec Statistics' })}
|
||||
</CardTitle>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
@@ -280,7 +287,7 @@ export function GlobalSettingsTab() {
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{isLoading ? (
|
||||
<div className="grid grid-cols-4 gap-4">
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
{[1, 2, 3, 4].map((i) => (
|
||||
<div
|
||||
key={i}
|
||||
@@ -293,11 +300,11 @@ export function GlobalSettingsTab() {
|
||||
</div>
|
||||
) : hasError ? (
|
||||
<div className="text-center py-8 text-muted-foreground">
|
||||
Failed to load statistics
|
||||
{formatMessage({ id: 'specs.injection.loadError', defaultMessage: 'Failed to load statistics' })}
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="grid grid-cols-4 gap-4">
|
||||
<div className="grid grid-cols-2 md:grid-cols-4 gap-4">
|
||||
{dimensionEntries.map(([dim, data]) => (
|
||||
<div
|
||||
key={dim}
|
||||
@@ -306,11 +313,11 @@ export function GlobalSettingsTab() {
|
||||
<div className="text-2xl font-bold text-foreground">
|
||||
{data.count}
|
||||
</div>
|
||||
<div className="text-sm text-muted-foreground capitalize">
|
||||
{dimensionLabels[dim] || dim}
|
||||
<div className="text-sm text-muted-foreground">
|
||||
{formatMessage({ id: `specs.dimension.${dim}`, defaultMessage: dim })}
|
||||
</div>
|
||||
<div className="text-xs text-muted-foreground mt-1">
|
||||
{data.requiredCount} required
|
||||
{data.requiredCount} {formatMessage({ id: 'specs.required', defaultMessage: 'required' })}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
@@ -319,10 +326,15 @@ export function GlobalSettingsTab() {
|
||||
{/* Summary */}
|
||||
<div className="mt-4 pt-4 border-t border-border">
|
||||
<div className="flex justify-between text-sm text-muted-foreground">
|
||||
<span>Total: {totalCount} spec files</span>
|
||||
<span>
|
||||
{totalRequired} required | {totalCount - totalRequired}{' '}
|
||||
optional
|
||||
{formatMessage(
|
||||
{ id: 'specs.settings.totalSpecs', defaultMessage: 'Total: {count} spec files' },
|
||||
{ count: totalCount }
|
||||
)}
|
||||
</span>
|
||||
<span>
|
||||
{totalRequired} {formatMessage({ id: 'specs.readMode.required', defaultMessage: 'required' })} | {totalCount - totalRequired}{' '}
|
||||
{formatMessage({ id: 'specs.readMode.optional', defaultMessage: 'optional' })}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,6 +8,12 @@ import { useIntl } from 'react-intl';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { toast } from 'sonner';
|
||||
import { cn } from '@/lib/utils';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from '@/components/ui/Dialog';
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
@@ -20,6 +26,7 @@ import { Label } from '@/components/ui/Label';
|
||||
import { Button } from '@/components/ui/Button';
|
||||
import { Switch } from '@/components/ui/Switch';
|
||||
import { Progress } from '@/components/ui/Progress';
|
||||
import { Badge } from '@/components/ui/Badge';
|
||||
import {
|
||||
AlertCircle,
|
||||
Info,
|
||||
@@ -30,8 +37,16 @@ import {
|
||||
Download,
|
||||
CheckCircle2,
|
||||
Settings,
|
||||
FileText,
|
||||
Eye,
|
||||
Globe,
|
||||
Folder,
|
||||
ChevronDown,
|
||||
ChevronRight,
|
||||
} from 'lucide-react';
|
||||
import { useInstallRecommendedHooks } from '@/hooks/useSystemSettings';
|
||||
import type { InjectionPreviewFile, InjectionPreviewResponse } from '@/lib/api';
|
||||
import { getInjectionPreview } from '@/lib/api';
|
||||
|
||||
// ========== Types ==========
|
||||
|
||||
@@ -167,6 +182,17 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
// State for hooks installation
|
||||
const [installingHookIds, setInstallingHookIds] = useState<string[]>([]);
|
||||
|
||||
// State for injection preview
|
||||
const [previewMode, setPreviewMode] = useState<'required' | 'all'>('required');
|
||||
const [previewData, setPreviewData] = useState<InjectionPreviewResponse | null>(null);
|
||||
const [previewLoading, setPreviewLoading] = useState(false);
|
||||
const [expandedDimensions, setExpandedDimensions] = useState<Record<string, boolean>>({
|
||||
specs: true,
|
||||
personal: true,
|
||||
});
|
||||
const [previewDialogOpen, setPreviewDialogOpen] = useState(false);
|
||||
const [previewFile, setPreviewFile] = useState<InjectionPreviewFile | null>(null);
|
||||
|
||||
// Fetch stats
|
||||
const loadStats = useCallback(async () => {
|
||||
setStatsLoading(true);
|
||||
@@ -195,12 +221,44 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
}
|
||||
}, []);
|
||||
|
||||
// Load injection preview
|
||||
const loadPreview = useCallback(async () => {
|
||||
setPreviewLoading(true);
|
||||
try {
|
||||
const data = await getInjectionPreview(previewMode, false);
|
||||
setPreviewData(data);
|
||||
} catch (err) {
|
||||
console.error('Failed to load injection preview:', err);
|
||||
} finally {
|
||||
setPreviewLoading(false);
|
||||
}
|
||||
}, [previewMode]);
|
||||
|
||||
// Load file content for preview
|
||||
const loadFilePreview = useCallback(async (file: InjectionPreviewFile) => {
|
||||
try {
|
||||
const data = await getInjectionPreview(previewMode, true);
|
||||
const fileWithData = data.files.find(f => f.file === file.file);
|
||||
if (fileWithData) {
|
||||
setPreviewFile(fileWithData);
|
||||
setPreviewDialogOpen(true);
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('Failed to load file preview:', err);
|
||||
}
|
||||
}, [previewMode]);
|
||||
|
||||
// Initial load
|
||||
useEffect(() => {
|
||||
loadStats();
|
||||
loadSettings();
|
||||
}, [loadStats, loadSettings]);
|
||||
|
||||
// Load preview when mode changes
|
||||
useEffect(() => {
|
||||
loadPreview();
|
||||
}, [loadPreview]);
|
||||
|
||||
// Check for changes
|
||||
useEffect(() => {
|
||||
const changed =
|
||||
@@ -245,20 +303,21 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
setHasChanges(false);
|
||||
};
|
||||
|
||||
// Toggle dimension expansion
|
||||
const toggleDimension = (dim: string) => {
|
||||
setExpandedDimensions(prev => ({ ...prev, [dim]: !prev[dim] }));
|
||||
};
|
||||
|
||||
// ========== Hooks Installation ==========
|
||||
|
||||
// Get installed hooks from system settings
|
||||
const installedHookIds = useMemo(() => {
|
||||
const installed = new Set<string>();
|
||||
// Check if hooks are already installed by checking system settings
|
||||
// For now, we'll track this via the mutation result
|
||||
return installed;
|
||||
}, []);
|
||||
|
||||
const installedCount = 0; // Will be updated when we have real data
|
||||
const installedCount = 0;
|
||||
const allHooksInstalled = installedCount === RECOMMENDED_HOOKS.length;
|
||||
|
||||
// Install single hook
|
||||
const handleInstallHook = useCallback(async (hookId: string) => {
|
||||
setInstallingHookIds(prev => [...prev, hookId]);
|
||||
try {
|
||||
@@ -276,7 +335,6 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
}
|
||||
}, [installHooksMutation, formatMessage]);
|
||||
|
||||
// Install all hooks
|
||||
const handleInstallAllHooks = useCallback(async () => {
|
||||
const uninstalledHooks = RECOMMENDED_HOOKS.filter(h => !installedHookIds.has(h.id));
|
||||
if (uninstalledHooks.length === 0) return;
|
||||
@@ -300,6 +358,19 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
}
|
||||
}, [installedHookIds, installHooksMutation, formatMessage]);
|
||||
|
||||
// Group files by dimension
|
||||
const filesByDimension = useMemo(() => {
|
||||
if (!previewData) return {};
|
||||
const grouped: Record<string, InjectionPreviewFile[]> = {};
|
||||
for (const file of previewData.files) {
|
||||
if (!grouped[file.dimension]) {
|
||||
grouped[file.dimension] = [];
|
||||
}
|
||||
grouped[file.dimension].push(file);
|
||||
}
|
||||
return grouped;
|
||||
}, [previewData]);
|
||||
|
||||
// Calculate progress and status
|
||||
const currentLength = stats?.injectionLength?.withKeywords || 0;
|
||||
const maxLength = settings.maxLength;
|
||||
@@ -416,7 +487,7 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-6 w-6"
|
||||
onClick={loadStats}
|
||||
onClick={() => { loadStats(); loadPreview(); }}
|
||||
disabled={statsLoading}
|
||||
>
|
||||
<RefreshCw className={cn('h-4 w-4', statsLoading && 'animate-spin')} />
|
||||
@@ -537,6 +608,116 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Injection Files List Card */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
<div className="flex items-center justify-between">
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<FileText className="h-5 w-5" />
|
||||
{formatMessage({ id: 'specs.injection.filesList', defaultMessage: 'Injection Files' })}
|
||||
</CardTitle>
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
variant={previewMode === 'required' ? 'default' : 'outline'}
|
||||
size="sm"
|
||||
onClick={() => setPreviewMode('required')}
|
||||
>
|
||||
{formatMessage({ id: 'specs.readMode.required', defaultMessage: 'Required' })}
|
||||
</Button>
|
||||
<Button
|
||||
variant={previewMode === 'all' ? 'default' : 'outline'}
|
||||
size="sm"
|
||||
onClick={() => setPreviewMode('all')}
|
||||
>
|
||||
{formatMessage({ id: 'specs.scope.all', defaultMessage: 'All' })}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<CardDescription>
|
||||
{previewData && (
|
||||
<span>
|
||||
{previewData.stats.count} {formatMessage({ id: 'specs.injection.files', defaultMessage: 'files' })} • {formatNumber(previewData.stats.totalLength)} {formatMessage({ id: 'specs.injection.characters', defaultMessage: 'characters' })}
|
||||
</span>
|
||||
)}
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{previewLoading ? (
|
||||
<div className="flex items-center justify-center py-8">
|
||||
<Loader2 className="h-6 w-6 animate-spin text-muted-foreground" />
|
||||
</div>
|
||||
) : (
|
||||
<div className="h-[300px] overflow-auto">
|
||||
<div className="space-y-2">
|
||||
{Object.entries(filesByDimension).map(([dim, files]) => (
|
||||
<div key={dim} className="border rounded-lg">
|
||||
<button
|
||||
className="w-full flex items-center justify-between p-3 hover:bg-muted/50 transition-colors"
|
||||
onClick={() => toggleDimension(dim)}
|
||||
>
|
||||
<div className="flex items-center gap-2">
|
||||
{expandedDimensions[dim] ? (
|
||||
<ChevronDown className="h-4 w-4" />
|
||||
) : (
|
||||
<ChevronRight className="h-4 w-4" />
|
||||
)}
|
||||
<span className="font-medium capitalize">
|
||||
{formatMessage({ id: `specs.dimension.${dim}`, defaultMessage: dim })}
|
||||
</span>
|
||||
<Badge variant="secondary" className="text-xs">
|
||||
{files.length}
|
||||
</Badge>
|
||||
</div>
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{formatNumber(files.reduce((sum, f) => sum + f.contentLength, 0))} {formatMessage({ id: 'specs.injection.characters', defaultMessage: 'chars' })}
|
||||
</span>
|
||||
</button>
|
||||
{expandedDimensions[dim] && (
|
||||
<div className="border-t">
|
||||
{files.map((file) => (
|
||||
<div
|
||||
key={file.file}
|
||||
className="flex items-center justify-between p-3 border-b last:border-b-0 hover:bg-muted/30"
|
||||
>
|
||||
<div className="flex items-center gap-3 min-w-0">
|
||||
{file.scope === 'global' ? (
|
||||
<Globe className="h-4 w-4 text-blue-500 flex-shrink-0" />
|
||||
) : (
|
||||
<Folder className="h-4 w-4 text-green-500 flex-shrink-0" />
|
||||
)}
|
||||
<div className="min-w-0">
|
||||
<div className="font-medium truncate">{file.title}</div>
|
||||
<div className="text-xs text-muted-foreground truncate">{file.file}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Badge variant="outline" className="text-xs">
|
||||
{formatMessage({ id: `specs.priority.${file.priority}`, defaultMessage: file.priority })}
|
||||
</Badge>
|
||||
<span className="text-xs text-muted-foreground whitespace-nowrap">
|
||||
{formatNumber(file.contentLength)}
|
||||
</span>
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="h-7 w-7"
|
||||
onClick={() => loadFilePreview(file)}
|
||||
>
|
||||
<Eye className="h-3.5 w-3.5" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* Settings Card */}
|
||||
<Card>
|
||||
<CardHeader>
|
||||
@@ -645,6 +826,23 @@ export function InjectionControlTab({ className }: InjectionControlTabProps) {
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
{/* File Preview Dialog */}
|
||||
<Dialog open={previewDialogOpen} onOpenChange={setPreviewDialogOpen}>
|
||||
<DialogContent className="max-w-3xl max-h-[80vh]">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex items-center gap-2">
|
||||
<FileText className="h-5 w-5" />
|
||||
{previewFile?.title}
|
||||
</DialogTitle>
|
||||
</DialogHeader>
|
||||
<div className="flex-1 overflow-auto">
|
||||
<pre className="text-sm whitespace-pre-wrap p-4 bg-muted rounded-lg">
|
||||
{previewFile?.content || formatMessage({ id: 'specs.content.noContent', defaultMessage: 'No content available' })}
|
||||
</pre>
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7273,6 +7273,8 @@ export interface SpecEntry {
|
||||
priority: 'critical' | 'high' | 'medium' | 'low';
|
||||
keywords: string[];
|
||||
scope: 'global' | 'project';
|
||||
/** Content length (body only, cached for performance) */
|
||||
contentLength: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -7305,6 +7307,54 @@ export async function rebuildSpecIndex(projectPath?: string): Promise<{ success:
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection preview file info
|
||||
*/
|
||||
export interface InjectionPreviewFile {
|
||||
file: string;
|
||||
title: string;
|
||||
dimension: string;
|
||||
category: string;
|
||||
scope: string;
|
||||
readMode: string;
|
||||
priority: string;
|
||||
contentLength: number;
|
||||
content?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Injection preview response
|
||||
*/
|
||||
export interface InjectionPreviewResponse {
|
||||
files: InjectionPreviewFile[];
|
||||
stats: {
|
||||
count: number;
|
||||
totalLength: number;
|
||||
maxLength: number;
|
||||
percentage: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Get injection preview with file list
|
||||
* @param mode - 'required' | 'all' | 'keywords'
|
||||
* @param preview - Include content preview
|
||||
* @param projectPath - Optional project path
|
||||
*/
|
||||
export async function getInjectionPreview(
|
||||
mode: 'required' | 'all' | 'keywords' = 'required',
|
||||
preview: boolean = false,
|
||||
projectPath?: string
|
||||
): Promise<InjectionPreviewResponse> {
|
||||
const params = new URLSearchParams();
|
||||
params.set('mode', mode);
|
||||
params.set('preview', String(preview));
|
||||
if (projectPath) {
|
||||
params.set('path', projectPath);
|
||||
}
|
||||
return fetchApi<InjectionPreviewResponse>(`/api/specs/injection-preview?${params.toString()}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update spec frontmatter (toggle readMode)
|
||||
*/
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
|
||||
"dimension": {
|
||||
"specs": "Project Specs",
|
||||
"personal": "Personal"
|
||||
"personal": "Personal",
|
||||
"roadmap": "Roadmap",
|
||||
"changelog": "Changelog"
|
||||
},
|
||||
|
||||
"scope": {
|
||||
@@ -23,8 +25,10 @@
|
||||
"project": "Project"
|
||||
},
|
||||
"filterByScope": "Filter by scope:",
|
||||
"filterByCategory": "Workflow stage:",
|
||||
|
||||
"category": {
|
||||
"all": "All",
|
||||
"general": "General",
|
||||
"exploration": "Exploration",
|
||||
"planning": "Planning",
|
||||
@@ -43,11 +47,38 @@
|
||||
"install": "Install",
|
||||
"installed": "Installed",
|
||||
"installing": "Installing...",
|
||||
|
||||
"installedHooks": "Installed Hooks",
|
||||
"installedHooksDesc": "Manage your installed hooks configuration",
|
||||
"searchHooks": "Search hooks...",
|
||||
"noHooks": "No hooks installed. Install recommended hooks above.",
|
||||
|
||||
"actions": {
|
||||
"view": "View Content",
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"reset": "Reset",
|
||||
"save": "Save",
|
||||
"saving": "Saving..."
|
||||
},
|
||||
|
||||
"status": {
|
||||
"enabled": "Enabled",
|
||||
"disabled": "Disabled"
|
||||
},
|
||||
|
||||
"readMode": {
|
||||
"required": "Required",
|
||||
"optional": "Optional"
|
||||
},
|
||||
|
||||
"priority": {
|
||||
"critical": "Critical",
|
||||
"high": "High",
|
||||
"medium": "Medium",
|
||||
"low": "Low"
|
||||
},
|
||||
|
||||
"spec": {
|
||||
"edit": "Edit Spec",
|
||||
"toggle": "Toggle Status",
|
||||
@@ -91,37 +122,11 @@
|
||||
"failModeWarn": "Warn"
|
||||
},
|
||||
|
||||
"actions": {
|
||||
"edit": "Edit",
|
||||
"delete": "Delete",
|
||||
"reset": "Reset",
|
||||
"save": "Save",
|
||||
"saving": "Saving...",
|
||||
"view": "View Content"
|
||||
},
|
||||
|
||||
"status": {
|
||||
"enabled": "Enabled",
|
||||
"disabled": "Disabled"
|
||||
},
|
||||
|
||||
"readMode": {
|
||||
"required": "Required",
|
||||
"optional": "Optional"
|
||||
},
|
||||
|
||||
"priority": {
|
||||
"critical": "Critical",
|
||||
"high": "High",
|
||||
"medium": "Medium",
|
||||
"low": "Low"
|
||||
},
|
||||
|
||||
"hooks": {
|
||||
"dialog": {
|
||||
"createTitle": "Create Hook",
|
||||
"editTitle": "Edit Hook",
|
||||
"description": "Configure the hook trigger event, command, and other settings."
|
||||
"description": "Configure hook trigger event, command, and other settings."
|
||||
},
|
||||
"fields": {
|
||||
"name": "Hook Name",
|
||||
@@ -149,9 +154,9 @@
|
||||
"project": "Project"
|
||||
},
|
||||
"failModes": {
|
||||
"continue": "Continue",
|
||||
"warn": "Show Warning",
|
||||
"block": "Block Operation"
|
||||
"continue": "Continue execution",
|
||||
"warn": "Show warning",
|
||||
"block": "Block operation"
|
||||
},
|
||||
"validation": {
|
||||
"nameRequired": "Name is required",
|
||||
@@ -185,7 +190,7 @@
|
||||
"metadata": "Metadata",
|
||||
"markdownContent": "Markdown Content",
|
||||
"noContent": "No content available",
|
||||
"editHint": "Edit the full markdown content including frontmatter. Changes to frontmatter will be reflected in the spec metadata.",
|
||||
"editHint": "Edit the full markdown content including frontmatter. Changes to frontmatter will be reflected in spec metadata.",
|
||||
"placeholder": "# Spec Title\n\nContent here..."
|
||||
},
|
||||
|
||||
@@ -221,10 +226,14 @@
|
||||
"title": "Global Settings",
|
||||
"description": "Configure personal spec defaults and system settings",
|
||||
"personalSpecDefaults": "Personal Spec Defaults",
|
||||
"personalSpecDefaultsDesc": "These settings will be applied when creating new personal specs",
|
||||
"defaultReadMode": "Default Read Mode",
|
||||
"defaultReadModeHelp": "Default read mode for newly created personal specs",
|
||||
"autoEnable": "Auto Enable",
|
||||
"autoEnableDescription": "Automatically enable newly created personal specs"
|
||||
"defaultReadModeHelp": "The default read mode for newly created personal specs",
|
||||
"selectReadMode": "Select read mode",
|
||||
"autoEnable": "Auto Enable New Specs",
|
||||
"autoEnableDescription": "Automatically enable newly created personal specs",
|
||||
"specStatistics": "Spec Statistics",
|
||||
"totalSpecs": "Total: {count} spec files"
|
||||
},
|
||||
|
||||
"dialog": {
|
||||
|
||||
@@ -14,7 +14,9 @@
|
||||
|
||||
"dimension": {
|
||||
"specs": "项目规范",
|
||||
"personal": "个人规范"
|
||||
"personal": "个人规范",
|
||||
"roadmap": "路线图",
|
||||
"changelog": "变更日志"
|
||||
},
|
||||
|
||||
"scope": {
|
||||
@@ -23,8 +25,10 @@
|
||||
"project": "项目"
|
||||
},
|
||||
"filterByScope": "按范围筛选:",
|
||||
"filterByCategory": "工作流阶段:",
|
||||
|
||||
"category": {
|
||||
"all": "全部",
|
||||
"general": "通用",
|
||||
"exploration": "探索",
|
||||
"planning": "规划",
|
||||
@@ -76,7 +80,6 @@
|
||||
},
|
||||
|
||||
"spec": {
|
||||
"view": "查看内容",
|
||||
"edit": "编辑规范",
|
||||
"toggle": "切换状态",
|
||||
"delete": "删除规范",
|
||||
@@ -89,23 +92,6 @@
|
||||
"file": "文件路径"
|
||||
},
|
||||
|
||||
"content": {
|
||||
"edit": "编辑",
|
||||
"view": "查看",
|
||||
"metadata": "元数据",
|
||||
"markdownContent": "Markdown 内容",
|
||||
"noContent": "无内容",
|
||||
"editHint": "编辑完整的 Markdown 内容(包括 frontmatter)。frontmatter 的更改将反映到规范元数据中。",
|
||||
"placeholder": "# 规范标题\n\n内容..."
|
||||
},
|
||||
|
||||
"common": {
|
||||
"cancel": "取消",
|
||||
"save": "保存",
|
||||
"saving": "保存中...",
|
||||
"close": "关闭"
|
||||
},
|
||||
|
||||
"hook": {
|
||||
"install": "安装",
|
||||
"uninstall": "卸载",
|
||||
@@ -137,9 +123,6 @@
|
||||
},
|
||||
|
||||
"hooks": {
|
||||
"installSuccess": "钩子安装成功",
|
||||
"installError": "钩子安装失败",
|
||||
"installAllSuccess": "所有钩子安装成功",
|
||||
"dialog": {
|
||||
"createTitle": "创建钩子",
|
||||
"editTitle": "编辑钩子",
|
||||
@@ -191,6 +174,26 @@
|
||||
"hookFailMode": "命令执行失败时的处理方式"
|
||||
},
|
||||
|
||||
"common": {
|
||||
"cancel": "取消",
|
||||
"save": "保存",
|
||||
"delete": "删除",
|
||||
"edit": "编辑",
|
||||
"reset": "重置",
|
||||
"confirm": "确认",
|
||||
"close": "关闭"
|
||||
},
|
||||
|
||||
"content": {
|
||||
"edit": "编辑",
|
||||
"view": "查看",
|
||||
"metadata": "元数据",
|
||||
"markdownContent": "Markdown 内容",
|
||||
"noContent": "无可用内容",
|
||||
"editHint": "编辑完整的 markdown 内容包括 frontmatter。对 frontmatter 的更改将反映在规范元数据中。",
|
||||
"placeholder": "# 规范标题\n\n内容在这里..."
|
||||
},
|
||||
|
||||
"injection": {
|
||||
"title": "注入控制",
|
||||
"statusTitle": "当前注入状态",
|
||||
@@ -210,23 +213,37 @@
|
||||
"warning": "接近限制",
|
||||
"normal": "正常",
|
||||
"characters": "字符",
|
||||
"chars": "字符",
|
||||
"statsInfo": "统计信息",
|
||||
"requiredLength": "必读规范长度:",
|
||||
"matchedLength": "关键词匹配长度:",
|
||||
"remaining": "剩余空间:",
|
||||
"loadError": "加载统计数据失败",
|
||||
"saveSuccess": "设置已保存",
|
||||
"saveError": "保存设置失败"
|
||||
"saveError": "保存设置失败",
|
||||
"filesList": "注入文件列表",
|
||||
"files": "个文件"
|
||||
},
|
||||
|
||||
"priority": {
|
||||
"critical": "关键",
|
||||
"high": "高",
|
||||
"medium": "中",
|
||||
"low": "低"
|
||||
},
|
||||
|
||||
"settings": {
|
||||
"title": "全局设置",
|
||||
"description": "配置个人规范默认值和系统设置",
|
||||
"personalSpecDefaults": "个人规范默认值",
|
||||
"personalSpecDefaultsDesc": "创建新的个人规范时将应用这些设置",
|
||||
"defaultReadMode": "默认读取模式",
|
||||
"defaultReadModeHelp": "新创建的个人规范的默认读取模式",
|
||||
"autoEnable": "自动启用",
|
||||
"autoEnableDescription": "新创建的个人规范自动启用"
|
||||
"selectReadMode": "选择读取模式",
|
||||
"autoEnable": "自动启用新规范",
|
||||
"autoEnableDescription": "自动启用新创建的个人规范",
|
||||
"specStatistics": "规范统计",
|
||||
"totalSpecs": "总计:{count} 个规范文件"
|
||||
},
|
||||
|
||||
"dialog": {
|
||||
|
||||
Reference in New Issue
Block a user