Minor UI fixes

This commit is contained in:
IRBorisov 2024-06-21 11:16:47 +03:00
parent 55f54b97f7
commit 2f33a140b7
5 changed files with 8 additions and 18 deletions

View File

@ -14,8 +14,9 @@ function ToggleNavigationButton() {
tabIndex={-1} tabIndex={-1}
className={clsx( className={clsx(
'absolute top-0 right-0 z-navigation flex items-center justify-center', 'absolute top-0 right-0 z-navigation flex items-center justify-center',
'clr-btn-nav', 'clr-hover',
'select-none' 'select-none',
'min-h-[2rem]'
)} )}
onClick={toggleNoNavigation} onClick={toggleNoNavigation}
initial={false} initial={false}

View File

@ -7,7 +7,7 @@ import { findAliasAt } from '@/utils/codemirror';
const navigationProducer = (schema: IRSForm, onOpenEdit: (cstID: ConstituentaID) => void) => { const navigationProducer = (schema: IRSForm, onOpenEdit: (cstID: ConstituentaID) => void) => {
return EditorView.domEventHandlers({ return EditorView.domEventHandlers({
click: (event: MouseEvent, view: EditorView) => { click: (event: MouseEvent, view: EditorView) => {
if (!event.ctrlKey) { if (!event.ctrlKey && !event.metaKey) {
return; return;
} }

View File

@ -7,7 +7,7 @@ import { findReferenceAt } from '@/utils/codemirror';
const navigationProducer = (schema: IRSForm, onOpenEdit: (cstID: ConstituentaID) => void) => { const navigationProducer = (schema: IRSForm, onOpenEdit: (cstID: ConstituentaID) => void) => {
return EditorView.domEventHandlers({ return EditorView.domEventHandlers({
click: (event: MouseEvent, view: EditorView) => { click: (event: MouseEvent, view: EditorView) => {
if (!event.ctrlKey) { if (!event.ctrlKey && !event.metaKey) {
return; return;
} }

View File

@ -54,7 +54,7 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
(event: CProps.EventMouse, target: FolderNode) => { (event: CProps.EventMouse, target: FolderNode) => {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
if (event.ctrlKey) { if (event.ctrlKey || event.metaKey) {
navigator.clipboard navigator.clipboard
.writeText(target.getPath()) .writeText(target.getPath())
.then(() => toast.success(information.pathReady)) .then(() => toast.success(information.pathReady))

View File

@ -5,19 +5,16 @@ import { useCallback } from 'react';
import { LocationIcon, SubscribeIcon, VisibilityIcon } from '@/components/DomainIcons'; import { LocationIcon, SubscribeIcon, VisibilityIcon } from '@/components/DomainIcons';
import { IconEditor, IconFilterReset, IconFolder, IconFolderTree, IconOwner } from '@/components/Icons'; import { IconEditor, IconFilterReset, IconFolder, IconFolderTree, IconOwner } from '@/components/Icons';
import BadgeHelp from '@/components/info/BadgeHelp';
import { CProps } from '@/components/props'; import { CProps } from '@/components/props';
import Dropdown from '@/components/ui/Dropdown'; import Dropdown from '@/components/ui/Dropdown';
import DropdownButton from '@/components/ui/DropdownButton'; import DropdownButton from '@/components/ui/DropdownButton';
import MiniButton from '@/components/ui/MiniButton'; import MiniButton from '@/components/ui/MiniButton';
import Overlay from '@/components/ui/Overlay';
import SearchBar from '@/components/ui/SearchBar'; import SearchBar from '@/components/ui/SearchBar';
import SelectorButton from '@/components/ui/SelectorButton'; import SelectorButton from '@/components/ui/SelectorButton';
import { useAuth } from '@/context/AuthContext'; import { useAuth } from '@/context/AuthContext';
import useDropdown from '@/hooks/useDropdown'; import useDropdown from '@/hooks/useDropdown';
import { LocationHead } from '@/models/library'; import { LocationHead } from '@/models/library';
import { HelpTopic } from '@/models/miscellaneous'; import { prefixes } from '@/utils/constants';
import { PARAMETER, prefixes } from '@/utils/constants';
import { describeLocationHead, labelLocationHead } from '@/utils/labels'; import { describeLocationHead, labelLocationHead } from '@/utils/labels';
import { tripleToggleColor } from '@/utils/utils'; import { tripleToggleColor } from '@/utils/utils';
@ -90,7 +87,7 @@ function SearchPanel({
const handleFolderClick = useCallback( const handleFolderClick = useCallback(
(event: CProps.EventMouse) => { (event: CProps.EventMouse) => {
if (event.ctrlKey) { if (event.ctrlKey || event.metaKey) {
toggleFolderMode(); toggleFolderMode();
} else { } else {
headMenu.toggle(); headMenu.toggle();
@ -218,14 +215,6 @@ function SearchPanel({
/> />
) : null} ) : null}
</div> </div>
<Overlay position='top-[-0.75rem] right-0'>
<BadgeHelp
topic={HelpTopic.UI_LIBRARY}
className={clsx(PARAMETER.TOOLTIP_WIDTH, 'text-sm')}
offset={5}
place='right-start'
/>
</Overlay>
</div> </div>
); );
} }