Skip to content

Commit

Code sits second in the rail and on a phone's tab bar: for members who have it, it is the everyday mode

syntaqxcommitted Parentf462963Browse files
3 files+12−110/3 viewed
+5−5
108108 type Tab = { key: string; label: string; to: string; icon: ReactNode; badge?: { count: number; loud: boolean } };
109109
110110 /**
111− * The tab bar along the bottom of a phone: Home, Chat, Agents, Code (Docs,
112− * for a member without Code) and the Inbox, each with what is unread. It
111+ * The tab bar along the bottom of a phone: Home, Code (Docs, for a member
112+ * without Code), Chat, Agents and the Inbox, each with what is unread. It
113113 * steps aside while the keyboard is up and inside a conversation.
114114 */
115115 export function MobileTabBar({ workspace, unread }: { workspace: Membership; unread: { inbox: number; chat: number; mentions: number } }) {
119119 const mode = modeOf(pathname, slug);
120120 const tabs: Tab[] = [
121121 { key: "home", label: "Home", to: `/${slug}/-/home`, icon: <House size={21} /> },
122+ code
123+ ? { key: "code", label: "Code", to: `/${slug}/-/projects`, icon: <Code2 size={21} /> }
124+ : { key: "docs", label: "Docs", to: `/${slug}/-/docs`, icon: <BookOpen size={21} /> },
122125 {
123126 key: "chat",
124127 label: "Chat",
127130 badge: { count: unread.mentions > 0 ? unread.mentions : unread.chat, loud: unread.mentions > 0 },
128131 },
129132 { key: "agents", label: "Agents", to: `/${slug}/-/agents`, icon: <Sparkles size={21} /> },
130− code
131− ? { key: "code", label: "Code", to: `/${slug}/-/projects`, icon: <Code2 size={21} /> }
132− : { key: "docs", label: "Docs", to: `/${slug}/-/docs`, icon: <BookOpen size={21} /> },
133133 { key: "inbox", label: "Inbox", to: "/inbox", icon: <Inbox size={21} />, badge: { count: unread.inbox, loud: true } },
134134 ];
135135 if (isConversation(pathname)) return null;
+5−4
228228
229229 /**
230230 * The rail down the left (docs/WORKSPACE.md, "Shell"): the workspace and
231− * its switcher; Home, Chat, Docs, Agents, Code and the Inbox; then, at the
232− * foot, the workspace itself, help and your account. The mode lit follows
233− * the address. A member without Code access has no Code.
231+ * its switcher; Home, Code, Chat, Docs, Agents and the Inbox; then, at the
232+ * foot, the workspace itself, help and your account. Code sits second: for
233+ * those who have it, it is the everyday mode. The mode lit follows the
234+ * address. A member without Code access has no Code.
234235 */
235236 export function Rail({
236237 user,
251252 const code = hasCodeAccess(workspace);
252253 const modes: Mode[] = [
253254 { key: "home", label: "Home", icon: <House size={19} /> },
255+ ...(code ? [{ key: "code" as const, label: "Code", icon: <Code2 size={19} /> }] : []),
254256 {
255257 key: "chat",
256258 label: "Chat",
259261 },
260262 { key: "docs", label: "Docs", icon: <BookOpen size={19} /> },
261263 { key: "agents", label: "Agents", icon: <Sparkles size={19} /> },
262− ...(code ? [{ key: "code" as const, label: "Code", icon: <Code2 size={19} /> }] : []),
263264 { key: "inbox", label: "Inbox", icon: <Inbox size={19} />, badge: { count: unread.inbox, loud: true } },
264265 ];
265266 const workspaceMode: Mode = { key: "workspace", label: "Workspace", icon: <Building2 size={19} /> };
+2−2
168168 }
169169
170170 /**
171− * The rail's modes (docs/WORKSPACE.md, "Shell"). Home, Chat, Docs, Agents
172− * and Code are where work happens; the Inbox spans them; Workspace is the
171+ * The rail's modes (docs/WORKSPACE.md, "Shell"). Home, Code, Chat, Docs
172+ * and Agents are where work happens; the Inbox spans them; Workspace is the
173173 * workspace itself: its people, money, policies and settings. `account` is
174174 * your own settings, under the avatar. Each has a sidebar of its own, or
175175 * none, and which one is lit follows the address.