Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Mintplex-Labs/anything-llm
Browse files Browse the repository at this point in the history
  • Loading branch information
timothycarambat committed Apr 4, 2024
2 parents 0b45401 + 57984fa commit 5ef5373
Show file tree
Hide file tree
Showing 15 changed files with 40 additions and 8 deletions.
1 change: 1 addition & 0 deletions embed/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export default function App() {
<div className={`fixed inset-0 z-50 ${isChatOpen ? "block" : "hidden"}`}>
<div
className={`w-full h-full bg-white md:max-w-[400px] md:max-h-[700px] md:fixed md:bottom-0 md:right-0 md:mb-4 md:mr-4 md:rounded-2xl md:border md:border-gray-300 md:shadow-[0_4px_14px_rgba(0,0,0,0.25)] ${positionClasses[position]}`}
id="anything-llm-chat"
>
{isChatOpen && (
<ChatWindow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const HistoricalMessage = forwardRef(
src={AnythingLLMIcon}
alt="Anything LLM Icon"
className="w-9 h-9 flex-shrink-0 ml-2 mt-2"
id="anything-llm-icon"
/>
)}
<div
Expand All @@ -42,8 +43,8 @@ const HistoricalMessage = forwardRef(
error
? "bg-red-200 rounded-lg mr-[37px] ml-[9px]"
: role === "user"
? embedderSettings.USER_STYLES
: embedderSettings.ASSISTANT_STYLES
? `${embedderSettings.USER_STYLES} anything-llm-user-message`
: `${embedderSettings.ASSISTANT_STYLES} anything-llm-assistant-message`
} shadow-[0_4px_14px_rgba(0,0,0,0.25)]`}
>
<div className="flex">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export default function ChatHistory({ settings = {}, history = [] }) {
weight="bold"
className="text-white/50 w-5 h-5"
onClick={scrollToBottom}
id="scroll-to-bottom-button"
aria-label="Scroll to bottom"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,15 @@ export default function PromptInput({
value={message}
className="cursor-text max-h-[100px] text-[14px] mx-2 py-2 w-full text-black bg-transparent placeholder:text-slate-800/60 resize-none active:outline-none focus:outline-none flex-grow"
placeholder={"Send a message"}
id="message-input"
/>
<button
ref={formRef}
type="submit"
disabled={buttonDisabled}
className="inline-flex justify-center rounded-2xl cursor-pointer text-black group ml-4"
id="send-message-button"
aria-label="Send message"
>
{buttonDisabled ? (
<CircleNotch className="w-4 h-4 animate-spin" />
Expand Down
7 changes: 6 additions & 1 deletion embed/src/components/ChatWindow/Header/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ export default function ChatWindowHeader({
}, [menuRef]);

return (
<div className="flex items-center relative rounded-t-2xl bg-black/10">
<div
className="flex items-center relative rounded-t-2xl bg-black/10"
id="anything-llm-header"
>
<div className="flex justify-center items-center w-full h-[76px]">
<img
style={{ maxWidth: 48, maxHeight: 48 }}
Expand All @@ -59,6 +62,7 @@ export default function ChatWindowHeader({
type="button"
onClick={() => setShowOptions(!showingOptions)}
className="hover:bg-gray-100 rounded-sm text-slate-800"
aria-label="Options"
>
<DotsThreeOutlineVertical size={20} weight="fill" />
</button>
Expand All @@ -67,6 +71,7 @@ export default function ChatWindowHeader({
type="button"
onClick={closeChat}
className="hover:bg-gray-100 rounded-sm text-slate-800"
aria-label="Close"
>
<X size={20} weight="bold" />
</button>
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/embed/anythingllm-chat-widget.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions frontend/src/components/Footer/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export default function Footer() {
target="_blank"
rel="noreferrer"
className="transition-all duration-300 p-2 rounded-full text-white bg-sidebar-button hover:bg-menu-item-selected-gradient hover:border-slate-100 hover:border-opacity-50 border-transparent border"
aria-label="Find us on Github"
>
<GithubLogo weight="fill" className="h-5 w-5 " />
</a>
Expand All @@ -60,6 +61,7 @@ export default function Footer() {
target="_blank"
rel="noreferrer"
className="transition-all duration-300 p-2 rounded-full text-white bg-sidebar-button hover:bg-menu-item-selected-gradient hover:border-slate-100 hover:border-opacity-50 border-transparent border"
aria-label="Docs"
>
<BookOpen weight="fill" className="h-5 w-5 " />
</a>
Expand All @@ -68,6 +70,7 @@ export default function Footer() {
target="_blank"
rel="noreferrer"
className="transition-all duration-300 p-2 rounded-full text-white bg-sidebar-button hover:bg-menu-item-selected-gradient hover:border-slate-100 hover:border-opacity-50 border-transparent border"
aria-label="Join our Discord server"
>
<DiscordLogo
weight="fill"
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/components/SettingsButton/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function SettingsButton() {
<Link
to={paths.home()}
className="transition-all duration-300 p-2 rounded-full text-white bg-sidebar-button hover:bg-menu-item-selected-gradient hover:border-slate-100 hover:border-opacity-50 border-transparent border"
aria-label="Home"
>
<ArrowUUpLeft className="h-5 w-5" weight="fill" />
</Link>
Expand All @@ -24,6 +25,7 @@ export default function SettingsButton() {
<Link
to={!!user?.role ? paths.settings.system() : paths.settings.appearance()}
className="transition-all duration-300 p-2 rounded-full text-white bg-sidebar-button hover:bg-menu-item-selected-gradient hover:border-slate-100 hover:border-opacity-50 border-transparent border"
aria-label="Settings"
>
<Wrench className="h-5 w-5" weight="fill" />
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ export default function ThreadItem({
: paths.workspace.thread(slug, thread.slug);

return (
<div className="w-full relative flex h-[38px] items-center border-none hover:bg-slate-600/20 rounded-lg">
<div
className="w-full relative flex h-[38px] items-center border-none hover:bg-slate-600/20 rounded-lg"
role="listitem"
>
{/* Curved line Element and leader if required */}
<div
style={{ width: THREAD_CALLOUT_DETAIL_WIDTH / 2 }}
Expand Down Expand Up @@ -63,6 +66,7 @@ export default function ThreadItem({
<a
href={window.location.pathname === linkTo ? "#" : linkTo}
className="w-full"
aria-current={isActive ? "page" : ""}
>
<p
className={`text-left text-sm ${
Expand All @@ -79,6 +83,7 @@ export default function ThreadItem({
<button
type="button"
onClick={() => setShowOptions(!showOptions)}
aria-label="Thread options"
>
<DotsThree className="text-slate-300" size={25} />
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function ThreadContainer({ workspace }) {
? threads.findIndex((thread) => thread?.slug === threadSlug) + 1
: 0;
return (
<div className="flex flex-col">
<div className="flex flex-col" role="list" aria-label="Threads">
<ThreadItem
idx={0}
activeIdx={activeThreadIdx}
Expand Down
7 changes: 5 additions & 2 deletions frontend/src/components/Sidebar/ActiveWorkspaces/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function ActiveWorkspaces() {
}

return (
<>
<div role="list" aria-label="Workspaces">
{workspaces.map((workspace) => {
const isActive = workspace.slug === slug;
const isHovered = hoverStates[workspace.id];
Expand All @@ -82,13 +82,15 @@ export default function ActiveWorkspaces() {
onMouseEnter={() => handleMouseEnter(workspace.id)}
onMouseLeave={() => handleMouseLeave(workspace.id)}
key={workspace.id}
role="listitem"
>
<div
key={workspace.id}
className="flex gap-x-2 items-center justify-between"
>
<a
href={isActive ? null : paths.workspace.chat(workspace.slug)}
aria-current={isActive ? "page" : ""}
className={`
transition-all duration-[200ms]
flex flex-grow w-[75%] gap-x-2 py-[6px] px-[12px] rounded-[4px] text-white justify-start items-center
Expand Down Expand Up @@ -154,6 +156,7 @@ export default function ActiveWorkspaces() {
onMouseEnter={() => handleGearMouseEnter(workspace.id)}
onMouseLeave={() => handleGearMouseLeave(workspace.id)}
className="rounded-md flex items-center justify-center text-[#A7A8A9] hover:text-white ml-auto"
aria-label="General appearance settings"
>
<div className="flex hover:bg-[#646768] p-[2px] rounded-[4px]">
<GearSix
Expand Down Expand Up @@ -186,6 +189,6 @@ export default function ActiveWorkspaces() {
providedSlug={selectedWs ? selectedWs.slug : null}
/>
)}
</>
</div>
);
}
2 changes: 2 additions & 0 deletions frontend/src/components/Sidebar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function Sidebar() {
<Link
to={paths.home()}
className="flex shrink-0 max-w-[55%] items-center justify-start mx-[38px] my-[18px]"
aria-label="Home"
>
<img
src={logo}
Expand Down Expand Up @@ -104,6 +105,7 @@ export function SidebarMobileHeader() {
className="rounded-md p-2 flex items-center justify-center text-slate-200"
>
<List className="h-6 w-6" />
aria-label="Show sidebar"
</button>
<div className="flex items-center justify-center flex-grow">
<img
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function FeedbackButton({
data-tooltip-id={tooltipId}
data-tooltip-content={tooltipContent}
className="text-zinc-300"
aria-label={tooltipContent}
>
<IconComponent
size={18}
Expand Down Expand Up @@ -86,6 +87,7 @@ function CopyMessage({ message }) {
data-tooltip-id="copy-assistant-text"
data-tooltip-content="Copy"
className="text-zinc-300"
aria-label="Copy"
>
{copied ? (
<Check size={18} className="mb-1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export default function StopGenerationButton() {
data-tooltip-id="stop-generation-button"
data-tooltip-content="Stop generating response"
className="border-none text-white/60 cursor-pointer group"
aria-label="Stop generating"
>
<svg
width="28"
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/pages/OnboardingFlow/Steps/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ export function OnboardingLayout({ children }) {
disabled={backBtn.disabled}
onClick={backBtn.onClick}
className="group p-2 rounded-lg border-2 border-zinc-300 disabled:border-zinc-600 h-fit w-fit disabled:not-allowed hover:bg-zinc-100 disabled:hover:bg-transparent"
aria-label="Back"
>
<ArrowLeft
className="text-white group-hover:text-black group-disabled:text-gray-500"
Expand Down Expand Up @@ -127,6 +128,7 @@ export function OnboardingLayout({ children }) {
disabled={forwardBtn.disabled}
onClick={forwardBtn.onClick}
className="group p-2 rounded-lg border-2 border-zinc-300 disabled:border-zinc-600 h-fit w-fit disabled:not-allowed hover:bg-zinc-100 disabled:hover:bg-transparent"
aria-label="Continue"
>
<ArrowRight
className="text-white group-hover:text-black group-disabled:text-gray-500"
Expand Down

0 comments on commit 5ef5373

Please sign in to comment.