revert: remove redundant QuickSwitcher (Ctrl+K already does this better)
The existing SearchModalRenderer (Ctrl+K) is already a polished room/DM switcher with avatars, unread badges, fuzzy search, and keyboard nav. Our QuickSwitcher was an inferior duplicate. Removing it entirely: - Delete QuickSwitcher.tsx - Remove QuickSwitcherFeature from ClientNonUIFeatures - Remove quickSwitcherKey from settingsAtom - Remove Keyboard Shortcuts section from General settings Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,6 @@ import { useSelectedRoom } from '../../hooks/router/useSelectedRoom';
|
||||
import { useInboxNotificationsSelected } from '../../hooks/router/useInbox';
|
||||
import { useMediaAuthentication } from '../../hooks/useMediaAuthentication';
|
||||
import { usePresenceUpdater } from '../../hooks/usePresenceUpdater';
|
||||
import { QuickSwitcher } from '../../components/QuickSwitcher';
|
||||
|
||||
function SystemEmojiFeature() {
|
||||
const [twitterEmoji] = useSetting(settingsAtom, 'twitterEmoji');
|
||||
@@ -262,27 +261,6 @@ function MessageNotifications() {
|
||||
);
|
||||
}
|
||||
|
||||
function QuickSwitcherFeature() {
|
||||
const [open, setOpen] = useState(false);
|
||||
const [quickSwitcherKey] = useSetting(settingsAtom, 'quickSwitcherKey');
|
||||
|
||||
useEffect(() => {
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
if ((e.ctrlKey || e.metaKey) && e.code === quickSwitcherKey) {
|
||||
e.preventDefault();
|
||||
setOpen((prev) => !prev);
|
||||
}
|
||||
};
|
||||
window.addEventListener('keydown', handleKeyDown);
|
||||
return () => {
|
||||
window.removeEventListener('keydown', handleKeyDown);
|
||||
};
|
||||
}, [quickSwitcherKey]);
|
||||
|
||||
if (!open) return null;
|
||||
return <QuickSwitcher onClose={() => setOpen(false)} />;
|
||||
}
|
||||
|
||||
type ClientNonUIFeaturesProps = {
|
||||
children: ReactNode;
|
||||
};
|
||||
@@ -296,7 +274,6 @@ export function ClientNonUIFeatures({ children }: ClientNonUIFeaturesProps) {
|
||||
<PresenceUpdater />
|
||||
<InviteNotifications />
|
||||
<MessageNotifications />
|
||||
<QuickSwitcherFeature />
|
||||
{children}
|
||||
</>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user