Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
refactor(views): make the sidebar Discord promo a footer row (MUL-5454) (#6138)
Jiayuan Zhang55926c072dca
diff --git a/packages/views/layout/app-sidebar.tsx b/packages/views/layout/app-sidebar.tsxindex 2fb5e9677e..9393b1261e 100644--- a/packages/views/layout/app-sidebar.tsx+++ b/packages/views/layout/app-sidebar.tsx@@ -783,8 +783,11 @@ export function AppSidebar({ topSlot, searchSlot, headerClassName, headerStyle }</SidebarContent><SidebarFooter className="p-2">- <JoinDiscordCard />- <div className="flex justify-end">+ {/* One utility strip: the Discord link takes the leading space the+ help trigger was leaving empty. `justify-end` keeps the trigger+ right-aligned once the Discord link is dismissed. */}+ <div className="flex items-center justify-end gap-1">+ <JoinDiscordCard /><HelpLauncher /></div></SidebarFooter>diff --git a/packages/views/layout/join-discord-card.test.tsx b/packages/views/layout/join-discord-card.test.tsxindex c757610a17..914f9f86ef 100644--- a/packages/views/layout/join-discord-card.test.tsx+++ b/packages/views/layout/join-discord-card.test.tsx@@ -12,7 +12,6 @@ vi.mock("../i18n", () => ({sidebar: {discord_card: {title: "Join our Discord",- description: "Chat with the team and other builders.",dismiss: "Dismiss",},},diff --git a/packages/views/layout/join-discord-card.tsx b/packages/views/layout/join-discord-card.tsxindex 5231f74d7d..b284d2d3d0 100644--- a/packages/views/layout/join-discord-card.tsx+++ b/packages/views/layout/join-discord-card.tsx@@ -7,9 +7,22 @@ import { useDiscordCardDismissed } from "./use-discord-card-dismissed";import { useT } from "../i18n";/**- * Dismissible "Join our Discord" promo pinned to the bottom of the left- * sidebar (above the help launcher). Once dismissed it stays hidden for- * that user on this browser — see {@link useDiscordCardDismissed}.+ * Dismissible "Join our Discord" entry sharing the sidebar footer strip with+ * the help launcher. Once dismissed it stays hidden for that user on this+ * browser — see {@link useDiscordCardDismissed}.+ *+ * Deliberately shaped as a sidebar row, not a bordered card: it matches+ * SidebarMenuButton metrics (h-8 / rounded-md / gap-2 / text-body) and+ * carries no resting border or fill. A dismissible promo is the+ * lowest-priority item in the sidebar, so it must not be drawn heavier than+ * the navigation above it.+ *+ * No external-link arrow, unlike the Help menu's outbound items: sharing one+ * 224px strip with the help trigger leaves 128px for the label, and the arrow+ * plus the dismiss button together overflow that in en (109px) and zh (125px).+ * The dismiss affordance wins because it is a user-facing capability and the+ * arrow is only a hint — the Discord mark already signals the destination.+ * `flex-1 min-w-0` makes the label truncate rather than push the trigger off.*/export function JoinDiscordCard() {const { t } = useT("layout");@@ -19,32 +32,27 @@ export function JoinDiscordCard() {if (dismissed) return null;return (- <div className="relative">+ <div className="group/discord relative min-w-0 flex-1"><ahref={DISCORD_URL}target="_blank"rel="noopener noreferrer"- className="flex items-start gap-2.5 rounded-md border border-sidebar-border bg-sidebar-accent/50 p-2.5 pr-7 transition-colors hover:bg-sidebar-accent"+ className="flex h-8 items-center gap-2 rounded-md px-2 pr-8 text-body text-muted-foreground ring-sidebar-ring outline-hidden transition-colors hover:bg-sidebar-accent/70 hover:text-sidebar-accent-foreground focus-visible:ring-2">- {/* Discord blurple (#5865F2) is the brand mark color — an intentional- exception to the semantic-token rule, like the landing social icons. */}- <DiscordIcon className="mt-px size-4 shrink-0 text-[#5865F2]" />- <span className="min-w-0">- <span className="block text-caption font-medium text-sidebar-foreground">- {t(($) => $.sidebar.discord_card.title)}- </span>- <span className="mt-0.5 block text-micro leading-snug text-muted-foreground">- {t(($) => $.sidebar.discord_card.description)}- </span>+ <DiscordIcon className="size-4 shrink-0" />+ <span className="truncate">+ {t(($) => $.sidebar.discord_card.title)}</span></a>+ {/* Revealed on hover/focus so the resting row stays quiet. Coarse+ pointers get no hover, so keep it permanently visible there. */}<buttontype="button"aria-label={t(($) => $.sidebar.discord_card.dismiss)}onClick={dismiss}- className="absolute top-1.5 right-1.5 flex size-5 items-center justify-center rounded-sm text-muted-foreground transition-colors hover:bg-sidebar-border hover:text-foreground"+ className="absolute inset-y-0 right-1 my-auto flex size-6 cursor-pointer items-center justify-center rounded-sm text-muted-foreground opacity-0 ring-sidebar-ring transition-opacity hover:bg-sidebar-accent hover:text-foreground focus-visible:opacity-100 focus-visible:ring-2 group-hover/discord:opacity-100 [@media(hover:none)]:opacity-100">- <X className="size-3" />+ <X className="size-3.5" /></button></div>);diff --git a/packages/views/locales/en/layout.json b/packages/views/locales/en/layout.jsonindex bf814d15af..a41f4fff26 100644--- a/packages/views/locales/en/layout.json+++ b/packages/views/locales/en/layout.json@@ -56,7 +56,6 @@"unread_overflow": "99+","discord_card": {"title": "Join our Discord",- "description": "Chat with the team and other builders.","dismiss": "Dismiss"}}diff --git a/packages/views/locales/ja/layout.json b/packages/views/locales/ja/layout.jsonindex 9bf755b82a..47e477e41b 100644--- a/packages/views/locales/ja/layout.json+++ b/packages/views/locales/ja/layout.json@@ -56,7 +56,6 @@"unread_overflow": "99+","discord_card": {"title": "Discord に参加",- "description": "チームや他のユーザーと交流しましょう。","dismiss": "閉じる"}}diff --git a/packages/views/locales/ko/layout.json b/packages/views/locales/ko/layout.jsonindex b42412ff0e..31794e761c 100644--- a/packages/views/locales/ko/layout.json+++ b/packages/views/locales/ko/layout.json@@ -56,7 +56,6 @@"unread_overflow": "99+","discord_card": {"title": "Discord 참여하기",- "description": "팀과 다른 사용자들과 교류해 보세요.","dismiss": "닫기"}}diff --git a/packages/views/locales/zh-Hans/layout.json b/packages/views/locales/zh-Hans/layout.jsonindex 983fbc8033..d8dc31bc22 100644--- a/packages/views/locales/zh-Hans/layout.json+++ b/packages/views/locales/zh-Hans/layout.json@@ -56,7 +56,6 @@"unread_overflow": "99+","discord_card": {"title": "加入我们的 Discord",- "description": "和团队及其他用户一起交流。","dismiss": "关闭"}}