-
Notifications
You must be signed in to change notification settings - Fork 97
feat(ui): 侧栏、底栏与状态指示器多项体验优化 #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -7,9 +7,9 @@ import { IoHandRightSharp } from 'react-icons/io5'; | |||||||||||||||||||||||||||||||||||||||||||
| import { FiChevronDown } from 'react-icons/fi'; | ||||||||||||||||||||||||||||||||||||||||||||
| import { memo } from 'react'; | ||||||||||||||||||||||||||||||||||||||||||||
| import { useTranslation } from 'react-i18next'; | ||||||||||||||||||||||||||||||||||||||||||||
| import { Tooltip } from '@/components/ui/tooltip'; | ||||||||||||||||||||||||||||||||||||||||||||
| import { InputGroup } from '@/components/ui/input-group'; | ||||||||||||||||||||||||||||||||||||||||||||
| import { footerStyles } from './footer-styles'; | ||||||||||||||||||||||||||||||||||||||||||||
| import AIStateIndicator from './ai-state-indicator'; | ||||||||||||||||||||||||||||||||||||||||||||
| import { useFooter } from '@/hooks/footer/use-footer'; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // Type definitions | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -38,40 +38,58 @@ interface MessageInputProps { | |||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| // Reusable components | ||||||||||||||||||||||||||||||||||||||||||||
| const ToggleButton = memo(({ isCollapsed, onToggle }: ToggleButtonProps) => ( | ||||||||||||||||||||||||||||||||||||||||||||
| <Box | ||||||||||||||||||||||||||||||||||||||||||||
| {...footerStyles.footer.toggleButton} | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={onToggle} | ||||||||||||||||||||||||||||||||||||||||||||
| color="whiteAlpha.500" | ||||||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||||||
| transform: isCollapsed ? 'rotate(180deg)' : 'rotate(0deg)', | ||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| <FiChevronDown /> | ||||||||||||||||||||||||||||||||||||||||||||
| </Box> | ||||||||||||||||||||||||||||||||||||||||||||
| )); | ||||||||||||||||||||||||||||||||||||||||||||
| const ToggleButton = memo(({ isCollapsed, onToggle }: ToggleButtonProps) => { | ||||||||||||||||||||||||||||||||||||||||||||
| const { t } = useTranslation(); | ||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||
| <Tooltip content={isCollapsed ? t('tooltip.expandInput') : t('tooltip.collapseInput')} showArrow openDelay={300}> | ||||||||||||||||||||||||||||||||||||||||||||
| <Box | ||||||||||||||||||||||||||||||||||||||||||||
| {...footerStyles.footer.toggleButton} | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={onToggle} | ||||||||||||||||||||||||||||||||||||||||||||
| color="whiteAlpha.500" | ||||||||||||||||||||||||||||||||||||||||||||
| style={{ | ||||||||||||||||||||||||||||||||||||||||||||
| transform: isCollapsed ? 'rotate(180deg)' : 'rotate(0deg)', | ||||||||||||||||||||||||||||||||||||||||||||
| }} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| <FiChevronDown /> | ||||||||||||||||||||||||||||||||||||||||||||
| </Box> | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+45
to
+54
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use a semantic button for the footer collapse toggle. The current clickable ♿ Suggested fix- <Box
+ <Box
+ as="button"
+ type="button"
+ aria-label={isCollapsed ? t('tooltip.expandInput') : t('tooltip.collapseInput')}
{...footerStyles.footer.toggleButton}
onClick={onToggle}
color="whiteAlpha.500"
style={{
transform: isCollapsed ? 'rotate(180deg)' : 'rotate(0deg)',
}}
+ onKeyDown={(e) => {
+ if (e.key === 'Enter' || e.key === ' ') {
+ e.preventDefault();
+ onToggle?.();
+ }
+ }}
>🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| </Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| ToggleButton.displayName = 'ToggleButton'; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| const ActionButtons = memo(({ micOn, onMicToggle, onInterrupt }: ActionButtonsProps) => ( | ||||||||||||||||||||||||||||||||||||||||||||
| <HStack gap={2}> | ||||||||||||||||||||||||||||||||||||||||||||
| <IconButton | ||||||||||||||||||||||||||||||||||||||||||||
| bg={micOn ? 'green.500' : 'red.500'} | ||||||||||||||||||||||||||||||||||||||||||||
| {...footerStyles.footer.actionButton} | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={onMicToggle} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| {micOn ? <BsMicFill /> : <BsMicMuteFill />} | ||||||||||||||||||||||||||||||||||||||||||||
| </IconButton> | ||||||||||||||||||||||||||||||||||||||||||||
| <IconButton | ||||||||||||||||||||||||||||||||||||||||||||
| aria-label="Raise hand" | ||||||||||||||||||||||||||||||||||||||||||||
| bg="yellow.500" | ||||||||||||||||||||||||||||||||||||||||||||
| {...footerStyles.footer.actionButton} | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={onInterrupt} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| <IoHandRightSharp size="24" /> | ||||||||||||||||||||||||||||||||||||||||||||
| </IconButton> | ||||||||||||||||||||||||||||||||||||||||||||
| </HStack> | ||||||||||||||||||||||||||||||||||||||||||||
| )); | ||||||||||||||||||||||||||||||||||||||||||||
| const ActionButtons = memo(({ micOn, onMicToggle, onInterrupt }: ActionButtonsProps) => { | ||||||||||||||||||||||||||||||||||||||||||||
| const { t } = useTranslation(); | ||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||
| <HStack gap={2}> | ||||||||||||||||||||||||||||||||||||||||||||
| <Tooltip content={micOn ? t('tooltip.micOn') : t('tooltip.micOff')} showArrow openDelay={300}> | ||||||||||||||||||||||||||||||||||||||||||||
| <IconButton | ||||||||||||||||||||||||||||||||||||||||||||
| bg={micOn ? 'green.500' : 'red.500'} | ||||||||||||||||||||||||||||||||||||||||||||
| {...footerStyles.footer.actionButton} | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={onMicToggle} | ||||||||||||||||||||||||||||||||||||||||||||
| transition="all 0.15s ease" | ||||||||||||||||||||||||||||||||||||||||||||
| _hover={{ bg: micOn ? 'green.400' : 'red.400', transform: 'scale(1.05)' }} | ||||||||||||||||||||||||||||||||||||||||||||
| _active={{ bg: micOn ? 'green.600' : 'red.600', transform: 'scale(0.88)', boxShadow: micOn ? '0 0 12px rgba(34, 197, 94, 0.6)' : '0 0 12px rgba(239, 68, 68, 0.6)' }} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| {micOn ? <BsMicFill /> : <BsMicMuteFill />} | ||||||||||||||||||||||||||||||||||||||||||||
| </IconButton> | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+66
to
+75
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add an accessible label to the mic toggle button. The mic button is icon-only and currently lacks an explicit accessible name. ♿ Suggested fix <IconButton
+ aria-label={micOn ? t('tooltip.micOn') : t('tooltip.micOff')}
bg={micOn ? 'green.500' : 'red.500'}
{...footerStyles.footer.actionButton}
onClick={onMicToggle}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| </Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||
| <Tooltip content={t('tooltip.raiseHand')} showArrow openDelay={300}> | ||||||||||||||||||||||||||||||||||||||||||||
| <IconButton | ||||||||||||||||||||||||||||||||||||||||||||
| aria-label="Raise hand" | ||||||||||||||||||||||||||||||||||||||||||||
| bg="yellow.500" | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+79
to
+80
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Localize static aria-label strings for action buttons. These labels stay English regardless of language selection; use translation keys for consistency. 🌐 Suggested fix- aria-label="Raise hand"
+ aria-label={t('tooltip.raiseHand')}
...
- aria-label="Attach file"
+ aria-label={t('tooltip.attachFile')}Also applies to: 110-111 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| {...footerStyles.footer.actionButton} | ||||||||||||||||||||||||||||||||||||||||||||
| onClick={onInterrupt} | ||||||||||||||||||||||||||||||||||||||||||||
| transition="all 0.15s ease" | ||||||||||||||||||||||||||||||||||||||||||||
| _hover={{ bg: 'yellow.400', transform: 'scale(1.05)' }} | ||||||||||||||||||||||||||||||||||||||||||||
| _active={{ bg: 'yellow.600', transform: 'scale(0.88)', boxShadow: '0 0 12px rgba(234, 179, 8, 0.6)' }} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| <IoHandRightSharp size="24" /> | ||||||||||||||||||||||||||||||||||||||||||||
| </IconButton> | ||||||||||||||||||||||||||||||||||||||||||||
| </Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||
| </HStack> | ||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| ActionButtons.displayName = 'ActionButtons'; | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -87,13 +105,15 @@ const MessageInput = memo(({ | |||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||
| <InputGroup flex={1}> | ||||||||||||||||||||||||||||||||||||||||||||
| <Box position="relative" width="100%"> | ||||||||||||||||||||||||||||||||||||||||||||
| <IconButton | ||||||||||||||||||||||||||||||||||||||||||||
| aria-label="Attach file" | ||||||||||||||||||||||||||||||||||||||||||||
| variant="ghost" | ||||||||||||||||||||||||||||||||||||||||||||
| {...footerStyles.footer.attachButton} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| <BsPaperclip size="24" /> | ||||||||||||||||||||||||||||||||||||||||||||
| </IconButton> | ||||||||||||||||||||||||||||||||||||||||||||
| <Tooltip content={t('tooltip.attachFile')} showArrow openDelay={300}> | ||||||||||||||||||||||||||||||||||||||||||||
| <IconButton | ||||||||||||||||||||||||||||||||||||||||||||
| aria-label="Attach file" | ||||||||||||||||||||||||||||||||||||||||||||
| variant="ghost" | ||||||||||||||||||||||||||||||||||||||||||||
| {...footerStyles.footer.attachButton} | ||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||
| <BsPaperclip size="24" /> | ||||||||||||||||||||||||||||||||||||||||||||
| </IconButton> | ||||||||||||||||||||||||||||||||||||||||||||
| </Tooltip> | ||||||||||||||||||||||||||||||||||||||||||||
| <Textarea | ||||||||||||||||||||||||||||||||||||||||||||
| value={value} | ||||||||||||||||||||||||||||||||||||||||||||
| onChange={onChange} | ||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -127,12 +147,9 @@ function Footer({ isCollapsed = false, onToggle }: FooterProps): JSX.Element { | |||||||||||||||||||||||||||||||||||||||||||
| <Box {...footerStyles.footer.container(isCollapsed)}> | ||||||||||||||||||||||||||||||||||||||||||||
| <ToggleButton isCollapsed={isCollapsed} onToggle={onToggle} /> | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| <Box pt="0" px="4"> | ||||||||||||||||||||||||||||||||||||||||||||
| <HStack width="100%" gap={4}> | ||||||||||||||||||||||||||||||||||||||||||||
| <Box pt="24px" pb="24px" px="4"> | ||||||||||||||||||||||||||||||||||||||||||||
| <HStack width="100%" gap={3} alignItems="center"> | ||||||||||||||||||||||||||||||||||||||||||||
| <Box> | ||||||||||||||||||||||||||||||||||||||||||||
| <Box mb="1.5"> | ||||||||||||||||||||||||||||||||||||||||||||
| <AIStateIndicator /> | ||||||||||||||||||||||||||||||||||||||||||||
| </Box> | ||||||||||||||||||||||||||||||||||||||||||||
| <ActionButtons | ||||||||||||||||||||||||||||||||||||||||||||
| micOn={micOn} | ||||||||||||||||||||||||||||||||||||||||||||
| onMicToggle={handleMicToggle} | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -36,12 +36,6 @@ function BrowserPanel(): JSX.Element { | |||||||||||||
|
|
||||||||||||||
| return ( | ||||||||||||||
| <Box {...sidebarStyles.browserPanel.container}> | ||||||||||||||
| <Box {...sidebarStyles.browserPanel.header}> | ||||||||||||||
| {browserViewData && ( | ||||||||||||||
| <Text fontSize="sm" color="blue.300">{t('sidebar.browserSession')}</Text> | ||||||||||||||
| )} | ||||||||||||||
| </Box> | ||||||||||||||
|
|
||||||||||||||
| <Tooltip | ||||||||||||||
| showArrow | ||||||||||||||
| content={ | ||||||||||||||
|
|
@@ -57,6 +51,11 @@ function BrowserPanel(): JSX.Element { | |||||||||||||
| onMouseLeave={handleMouseLeave} | ||||||||||||||
| position="relative" | ||||||||||||||
| > | ||||||||||||||
| {browserViewData && ( | ||||||||||||||
| <Box position="absolute" top="8px" left="10px" zIndex={1}> | ||||||||||||||
| <Text fontSize="sm" color="blue.300">{t('sidebar.browserSession')}</Text> | ||||||||||||||
| </Box> | ||||||||||||||
|
Comment on lines
+55
to
+57
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Prevent session label overlay from intercepting iframe clicks. The absolute label on Line 55 sits above the interactive browser view and can steal clicks in that region. Make it non-interactive. 💡 Proposed fix- <Box position="absolute" top="8px" left="10px" zIndex={1}>
+ <Box position="absolute" top="8px" left="10px" zIndex={1} pointerEvents="none">📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||
| )} | ||||||||||||||
| {browserViewData ? ( | ||||||||||||||
| <iframe | ||||||||||||||
| src={browserViewData.debuggerFullscreenUrl} | ||||||||||||||
|
|
||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sync footer handle height changes with subtitle anchor offsets.
Line 24 reduces the collapsed reveal height to
20px, butsrc/renderer/src/App.tsxLine 131 still uses hardcoded subtitle offsets (39px/135px) tuned to the old footer geometry. This can cause subtitle vertical drift between collapsed/expanded states.🤖 Prompt for AI Agents