Update aria accesiblity controls

This commit is contained in:
Nate Kelley 2025-07-11 16:18:31 -06:00
parent c2dee1e5be
commit 9f44595712
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
3 changed files with 7 additions and 7 deletions

View File

@ -3,7 +3,6 @@
import React, {
useCallback,
useEffect,
useLayoutEffect,
useRef,
useState,
useImperativeHandle,
@ -793,3 +792,4 @@ const AppSplitterBase = forwardRef<
export const AppSplitter = React.memo(AppSplitterWrapper);
AppSplitter.displayName = 'AppSplitter';
AppSplitterBase.displayName = 'AppSplitterBase';

View File

@ -152,6 +152,7 @@ function SelectComponent<T = string>({
const [isFocused, setIsFocused] = React.useState(false);
const inputRef = React.useRef<HTMLInputElement>(null);
const commandRef = React.useRef<HTMLDivElement>(null);
const listboxId = React.useId();
const open = controlledOpen !== undefined ? controlledOpen : internalOpen;
@ -342,6 +343,7 @@ function SelectComponent<T = string>({
type="text"
role="combobox"
aria-expanded={open}
aria-controls={listboxId}
aria-label={placeholder}
disabled={disabled || loading}
value={inputDisplayValue}
@ -398,7 +400,7 @@ function SelectComponent<T = string>({
aria-hidden="true"
/>
<div className="scrollbar-hide max-h-[300px] overflow-y-auto">
<CommandList className="p-1">
<CommandList id={listboxId} className="p-1">
<CommandEmpty>{emptyMessage}</CommandEmpty>
{renderedItems}
</CommandList>

View File

@ -41,11 +41,9 @@ export const ChatLayout: React.FC<ChatSplitterProps> = ({ children }) => {
const mounted = true;
const bustStorageOnInit = (preservedSideValue: number | null, containerSize: number) => {
console.log('bustStorageOnInit', autoSaveId, preservedSideValue, {
selectedLayout,
secondaryFileView,
containerSize
});
if (containerSize && !preservedSideValue) {
return true;
}
return selectedLayout === 'chat-only' || selectedLayout === 'file-only' || !!secondaryFileView;
};