mirror of
https://github.com/OFFIS-ESC/constellation-analyzer
synced 2026-01-27 07:43:41 +00:00
refactor: remove non-functional Ctrl+A select-all shortcut
Removes the Ctrl+A keyboard shortcut and associated select-all functionality that was not working properly. Changes: - Remove select-all shortcut definition from useGlobalShortcuts - Remove "Select All" menu item from View menu - Remove handleSelectAll stub function from App.tsx - Clean up onSelectAll prop from MenuBar component The select-all feature was dysfunctional (only logging to console) and not properly implemented, so it has been removed entirely. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
3ab90e5dd3
commit
9d3dfff64a
3 changed files with 1 additions and 32 deletions
|
|
@ -75,12 +75,6 @@ function AppContent() {
|
||||||
fitView({ padding: 0.2, duration: 300 });
|
fitView({ padding: 0.2, duration: 300 });
|
||||||
}, [fitView]);
|
}, [fitView]);
|
||||||
|
|
||||||
const handleSelectAll = useCallback(() => {
|
|
||||||
// This will be implemented in GraphEditor
|
|
||||||
// For now, we'll just document it
|
|
||||||
console.log("Select All - to be implemented");
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Setup global keyboard shortcuts
|
// Setup global keyboard shortcuts
|
||||||
useGlobalShortcuts({
|
useGlobalShortcuts({
|
||||||
onUndo: undo,
|
onUndo: undo,
|
||||||
|
|
@ -89,7 +83,6 @@ function AppContent() {
|
||||||
onOpenDocumentManager: () => setShowDocumentManager(true),
|
onOpenDocumentManager: () => setShowDocumentManager(true),
|
||||||
onOpenHelp: () => setShowKeyboardHelp(true),
|
onOpenHelp: () => setShowKeyboardHelp(true),
|
||||||
onFitView: handleFitView,
|
onFitView: handleFitView,
|
||||||
onSelectAll: handleSelectAll,
|
|
||||||
onFocusSearch: () => leftPanelRef.current?.focusSearch(),
|
onFocusSearch: () => leftPanelRef.current?.focusSearch(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -133,7 +126,6 @@ function AppContent() {
|
||||||
<MenuBar
|
<MenuBar
|
||||||
onOpenHelp={() => setShowKeyboardHelp(true)}
|
onOpenHelp={() => setShowKeyboardHelp(true)}
|
||||||
onFitView={handleFitView}
|
onFitView={handleFitView}
|
||||||
onSelectAll={handleSelectAll}
|
|
||||||
onExport={exportCallbackRef.current || undefined}
|
onExport={exportCallbackRef.current || undefined}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,10 @@ import type { ExportOptions } from '../../utils/graphExport';
|
||||||
interface MenuBarProps {
|
interface MenuBarProps {
|
||||||
onOpenHelp?: () => void;
|
onOpenHelp?: () => void;
|
||||||
onFitView?: () => void;
|
onFitView?: () => void;
|
||||||
onSelectAll?: () => void;
|
|
||||||
onExport?: (format: 'png' | 'svg', options?: ExportOptions) => Promise<void>;
|
onExport?: (format: 'png' | 'svg', options?: ExportOptions) => Promise<void>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const MenuBar: React.FC<MenuBarProps> = ({ onOpenHelp, onFitView, onSelectAll, onExport }) => {
|
const MenuBar: React.FC<MenuBarProps> = ({ onOpenHelp, onFitView, onExport }) => {
|
||||||
const [activeMenu, setActiveMenu] = useState<string | null>(null);
|
const [activeMenu, setActiveMenu] = useState<string | null>(null);
|
||||||
const [showDocumentManager, setShowDocumentManager] = useState(false);
|
const [showDocumentManager, setShowDocumentManager] = useState(false);
|
||||||
const [showNodeConfig, setShowNodeConfig] = useState(false);
|
const [showNodeConfig, setShowNodeConfig] = useState(false);
|
||||||
|
|
@ -415,18 +414,6 @@ const MenuBar: React.FC<MenuBarProps> = ({ onOpenHelp, onFitView, onSelectAll, o
|
||||||
<span className="text-xs text-gray-400">{getShortcutLabel('fit-view')}</span>
|
<span className="text-xs text-gray-400">{getShortcutLabel('fit-view')}</span>
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
<button
|
|
||||||
onClick={() => {
|
|
||||||
onSelectAll?.();
|
|
||||||
closeMenu();
|
|
||||||
}}
|
|
||||||
className="w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 flex items-center justify-between"
|
|
||||||
>
|
|
||||||
<span>Select All</span>
|
|
||||||
{getShortcutLabel('select-all') && (
|
|
||||||
<span className="text-xs text-gray-400">{getShortcutLabel('select-all')}</span>
|
|
||||||
)}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ interface UseGlobalShortcutsOptions {
|
||||||
onRedo?: () => void;
|
onRedo?: () => void;
|
||||||
onOpenHelp?: () => void;
|
onOpenHelp?: () => void;
|
||||||
onFitView?: () => void;
|
onFitView?: () => void;
|
||||||
onSelectAll?: () => void;
|
|
||||||
onFocusSearch?: () => void;
|
onFocusSearch?: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -143,15 +142,6 @@ export function useGlobalShortcuts(options: UseGlobalShortcutsOptions = {}) {
|
||||||
},
|
},
|
||||||
|
|
||||||
// Selection
|
// Selection
|
||||||
{
|
|
||||||
id: "select-all",
|
|
||||||
description: "Select All",
|
|
||||||
key: "a",
|
|
||||||
ctrl: true,
|
|
||||||
handler: () => options.onSelectAll?.(),
|
|
||||||
category: "Selection",
|
|
||||||
enabled: !!options.onSelectAll,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
id: "deselect-all",
|
id: "deselect-all",
|
||||||
description: "Deselect All",
|
description: "Deselect All",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue