M: Minor UI improvements

This commit is contained in:
Ivan 2025-08-26 14:00:39 +03:00
parent 79ce6a8720
commit 99312f25ee
6 changed files with 21 additions and 12 deletions

View File

@ -48,6 +48,10 @@ export function ToolbarSearch({ className, total, filtered }: ToolbarSearchProps
return items.some(item => item.owner === userID);
}
function handleSelectUser(userID: number | null) {
setFilterUser(userID);
}
return (
<div className={cn('flex gap-3 border-b text-sm bg-input items-center', className)}>
<div className='ml-3 min-w-18 sm:min-w-30 select-none whitespace-nowrap'>
@ -73,7 +77,7 @@ export function ToolbarSearch({ className, total, filtered }: ToolbarSearchProps
icon={<IconUserSearch size='1.25rem' className={userActive ? 'icon-green' : 'icon-primary'} />}
onClick={userMenu.toggle}
/>
<Dropdown isOpen={userMenu.isOpen}>
<Dropdown isOpen={userMenu.isOpen} margin='mt-1'>
<DropdownButton
text='Я - Владелец'
title='Фильтровать схемы, в которых текущий пользователь является владельцем'
@ -93,7 +97,7 @@ export function ToolbarSearch({ className, total, filtered }: ToolbarSearchProps
className='min-w-60 mx-1 mb-1 cc-hover-bg select-none'
filter={filterNonEmptyUsers}
value={filterUser}
onChange={setFilterUser}
onChange={handleSelectUser}
/>
</Dropdown>
</div>

View File

@ -27,7 +27,7 @@ export function SelectParent({ fullWidth, ...restProps }: SelectParentProps) {
size='2rem'
className='text-primary min-w-8'
data-tooltip-id={globalIDs.tooltip}
data-tooltip-content='Родительский блок содержания'
data-tooltip-content='Родительский блок'
/>
<SelectBlock className={fullWidth ? 'grow' : 'w-70'} {...restProps} />
</div>

View File

@ -74,11 +74,11 @@ export function DlgCreateSchema() {
return (
<ModalForm
header='Создание операции: Пустая КС'
header='Создание операции: Новая схема'
submitText='Создать'
canSubmit={isValid}
onSubmit={event => void handleSubmit(onSubmit)(event)}
className='w-180 px-6 cc-column'
className='w-180 px-6 pb-3 cc-column'
helpTopic={HelpTopic.CC_OSS}
>
<TextInput
@ -88,7 +88,7 @@ export function DlgCreateSchema() {
error={errors.item_data?.title}
/>
<div className='flex gap-6'>
<div className='grid gap-1'>
<div className='flex flex-col justify-between gap-3'>
<TextInput
id='operation_alias' //
label='Сокращение'
@ -113,7 +113,7 @@ export function DlgCreateSchema() {
id='operation_comment' //
label='Описание'
noResize
rows={3}
rows={4}
{...register('item_data.description')}
/>
</div>

View File

@ -102,7 +102,7 @@ export function DlgImportSchema() {
submitText='Создать'
canSubmit={isValid}
onSubmit={event => void handleSubmit(onSubmit)(event)}
className='w-180 px-6 cc-column'
className='w-180 px-6 pb-3 cc-column'
helpTopic={HelpTopic.CC_OSS}
>
<Controller
@ -132,7 +132,7 @@ export function DlgImportSchema() {
error={errors.item_data?.title}
/>
<div className='flex gap-6'>
<div className='grid gap-1'>
<div className='flex flex-col gap-3 justify-between'>
<TextInput
id='operation_alias' //
label='Сокращение'
@ -157,7 +157,7 @@ export function DlgImportSchema() {
<TextArea
id='operation_comment' //
label='Описание'
rows={3}
rows={4}
disabled={!clone_source}
{...register('item_data.description')}
/>

View File

@ -334,7 +334,12 @@ export function OssFlow() {
}
return (
<div tabIndex={-1} className='relative' onMouseMove={showCoordinates ? handleMouseMove : undefined}>
<div
tabIndex={-1}
className='relative'
onMouseMove={showCoordinates ? handleMouseMove : undefined}
onKeyDown={handleKeyDown}
>
{showCoordinates ? <CoordinateDisplay mouseCoords={mouseCoords} className='absolute top-1 right-2' /> : null}
<ContextMenu isOpen={isContextMenuOpen} onHide={hideContextMenu} {...menuProps} />
@ -356,7 +361,6 @@ export function OssFlow() {
{...flowOptions}
className={clsx(!containMovement && 'cursor-relocate')}
height={mainHeight}
onKeyDown={handleKeyDown}
nodes={nodes}
edges={edges}
onNodesChange={onNodesChange}

View File

@ -43,6 +43,7 @@ export function SelectUser({ filter, noAnonymous, placeholder = 'Выбор по
<ComboBox
items={sorted}
placeholder={placeholder}
clearable={true}
idFunc={user => String(user)}
labelValueFunc={user => getUserLabel(user)}
labelOptionFunc={user => getUserLabel(user)}