Skip to content
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

Dark mode UI overhaul #2481

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
4eb3ded
Refactor workspace sidebar component styles (#2380)
shatfield4 Sep 27, 2024
83ab8a0
New sidebar colors (#2381)
shatfield4 Sep 28, 2024
3adc5e4
Main container color update (#2382)
shatfield4 Sep 28, 2024
cbc4e80
Merge branch 'master' into dark-mode
shatfield4 Sep 30, 2024
d0546a4
Dark mode setup themes (#2411)
shatfield4 Oct 3, 2024
eee99d3
Merge branch 'master' into dark-mode
shatfield4 Oct 3, 2024
4df4742
Settings sidebar UI updates (#2416)
shatfield4 Oct 3, 2024
88f5bb5
fix sidebar resizing/truncate issue on hover
shatfield4 Oct 3, 2024
29eff8a
Dark mode chat window (#2443)
shatfield4 Oct 8, 2024
a2098a7
Dark mode welcome page (#2444)
shatfield4 Oct 9, 2024
a302aab
Dark mode UI for admin and tools pages + mobile view improvements (#2…
shatfield4 Oct 11, 2024
841a837
Dark mode onboarding (#2461)
shatfield4 Oct 12, 2024
6b4ec84
update all modals + normalize styles (#2471)
shatfield4 Oct 15, 2024
ec3cc68
lint
shatfield4 Oct 15, 2024
8cd2d8a
Dark mode privacy & experimental pages (#2479)
shatfield4 Oct 15, 2024
7989861
Merge branch 'master' into dark-mode
shatfield4 Oct 15, 2024
66a81c2
Dark mode login screens (#2483)
shatfield4 Oct 15, 2024
625092b
Workspace preset commands modals dark mode (#2484)
shatfield4 Oct 15, 2024
3678365
merge with master
shatfield4 Oct 15, 2024
351a144
Merge branch 'master' into dark-mode
timothycarambat Oct 15, 2024
83b1949
Merge branch 'master' of github.com:Mintplex-Labs/anything-llm into d…
timothycarambat Oct 16, 2024
5d4d28c
Document pinning modal ui update (#2490)
shatfield4 Oct 16, 2024
5becc1d
Experimental agreement modal dark mode (#2491)
shatfield4 Oct 16, 2024
d8e0c40
Serp options dark mode (#2492)
shatfield4 Oct 16, 2024
212ea7e
field fixes
timothycarambat Oct 16, 2024
acc1baa
merge
timothycarambat Oct 16, 2024
52e96f7
inputs
timothycarambat Oct 17, 2024
c968ca5
dark mode color cleanup
timothycarambat Oct 17, 2024
d8993b9
more text-white fixes
timothycarambat Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
246 changes: 127 additions & 119 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import i18n from "./i18n";
import { PfpProvider } from "./PfpContext";
import { LogoProvider } from "./LogoContext";
import { FullScreenLoader } from "./components/Preloader";
import { ThemeProvider } from "./ThemeContext";

const Main = lazy(() => import("@/pages/Main"));
const InvitePage = lazy(() => import("@/pages/Invite"));
Expand Down Expand Up @@ -74,128 +75,135 @@ export default function App() {
<LogoProvider>
<PfpProvider>
<I18nextProvider i18n={i18n}>
<Routes>
<Route path="/" element={<PrivateRoute Component={Main} />} />
<Route path="/login" element={<Login />} />
<Route
path="/workspace/:slug/settings/:tab"
element={<ManagerRoute Component={WorkspaceSettings} />}
/>
<Route
path="/workspace/:slug"
element={<PrivateRoute Component={WorkspaceChat} />}
/>
<Route
path="/workspace/:slug/t/:threadSlug"
element={<PrivateRoute Component={WorkspaceChat} />}
/>
<Route path="/accept-invite/:code" element={<InvitePage />} />
<ThemeProvider>
<Routes>
<Route path="/" element={<PrivateRoute Component={Main} />} />
<Route path="/login" element={<Login />} />
<Route
path="/workspace/:slug/settings/:tab"
element={<ManagerRoute Component={WorkspaceSettings} />}
/>
<Route
path="/workspace/:slug"
element={<PrivateRoute Component={WorkspaceChat} />}
/>
<Route
path="/workspace/:slug/t/:threadSlug"
element={<PrivateRoute Component={WorkspaceChat} />}
/>
<Route path="/accept-invite/:code" element={<InvitePage />} />

{/* Admin */}
<Route
path="/settings/llm-preference"
element={<AdminRoute Component={GeneralLLMPreference} />}
/>
<Route
path="/settings/transcription-preference"
element={
<AdminRoute Component={GeneralTranscriptionPreference} />
}
/>
<Route
path="/settings/audio-preference"
element={<AdminRoute Component={GeneralAudioPreference} />}
/>
<Route
path="/settings/embedding-preference"
element={
<AdminRoute Component={GeneralEmbeddingPreference} />
}
/>
<Route
path="/settings/text-splitter-preference"
element={
<AdminRoute Component={EmbeddingTextSplitterPreference} />
}
/>
<Route
path="/settings/vector-database"
element={<AdminRoute Component={GeneralVectorDatabase} />}
/>
<Route
path="/settings/agents"
element={<AdminRoute Component={AdminAgents} />}
/>
<Route
path="/settings/event-logs"
element={<AdminRoute Component={AdminLogs} />}
/>
<Route
path="/settings/embed-config"
element={<AdminRoute Component={EmbedConfigSetup} />}
/>
<Route
path="/settings/embed-chats"
element={<AdminRoute Component={EmbedChats} />}
/>
{/* Manager */}
<Route
path="/settings/security"
element={<ManagerRoute Component={GeneralSecurity} />}
/>
<Route
path="/settings/privacy"
element={<AdminRoute Component={PrivacyAndData} />}
/>
<Route
path="/settings/appearance"
element={<ManagerRoute Component={GeneralAppearance} />}
/>
<Route
path="/settings/beta-features"
element={<AdminRoute Component={ExperimentalFeatures} />}
/>
<Route
path="/settings/api-keys"
element={<AdminRoute Component={GeneralApiKeys} />}
/>
<Route
path="/settings/browser-extension"
element={<ManagerRoute Component={GeneralBrowserExtension} />}
/>
<Route
path="/settings/workspace-chats"
element={<ManagerRoute Component={GeneralChats} />}
/>
<Route
path="/settings/invites"
element={<ManagerRoute Component={AdminInvites} />}
/>
<Route
path="/settings/users"
element={<ManagerRoute Component={AdminUsers} />}
/>
<Route
path="/settings/workspaces"
element={<ManagerRoute Component={AdminWorkspaces} />}
/>
{/* Onboarding Flow */}
<Route path="/onboarding" element={<OnboardingFlow />} />
<Route path="/onboarding/:step" element={<OnboardingFlow />} />
{/* Admin */}
<Route
path="/settings/llm-preference"
element={<AdminRoute Component={GeneralLLMPreference} />}
/>
<Route
path="/settings/transcription-preference"
element={
<AdminRoute Component={GeneralTranscriptionPreference} />
}
/>
<Route
path="/settings/audio-preference"
element={<AdminRoute Component={GeneralAudioPreference} />}
/>
<Route
path="/settings/embedding-preference"
element={
<AdminRoute Component={GeneralEmbeddingPreference} />
}
/>
<Route
path="/settings/text-splitter-preference"
element={
<AdminRoute Component={EmbeddingTextSplitterPreference} />
}
/>
<Route
path="/settings/vector-database"
element={<AdminRoute Component={GeneralVectorDatabase} />}
/>
<Route
path="/settings/agents"
element={<AdminRoute Component={AdminAgents} />}
/>
<Route
path="/settings/event-logs"
element={<AdminRoute Component={AdminLogs} />}
/>
<Route
path="/settings/embed-config"
element={<AdminRoute Component={EmbedConfigSetup} />}
/>
<Route
path="/settings/embed-chats"
element={<AdminRoute Component={EmbedChats} />}
/>
{/* Manager */}
<Route
path="/settings/security"
element={<ManagerRoute Component={GeneralSecurity} />}
/>
<Route
path="/settings/privacy"
element={<AdminRoute Component={PrivacyAndData} />}
/>
<Route
path="/settings/appearance"
element={<ManagerRoute Component={GeneralAppearance} />}
/>
<Route
path="/settings/beta-features"
element={<AdminRoute Component={ExperimentalFeatures} />}
/>
<Route
path="/settings/api-keys"
element={<AdminRoute Component={GeneralApiKeys} />}
/>
<Route
path="/settings/browser-extension"
element={
<ManagerRoute Component={GeneralBrowserExtension} />
}
/>
<Route
path="/settings/workspace-chats"
element={<ManagerRoute Component={GeneralChats} />}
/>
<Route
path="/settings/invites"
element={<ManagerRoute Component={AdminInvites} />}
/>
<Route
path="/settings/users"
element={<ManagerRoute Component={AdminUsers} />}
/>
<Route
path="/settings/workspaces"
element={<ManagerRoute Component={AdminWorkspaces} />}
/>
{/* Onboarding Flow */}
<Route path="/onboarding" element={<OnboardingFlow />} />
<Route
path="/onboarding/:step"
element={<OnboardingFlow />}
/>

{/* Experimental feature pages */}
{/* Live Document Sync feature */}
<Route
path="/settings/beta-features/live-document-sync/manage"
element={<AdminRoute Component={LiveDocumentSyncManage} />}
/>
{/* Experimental feature pages */}
{/* Live Document Sync feature */}
<Route
path="/settings/beta-features/live-document-sync/manage"
element={<AdminRoute Component={LiveDocumentSyncManage} />}
/>

<Route
path="/fine-tuning"
element={<AdminRoute Component={FineTuningWalkthrough} />}
/>
</Routes>
<ToastContainer />
<Route
path="/fine-tuning"
element={<AdminRoute Component={FineTuningWalkthrough} />}
/>
</Routes>
<ToastContainer />
</ThemeProvider>
</I18nextProvider>
</PfpProvider>
</LogoProvider>
Expand Down
16 changes: 16 additions & 0 deletions frontend/src/ThemeContext.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React, { createContext, useContext } from "react";
import { useTheme } from "./hooks/useTheme";

const ThemeContext = createContext();

export function ThemeProvider({ children }) {
const themeValue = useTheme();

return (
<ThemeContext.Provider value={themeValue}>{children}</ThemeContext.Provider>
);
}

export function useThemeContext() {
return useContext(ThemeContext);
}
6 changes: 3 additions & 3 deletions frontend/src/components/ChangeWarning/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function ChangeWarningModal({
<h3 className="text-xl font-semibold text-yellow-300">Warning</h3>
</div>
</div>
<div className="w-[550px] p-6 text-white">
<div className="w-[550px] p-6 text-theme-text-primary">
<p>
{warningText}
<br />
Expand All @@ -30,13 +30,13 @@ export default function ChangeWarningModal({
<button
onClick={onClose}
type="button"
className="px-4 py-2 rounded-lg text-white hover:bg-red-500 transition-all duration-300"
className="px-4 py-2 rounded-lg text-theme-text-primary hover:bg-red-500 transition-all duration-300"
>
Cancel
</button>
<button
onClick={onConfirm}
className="transition-all duration-300 border border-slate-200 px-4 py-2 rounded-lg text-white text-sm items-center flex gap-x-2 hover:bg-slate-200 hover:text-slate-800 focus:ring-gray-800"
className="transition-all duration-300 border border-theme-sidebar-border px-4 py-2 rounded-lg text-theme-text-primary text-sm items-center flex gap-x-2 hover:bg-slate-200 hover:text-slate-800 focus:ring-gray-800"
>
Confirm
</button>
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/components/ChatBubble/index.jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React from "react";
import UserIcon from "../UserIcon";
import { userFromStorage } from "@/utils/request";
import { AI_BACKGROUND_COLOR, USER_BACKGROUND_COLOR } from "@/utils/constants";

export default function ChatBubble({ message, type, popMsg }) {
const isUser = type === "user";
const backgroundColor = isUser ? USER_BACKGROUND_COLOR : AI_BACKGROUND_COLOR;

return (
<div className={`flex justify-center items-end w-full ${backgroundColor}`}>
<div
className={`flex justify-center items-end w-full bg-theme-bg-secondary`}
>
<div className={`py-8 px-4 w-full flex gap-x-5 md:max-w-[80%] flex-col`}>
<div className="flex gap-x-5">
<UserIcon
Expand All @@ -17,7 +17,7 @@ export default function ChatBubble({ message, type, popMsg }) {
/>

<span
className={`whitespace-pre-line text-white font-normal text-sm md:text-sm flex flex-col gap-y-1 mt-2`}
className={`whitespace-pre-line text-theme-text-primary font-normal text-sm md:text-sm flex flex-col gap-y-1 mt-2`}
>
{message}
</span>
Expand Down
8 changes: 5 additions & 3 deletions frontend/src/components/ContextualSaveBar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@ export default function ContextualSaveBar({
return (
<div className="fixed top-0 left-0 right-0 h-14 bg-dark-input flex items-center justify-end px-4 z-[999]">
<div className="absolute ml-4 left-0 md:left-1/2 transform md:-translate-x-1/2 flex items-center gap-x-2">
<Warning size={18} className="text-white" />
<p className="text-white font-medium text-xs">Unsaved Changes</p>
<Warning size={18} className="text-theme-text-primary" />
<p className="text-theme-text-primary font-medium text-xs">
Unsaved Changes
</p>
</div>
<div className="flex items-center gap-x-2">
<button
className="border-none text-white font-medium text-sm px-[10px] py-[6px] rounded-md bg-white/5 hover:bg-white/10"
className="border-none text-theme-text-primary font-medium text-sm px-[10px] py-[6px] rounded-md bg-white/5 hover:bg-white/10"
onClick={onCancel}
>
Cancel
Expand Down
Loading