Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into feat/show-only-enabled-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
derkoe authored Feb 29, 2024
2 parents de27460 + 0d19294 commit e5d279e
Show file tree
Hide file tree
Showing 20 changed files with 32 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
--card-foreground: 222.2 84% 4.9%;
--popover: 0 0% 100%;
--popover-foreground: 222.2 84% 4.9%;
--primary: 136 80% 42%;
--primary: 136 80% 29%;
--primary-foreground: 210 40% 98%;
--secondary: 210 40% 96.1%;
--secondary-foreground: 222.2 47.4% 11.2%;
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat-page/chat-header/document-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const DocumentDetail: FC<Props> = (props) => {
return (
<Sheet>
<SheetTrigger asChild>
<Button variant={"outline"} className="gap-2">
<Button variant={"outline"} className="gap-2" aria-label="Current Chat Documents Menu">
<File size={16} /> {props.chatDocuments.length}
</Button>
</SheetTrigger>
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat-page/chat-header/extension-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const ExtensionDetail: FC<Props> = (props) => {
return (
<Sheet>
<SheetTrigger asChild>
<Button variant={"outline"} className="gap-2" disabled={props.disabled}>
<Button variant={"outline"} className="gap-2" disabled={props.disabled} aria-label="Current Chat Extensions Menu">
<PocketKnife size={16} /> {installedCount} ({totalCount})
</Button>
</SheetTrigger>
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat-page/chat-header/persona-detail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const PersonaDetail: FC<Props> = (props) => {
return (
<Sheet>
<SheetTrigger asChild>
<Button variant={"outline"} size={"icon"}>
<Button variant={"outline"} size={"icon"} aria-label="Current Chat Persona Menu">
<VenetianMask size={16} />
</Button>
</SheetTrigger>
Expand Down
1 change: 1 addition & 0 deletions src/features/chat-page/chat-input/prompt/prompt-slider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export const PromptSlider: FC<SliderProps> = (props) => {
type="button"
variant={"ghost"}
onClick={() => inputPromptStore.openPrompt()}
aria-label="Open prompt library"
>
<Book size={16} />
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat-page/chat-menu/chat-context-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const ChatContextMenu = () => {
{isLoading ? (
<LoadingIndicator isLoading={isLoading} />
) : (
<MoreVertical size={18} />
<MoreVertical size={18} aria-label="Chat Menu Dropdown Menu"/>
)}
</DropdownMenuTrigger>
<DropdownMenuContent side="right" align="start">
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat-page/chat-menu/chat-group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ interface Props extends PropsWithChildren {
export const ChatGroup = (props: Props) => {
return (
<div className="flex flex-col">
<div className="text-sm text-muted-foreground/50 p-3">{props.title}</div>
<div className="text-sm text-muted-foreground p-3">{props.title}</div>
<div>{props.children}</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/features/chat-page/chat-menu/chat-menu-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const ChatMenuItem: FC<ChatMenuItemProps> = (props) => {
{isLoading ? (
<LoadingIndicator isLoading={isLoading} />
) : (
<MoreVertical size={18} />
<MoreVertical size={18} aria-label="Chat Menu Item Dropdown Menu" />
)}
</DropdownMenuTrigger>
<DropdownMenuContent side="right" align="start">
Expand Down
7 changes: 4 additions & 3 deletions src/features/extensions-page/add-extension/add-function.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export const AddFunction = () => {
defaultValue={func.endpointType}
name="endpoint-type[]"
required
>
<SelectTrigger className="w-[80px]">
>
<SelectTrigger className="w-[80px]" aria-label="Select HTTP method for API endpoint">
<SelectValue placeholder="GET" defaultValue={"GET"} />
</SelectTrigger>
<SelectContent>
Expand All @@ -103,8 +103,9 @@ export const AddFunction = () => {
</div>
</div>

<Label>GPT Function call definition (JSON)</Label>
<div className="w-[580px] max-w-[580px]">
<input type="hidden" name="code[]" value={func.code} />
<input type="hidden" name="code[]" value={func.code}/>
<CodeMirror
value={func.code}
lang="json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const EndpointHeaderRow: FC<Props> = (props) => {
headerId: props.header.id,
})
}
aria-label="Remove this header"
>
<Trash size={18} />
</Button>
Expand Down
12 changes: 6 additions & 6 deletions src/features/main-menu/main-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,37 @@ export const MainMenu = async () => {
<MenuBar>
<MenuItemContainer>
<MenuItem tooltip="Home" asChild>
<MenuLink href="/chat">
<MenuLink href="/chat" ariaLabel="Go to the Home page">
<Home {...menuIconProps} />
</MenuLink>
</MenuItem>
<MenuTrayToggle />
</MenuItemContainer>
<MenuItemContainer>
<MenuItem tooltip="Chat">
<MenuLink href="/chat">
<MenuLink href="/chat" ariaLabel="Go to the Chat page">
<MessageCircle {...menuIconProps} />
</MenuLink>
</MenuItem>
<MenuItem tooltip="Persona">
<MenuLink href="/persona">
<MenuLink href="/persona" ariaLabel="Go to the Persona configuration page">
<VenetianMask {...menuIconProps} />
</MenuLink>
</MenuItem>
<MenuItem tooltip="extensions">
<MenuLink href="/extensions">
<MenuLink href="/extensions" ariaLabel="Go to the Extensions configuration page">
<PocketKnife {...menuIconProps} />
</MenuLink>
</MenuItem>
<MenuItem tooltip="prompts">
<MenuLink href="/prompt">
<MenuLink href="/prompt" ariaLabel="Go to the Prompt Library configuration page">
<Book {...menuIconProps} />
</MenuLink>
</MenuItem>
{user.isAdmin && (
<>
<MenuItem tooltip="reporting">
<MenuLink href="/reporting">
<MenuLink href="/reporting" ariaLabel="Go to the Admin reporting" >
<Sheet {...menuIconProps} />
</MenuLink>
</MenuItem>
Expand Down
2 changes: 2 additions & 0 deletions src/features/main-menu/menu-link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ButtonLinkVariant } from "../ui/button";

interface MenuLinkProps {
href: string;
ariaLabel: string;
children: React.ReactNode;
}

Expand All @@ -19,6 +20,7 @@ export const MenuLink: FC<MenuLinkProps> = (props) => {
path.startsWith(props.href) && props.href !== "/" ? "text-primary" : ""
)}
href={props.href}
aria-label={props.ariaLabel}
>
{props.children}
</Link>
Expand Down
3 changes: 3 additions & 0 deletions src/features/main-menu/theme-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,23 @@ export const ThemeToggle = () => {
value="light"
onClick={() => setTheme("light")}
className="flex-1"
title="Light theme"
>
<Sun size={18} />
</TabsTrigger>
<TabsTrigger
value="dark"
onClick={() => setTheme("dark")}
className="flex-1"
title="Dark theme"
>
<Moon size={18} />
</TabsTrigger>
<TabsTrigger
value="system"
onClick={() => setTheme("system")}
className="flex-1"
title="System theme"
>
<Laptop2 size={18} />
</TabsTrigger>
Expand Down
2 changes: 1 addition & 1 deletion src/features/main-menu/user-profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const UserProfile = () => {
/>
</Avatar>
) : (
<CircleUserRound {...menuIconProps} />
<CircleUserRound {...menuIconProps} role="button" />
)}
</DropdownMenuTrigger>
<DropdownMenuContent side="right" className="w-56" align="end">
Expand Down
1 change: 1 addition & 0 deletions src/features/ui/avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const AvatarImage = React.forwardRef<
ref={ref}
className={cn("aspect-square h-full w-full", className)}
{...props}
alt=""
/>
));
AvatarImage.displayName = AvatarPrimitive.Image.displayName;
Expand Down
2 changes: 1 addition & 1 deletion src/features/ui/chat/chat-input-area/attach-file.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const AttachFile = (props: {

return (
<>
<Button size="icon" variant={"ghost"} onClick={handleClick} type="button">
<Button size="icon" variant={"ghost"} onClick={handleClick} type="button" aria-label="Attach file to chat">
<Paperclip size={16} />
</Button>
{/* This file input is hidden, and opens when the Button is clicked */}
Expand Down
2 changes: 2 additions & 0 deletions src/features/ui/chat/chat-input-area/image-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const ImageInput: FC = () => {
<button
className="absolute right-1 top-1 bg-background/20 rounded-full p-[2px]"
onClick={resetFileInput}
aria-label="Remove image from chat input"
>
<X size={12} className="stroke-background" />
</button>
Expand All @@ -51,6 +52,7 @@ export const ImageInput: FC = () => {
variant={"ghost"}
type="button"
onClick={handleButtonClick}
aria-label="Add an image to the chat input"
>
<ImageIcon size={16} />
</Button>
Expand Down
1 change: 1 addition & 0 deletions src/features/ui/chat/chat-input-area/microphone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export const Microphone = (props: {
className={
props.isMicrophoneReady ? "bg-red-400 hover:bg-red-400" : ""
}
aria-label="Microphone for speech input"
>
<Mic size={16} />
</Button>
Expand Down
1 change: 1 addition & 0 deletions src/features/ui/chat/chat-input-area/stop-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const StopChat = (props: { stop: () => void }) => {
type="submit"
variant={"ghost"}
onClick={() => props.stop()}
aria-label="Stop speech readout"
>
<Square size={16} />
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/features/ui/chat/chat-input-area/submit-chat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const SubmitChat = React.forwardRef<
HTMLButtonElement,
React.HTMLAttributes<HTMLButtonElement> // Add ChatInputAreaProps to the type definition
>(({ ...props }, ref) => (
<Button size="icon" type="submit" variant={"ghost"} {...props} ref={ref}>
<Button size="icon" type="submit" variant={"ghost"} {...props} ref={ref} aria-label="Submit chat input">
<Send size={16} />
</Button>
));
Expand Down

0 comments on commit e5d279e

Please sign in to comment.