Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c6138e3
feat(webapp): split the side menu project and organization menus
samejr Jun 28, 2026
f2e8a0e
feat(webapp): dim project menu trigger and add environment tooltip
samejr Jun 28, 2026
440023b
feat(webapp): connect the environment selector to the project menu
samejr Jun 28, 2026
d7c6af0
feat(webapp): size side menu popover items to match the nav items
samejr Jun 29, 2026
3aa2886
feat(webapp): pin the project and environment selectors above the scr…
samejr Jun 30, 2026
e9fe1d0
feat(webapp): make the side menu env switcher a segmented control
samejr Jun 30, 2026
f2a3cbe
feat(webapp): refine side menu selectors and spacing
samejr Jul 2, 2026
8e37da9
feat(webapp): polish the project selector, help menu, and collapsed s…
samejr Jul 2, 2026
2fe465c
feat(webapp): align the project section padding with the nav items
samejr Jul 2, 2026
8f99e6a
Merge remote-tracking branch 'origin/main' into samejr/org-menu-update
samejr Jul 2, 2026
f593730
feat(webapp): add a collapse toggle button to the side menu footer
samejr Jul 2, 2026
d5c39f5
feat(webapp): remove the middle collapse handle in favor of the foote…
samejr Jul 2, 2026
24557d8
fix(webapp): keep the project section bottom padding constant when co…
samejr Jul 2, 2026
0b0f66d
feat(webapp): add an account menu to the side menu header
samejr Jul 3, 2026
26aa1be
feat(webapp): use a custom chain link icon for private connections
samejr Jul 3, 2026
6d701ab
feat(webapp): use the custom avatar icon for the profile picture plac…
samejr Jul 3, 2026
347fabe
feat(webapp): redesign the account profile page with a row-based layout
samejr Jul 3, 2026
0645834
feat(webapp): match the environment selector popover item sizing to t…
samejr Jul 6, 2026
72cd93d
feat(webapp): highlight impersonation mode in the side menu
samejr Jul 6, 2026
c7e7766
feat(webapp): move Settings to the top of the organization settings s…
samejr Jul 6, 2026
ea62538
feat(webapp): align org and account side menu padding with the main s…
samejr Jul 6, 2026
08c2ab7
fix(webapp): match Help & Feedback popover Shortcuts and Contact us i…
samejr Jul 6, 2026
1a574d7
fix(webapp): keep the keyboard shortcut hint on the Help & Feedback S…
samejr Jul 7, 2026
71c540b
feat(webapp): make the side menu resizable by dragging its right edge
samejr Jul 10, 2026
11efa95
feat(webapp): move Ask AI into the Help & Feedback menu
samejr Jul 10, 2026
907288a
feat(webapp): refine the side menu resize handle and trim the Manage …
samejr Jul 10, 2026
aa15a48
feat(webapp): snap side menu button hovers, add Help & Feedback chevron
samejr Jul 10, 2026
aec6288
fix(webapp): only render the Help & Feedback chevron when expanded
samejr Jul 10, 2026
85feda0
fix(webapp): make every side menu item keyboard-focusable in DOM order
samejr Jul 11, 2026
a71886a
fix(webapp): inset the focus ring so it is not clipped
samejr Jul 11, 2026
baeb7bd
Merge origin/main into samejr/org-menu-update
samejr Jul 11, 2026
635c9c7
chore(webapp): use the Tailwind v4 semantic color aliases in the side…
samejr Jul 11, 2026
f990d56
feat(webapp): move New organization to the top of the org switcher
samejr Jul 11, 2026
fc60f13
feat(webapp): move Manage branches to the top of the branches popover
samejr Jul 11, 2026
0c8a1ac
fix(webapp): keep collapsed side menu section items out of the tab order
samejr Jul 12, 2026
3cd5208
chore(webapp): round the focus ring corners one step more
samejr Jul 12, 2026
e8a2007
feat(webapp): use a thinner avatar placeholder on the account and tea…
samejr Jul 12, 2026
654bfc3
feat(webapp): add a 1.25px avatar variant for the team page member rows
samejr Jul 12, 2026
fbc3d88
fix(webapp): hide the secondary side menu buttons while dragging to r…
samejr Jul 12, 2026
93d3364
fix(webapp): keep side menu secondary buttons hidden during a fast drag
samejr Jul 12, 2026
e6cfa95
fix(webapp): stop invisible side menu buttons masking the row icons m…
samejr Jul 12, 2026
2e3d1fb
feat(webapp): fade the org, project, env and help labels in while dra…
samejr Jul 12, 2026
49f6968
fix(webapp): address side menu review feedback (debounce flush, dev b…
samejr Jul 12, 2026
55be043
feat(webapp): fade side menu labels out in place instead of truncating
samejr Jul 13, 2026
2c264d4
fix(webapp): keep the expand button visible while dragging the side m…
samejr Jul 13, 2026
428f103
fix(webapp): animate the side menu scroll body's right padding on col…
samejr Jul 13, 2026
3e10d10
fix(webapp): reserve the side menu scrollbar gutter without breaking …
samejr Jul 13, 2026
b06d18e
feat(webapp): reach the account menu from the collapsed side menu
samejr Jul 13, 2026
289ee72
feat(webapp): show the collapsed Account submenu at the bottom of the…
samejr Jul 13, 2026
43d8ada
fix(webapp): make the admin Cmd+Esc shortcut work globally
samejr Jul 13, 2026
d012cc9
fix(webapp): move the admin shortcut to Cmd+Option+A (Cmd+Esc was unc…
samejr Jul 13, 2026
d6ca3b2
chore(webapp): tighten the side menu code comments
samejr Jul 14, 2026
bf08228
fix(webapp): read impersonation state from useIsImpersonating in Glob…
samejr Jul 14, 2026
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
41 changes: 41 additions & 0 deletions .server-changes/side-menu-project-and-org-menus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
area: webapp
type: improvement
---

Refresh the side menu and account UI:

- Add a new "Project" section above the "Environment" section with a popover
that lists the org's projects (folder icon + checkmark for the selected one)
and a "New project" item at the bottom.
- The top-left menu now shows the organization (avatar + org name, no
project/diagonal divider) and its popover is a clean list of org-level items
(Settings, Usage, Billing with plan badge, Billing alerts, Team, Private
connections, Roles, SSO, Vercel integration, Slack integration, Switch
organization), with a separate account menu button (Profile, Personal Access
Tokens, Security, admin/impersonation, Logout) beside it.
- Match the Environment selector popover's item sizing (icons and labels,
including the branch submenu and its footer) to the Project popover so the two
side-menu menus are visually consistent.
- Redesign the account Profile page (/account) into the Security page's
row-and-divider layout: Profile picture, Full name, Email address, and a
"Receive onboarding emails" toggle on equal-height rows, with a primary Update
button.
- Signal impersonation mode with a yellow side-menu border and a matching
"Stop impersonating" accent.
- Move the Settings item to the top of the organization settings side menu.
- Align the organization settings and account side menus' horizontal padding
with the main side menu, and tighten the "Personal Access Tokens" label so it
no longer truncates.
- Restyle the "Shortcuts" and "Contact us…" entries in the Help & Feedback
popover to match the other menu items (icon size/alignment, dimmed text, text
size).
- Make the main side menu resizable: drag its right edge to set a custom width
(remembered per user), with the labels, headers, and padding transitioning in
real time and a snap to open or collapsed when released below the default
width. Clicking the edge toggles the menu and a tooltip explains both
gestures.

The org loader now exposes whether the RBAC and SSO plugins are installed so the
side menu can gate the Roles and SSO items the same way the settings side menu
does.
23 changes: 19 additions & 4 deletions apps/webapp/app/assets/icons/AvatarCircleIcon.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function AvatarCircleIcon({ className }: { className?: string }) {
function AvatarCircle({ className, strokeWidth }: { className?: string; strokeWidth: number }) {
return (
<svg
className={className}
Expand All @@ -8,13 +8,28 @@ export function AvatarCircleIcon({ className }: { className?: string }) {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<circle cx="12" cy="12" r="9" stroke="currentColor" strokeWidth="2" />
<circle cx="12" cy="9.5" r="2.5" stroke="currentColor" strokeWidth="2" />
<circle cx="12" cy="12" r="9" stroke="currentColor" strokeWidth={strokeWidth} />
<circle cx="12" cy="9.5" r="2.5" stroke="currentColor" strokeWidth={strokeWidth} />
<path
d="M6 19C7.00156 16.6478 9.32233 15 12.0254 15C14.6837 15 16.9724 16.5938 18 18.884"
stroke="currentColor"
strokeWidth="2"
strokeWidth={strokeWidth}
/>
</svg>
);
}

/** User avatar placeholder with a 2px stroke (the default). */
export function AvatarCircleIcon({ className }: { className?: string }) {
return <AvatarCircle className={className} strokeWidth={2} />;
}

/** Thinner 1.5px-stroke variant of {@link AvatarCircleIcon}. */
export function AvatarCircleIconThin({ className }: { className?: string }) {
return <AvatarCircle className={className} strokeWidth={1.5} />;
}

/** Thinnest 1.25px-stroke variant of {@link AvatarCircleIcon}. */
export function AvatarCircleIconExtraThin({ className }: { className?: string }) {
return <AvatarCircle className={className} strokeWidth={1.25} />;
}
27 changes: 27 additions & 0 deletions apps/webapp/app/assets/icons/ChainLinkIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export function ChainLinkIcon({ className }: { className?: string }) {
return (
<svg
className={className}
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M10 19.0004L9.82843 19.1719C8.26634 20.734 5.73368 20.734 4.17158 19.1719L3.82843 18.8288C2.26634 17.2667 2.26633 14.734 3.82843 13.1719L7.17158 9.8288C8.73368 8.2667 11.2663 8.2667 12.8284 9.8288L13.1716 10.1719C13.8252 10.8256 14.2053 11.6491 14.312 12.5004"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M9.68799 12.5004C9.79463 13.3516 10.1748 14.1752 10.8284 14.8288L11.1715 15.1719C12.7336 16.734 15.2663 16.734 16.8284 15.1719L20.1715 11.8288C21.7336 10.2667 21.7336 7.73404 20.1715 6.17194L19.8284 5.8288C18.2663 4.2667 15.7336 4.2667 14.1715 5.8288L14 6.00037"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
22 changes: 22 additions & 0 deletions apps/webapp/app/assets/icons/LeftSideMenuCollapsedIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export function LeftSideMenuCollapsedIcon({ className }: { className?: string }) {
return (
<svg
className={className}
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect x="4" y="4" width="16" height="16" rx="3" stroke="currentColor" strokeWidth="2" />
<rect x="6" y="6" width="2" height="12" rx="1" fill="currentColor" />
<path
d="M12 14.5L14.5 12L12 9.5"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
);
}
44 changes: 44 additions & 0 deletions apps/webapp/app/assets/icons/LeftSideMenuIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import { motion } from "framer-motion";
import { useState } from "react";

export function LeftSideMenuIcon({
className,
hovered: controlledHovered,
}: {
className?: string;
/** Drives the animation when provided (e.g. parent hover); otherwise the icon uses its own hover. */
hovered?: boolean;
}) {
const [internalHovered, setInternalHovered] = useState(false);
const isControlled = controlledHovered !== undefined;
const hovered = isControlled ? controlledHovered : internalHovered;

return (
<svg
className={className}
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
xmlns="http://www.w3.org/2000/svg"
onMouseEnter={isControlled ? undefined : () => setInternalHovered(true)}
onMouseLeave={isControlled ? undefined : () => setInternalHovered(false)}
>
<rect x="4" y="4" width="16" height="16" rx="2" stroke="currentColor" strokeWidth="2" />
{/* Animate a transform (scaleX), not the SVG `width` attr — framer snaps the first animation
of an idle SVG geometry attribute. Left origin collapses the panel right-to-left. */}
<motion.rect
x="6"
y="6"
width="5"
height="12"
rx="1"
fill="currentColor"
initial={false}
style={{ originX: 0 }}
animate={{ scaleX: hovered ? 0.2 : 1 }}
transition={{ duration: 0.3, ease: "easeInOut" }}
/>
</svg>
);
}
133 changes: 101 additions & 32 deletions apps/webapp/app/components/AskAI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ import { useSearchParams } from "@remix-run/react";
import DOMPurify from "dompurify";
import { motion } from "framer-motion";
import { marked } from "marked";
import { useCallback, useEffect, useRef, useState } from "react";
import { type ReactNode, useCallback, useEffect, useRef, useState } from "react";
import { useTypedRouteLoaderData } from "remix-typedjson";
import { AISparkleIcon } from "~/assets/icons/AISparkleIcon";
import { SparkleListIcon } from "~/assets/icons/SparkleListIcon";
import { useFeatures } from "~/hooks/useFeatures";
import { useShortcutKeys } from "~/hooks/useShortcutKeys";
import { type loader } from "~/root";
import { Button } from "./primitives/Buttons";
import { Callout } from "./primitives/Callout";
Expand All @@ -38,6 +39,104 @@ function useKapaWebsiteId() {
return routeMatch?.kapa.websiteId;
}

/** Open/close state for the Ask AI dialog, including the `?aiHelp=` deep-link handling. */
function useAskAIState() {
const [isOpen, setIsOpen] = useState(false);
const [initialQuery, setInitialQuery] = useState<string | undefined>();
const [searchParams, setSearchParams] = useSearchParams();

const openAskAI = useCallback((question?: string) => {
if (question) {
setInitialQuery(question);
} else {
setInitialQuery(undefined);
}
setIsOpen(true);
}, []);

const closeAskAI = useCallback(() => {
setIsOpen(false);
setInitialQuery(undefined);
}, []);

// Handle URL param functionality
useEffect(() => {
const aiHelp = searchParams.get("aiHelp");
if (aiHelp) {
// Delay to avoid hCaptcha bot detection
window.setTimeout(() => openAskAI(aiHelp), 1000);

// Clone instead of mutating in place
const next = new URLSearchParams(searchParams);
next.delete("aiHelp");
setSearchParams(next);
}
}, [searchParams, openAskAI]);

return { isOpen, setIsOpen, initialQuery, openAskAI, closeAskAI };
}
Comment thread
samejr marked this conversation as resolved.

/**
* Hosts Ask AI (Kapa provider, ⌘I shortcut, dialog) for a menu that renders its own trigger. Wrap
* it around the popover, not inside, so the dialog and shortcut survive the popover closing.
* `children` receives the open function, or undefined when Ask AI is unavailable (self-hosted, no
* Kapa website id, or SSR).
*/
export function AskAIRoot({
children,
}: {
children: (openAskAI: (() => void) | undefined) => ReactNode;
}) {
const { isManagedCloud } = useFeatures();
const websiteId = useKapaWebsiteId();

if (!isManagedCloud || !websiteId) {
return <>{children(undefined)}</>;
}

return (
<ClientOnly fallback={<>{children(undefined)}</>}>
{() => <AskAIRootProvider websiteId={websiteId}>{children}</AskAIRootProvider>}
</ClientOnly>
);
}

function AskAIRootProvider({
websiteId,
children,
}: {
websiteId: string;
children: (openAskAI: () => void) => ReactNode;
}) {
const { isOpen, setIsOpen, initialQuery, openAskAI, closeAskAI } = useAskAIState();

useShortcutKeys({
shortcut: { modifiers: ["mod"], key: "i", enabledOnInputElements: true },
action: () => openAskAI(),
});

return (
<KapaProvider
integrationId={websiteId}
callbacks={{
askAI: {
onQuerySubmit: () => openAskAI(),
onAnswerGenerationCompleted: () => openAskAI(),
},
}}
botProtectionMechanism="hcaptcha"
>
{children(() => openAskAI())}
<AskAIDialog
initialQuery={initialQuery}
isOpen={isOpen}
onOpenChange={setIsOpen}
closeAskAI={closeAskAI}
/>
</KapaProvider>
);
}

export function AskAI({ isCollapsed = false }: { isCollapsed?: boolean }) {
const { isManagedCloud } = useFeatures();
const websiteId = useKapaWebsiteId();
Comment thread
samejr marked this conversation as resolved.
Expand Down Expand Up @@ -72,37 +171,7 @@ type AskAIProviderProps = {
};

function AskAIProvider({ websiteId, isCollapsed = false }: AskAIProviderProps) {
const [isOpen, setIsOpen] = useState(false);
const [initialQuery, setInitialQuery] = useState<string | undefined>();
const [searchParams, setSearchParams] = useSearchParams();

const openAskAI = useCallback((question?: string) => {
if (question) {
setInitialQuery(question);
} else {
setInitialQuery(undefined);
}
setIsOpen(true);
}, []);

const closeAskAI = useCallback(() => {
setIsOpen(false);
setInitialQuery(undefined);
}, []);

// Handle URL param functionality
useEffect(() => {
const aiHelp = searchParams.get("aiHelp");
if (aiHelp) {
// Delay to avoid hCaptcha bot detection
window.setTimeout(() => openAskAI(aiHelp), 1000);

// Clone instead of mutating in place
const next = new URLSearchParams(searchParams);
next.delete("aiHelp");
setSearchParams(next);
}
}, [searchParams, openAskAI]);
const { isOpen, setIsOpen, initialQuery, openAskAI, closeAskAI } = useAskAIState();

return (
<KapaProvider
Expand Down
40 changes: 40 additions & 0 deletions apps/webapp/app/components/GlobalShortcuts.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { useNavigate, useSubmit } from "@remix-run/react";
import { useEffect } from "react";
import { useIsImpersonating } from "~/hooks/useOrganizations";
import { useOptionalUser } from "~/hooks/useUser";
import { adminPath } from "~/utils/pathBuilder";

/** App-wide keyboard shortcuts, mounted once at the root so they work everywhere. Renders nothing. */
export function GlobalShortcuts() {
const user = useOptionalUser();
const isImpersonating = useIsImpersonating();
const navigate = useNavigate();
const submit = useSubmit();

const isAdmin = Boolean(user?.admin) || isImpersonating;
Comment on lines +10 to +14

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 GlobalShortcuts admin shortcut only works on org-scoped pages

The GlobalShortcuts component is mounted at the root (app/root.tsx:135) but calls useIsImpersonating() which reads from the routes/_app.orgs.$organizationSlug loader (apps/webapp/app/hooks/useOrganizations.ts:57-63). On pages outside that route (login, account settings, onboarding), the hook safely returns false — so the Cmd+Option+A shortcut to stop impersonating won't fire there. The old impersonation banner was also only in the side menu (org-scoped), so this isn't a regression, but the component's name GlobalShortcuts suggests it should work everywhere. If the intent is truly global stop-impersonation, the impersonation state would need to come from a root-level source (e.g., the root loader's user object or a cookie check).

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.


useEffect(() => {
if (!isAdmin) return;

const onKeyDown = (event: KeyboardEvent) => {
// Admin escape hatch: Cmd+Option+A (Ctrl+Alt+A on Windows) opens the admin dashboard, or stops
// impersonating. Avoids Escape — Chrome/macOS never delivers a keydown for Escape+modifier (why
// the old Cmd+Esc did nothing). Matched on `event.code`, not `event.key`, because Option makes
// "A" report "å" (so a raw listener, not the `event.key`-based useShortcutKeys hook).
if (event.code !== "KeyA" || !event.altKey || !(event.metaKey || event.ctrlKey)) {
return;
}
event.preventDefault();
if (isImpersonating) {
submit(null, { action: "/resources/impersonation", method: "delete" });
} else {
navigate(adminPath());
}
};

document.addEventListener("keydown", onKeyDown);
return () => document.removeEventListener("keydown", onKeyDown);
}, [isAdmin, isImpersonating, navigate, submit]);

return null;
}
Loading