diff --git a/src/components/Main/MainView/MessageInput/MessageInput.vue b/src/components/Main/MainView/MessageInput/MessageInput.vue index c80c4aabf..256262601 100644 --- a/src/components/Main/MainView/MessageInput/MessageInput.vue +++ b/src/components/Main/MainView/MessageInput/MessageInput.vue @@ -72,7 +72,7 @@ import useTextStampPickerInvoker from '../composables/useTextStampPickerInvoker' import useAttachments from './composables/useAttachments' import useModifierKey from './composables/useModifierKey' import usePostMessage from './composables/usePostMessage' -import useFocus from './composables/useFocus' +import useFocus from '/@/composables/dom/useFocus' import { useToastStore } from '/@/store/ui/toast' import useMessageInputState from '/@/composables/messageInputState/useMessageInputState' import useMessageInputStateAttachment from '/@/composables/messageInputState/useMessageInputStateAttachment' diff --git a/src/components/Main/NavigationBar/ChannelList/ChannelElement.vue b/src/components/Main/NavigationBar/ChannelList/ChannelElement.vue index bbfeceaf3..4102cc076 100644 --- a/src/components/Main/NavigationBar/ChannelList/ChannelElement.vue +++ b/src/components/Main/NavigationBar/ChannelList/ChannelElement.vue @@ -1,16 +1,11 @@ @@ -60,6 +70,11 @@ import ChannelElementName from './ChannelElementName.vue' import useNotificationState from '../composables/useNotificationState' import { useOpenLink } from '/@/composables/useOpenLink' import useChannelPath from '/@/composables/useChannelPath' +import useFocus from '/@/composables/dom/useFocus' +import { + usePath, + type TypedProps +} from '/@/components/Main/NavigationBar/ChannelList/composables/usePath' const props = withDefaults( defineProps<{ @@ -86,6 +101,11 @@ const isSelected = computed( props.channel.id === primaryView.value.channelId ) +const onChannelHashKeydownEnter = () => { + if (hasChildren.value) { + emit('clickHash', props.channel.id) + } +} const onChannelHashClick = (e: MouseEvent) => { if (hasChildren.value && e.button === LEFT_CLICK_BUTTON) { emit('clickHash', props.channel.id) @@ -100,14 +120,25 @@ const openChannel = (event: MouseEvent) => { openLink(event, channelIdToLink(props.channel.id)) } +const { pathToShow, pathTooltip } = usePath(props as TypedProps) + const notificationState = useNotificationState(toRef(props, 'channel')) const { isHovered, onMouseEnter, onMouseLeave } = useHover() +const { isFocused, onFocus, onBlur } = useFocus() const { isHovered: isHashHovered, onMouseEnter: onHashMouseEnter, onMouseLeave: onHashMouseLeave } = useHover() +const onHashHovered = () => { + onHashMouseEnter() + onMouseEnter() +} +const onHashHoveredLeave = () => { + onHashMouseLeave() + onMouseLeave() +} const isChannelBgHovered = computed( () => isHovered.value && !(hasChildren.value && isHashHovered.value) ) @@ -127,22 +158,36 @@ $bgLeftShift: 8px; &[data-is-inactive] { @include color-ui-secondary; } - &[aria-selected='true'] { + &[data-is-selected] { @include color-accent-primary; } } -.channel { - display: flex; - align-items: center; +.channelContainer { position: relative; + display: flex; height: $elementHeight; + padding-left: 24px; padding-right: 4px; margin-left: $bgLeftShift; z-index: 0; + &[data-is-inactive] { + @include color-ui-secondary; + } + &[aria-current='page'] { + @include color-accent-primary; + } +} +.channel { + display: flex; + align-items: center; + margin-left: $bgLeftShift; + width: calc(100% - $bgLeftShift); } .channelHash { flex-shrink: 0; cursor: pointer; + position: absolute; + left: 0; } .selectedBg { position: absolute; @@ -157,11 +202,12 @@ $bgLeftShift: 8px; pointer-events: none; display: none; - .container[aria-selected='true'] > & { + .container[data-is-selected] > & { @include background-accent-primary; display: block; } - &[data-is-hovered] { + &[data-is-hovered], + &[data-is-focused] { display: block; background: $theme-ui-primary-background; } diff --git a/src/components/Main/NavigationBar/ChannelList/ChannelElementHash.vue b/src/components/Main/NavigationBar/ChannelList/ChannelElementHash.vue index f76346354..4ebcee7f7 100644 --- a/src/components/Main/NavigationBar/ChannelList/ChannelElementHash.vue +++ b/src/components/Main/NavigationBar/ChannelList/ChannelElementHash.vue @@ -1,10 +1,20 @@ -