Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
20 changes: 11 additions & 9 deletions apps/mobile/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ References: [Apple toolbars](https://developer.apple.com/design/human-interface-

## Chats source navigation (#2194)

Chats uses the same canvas and left-aligned title treatment as Activity. The title/chevron opens the workspace drawer; Settings remains on the right. Directly below, a reusable native pager presents a horizontally scrolling **All → Computer → Organization** strip. Selecting a tab or swiping the list changes only the device-local browsing scope. Stable directory order, including empty member Organizations and channel-only guest Organizations, is independent of message arrival. Labels use local Computer names; keys retain full source/account identity. Each tab stays on one line with a bounded width and tail-ellipsized label; the source icon never shrinks. Service URLs do not add a second line. Full source/account identity remains in accessibility labels and the source drawer.
Chats uses the same canvas and left-aligned title treatment as Activity. The title/chevron opens the workspace drawer; Settings remains on the right. Directly below, a reusable native pager presents a horizontally scrolling **All → Computer → Organization** strip. Selecting a tab or swiping the list changes only the device-local browsing scope. Stable directory order, including empty member Organizations and channel-only guest Organizations, is independent of message arrival. Labels use local Computer names; keys retain full source/account identity. Each tab stays on one line with a bounded width and tail-ellipsized label; the source icon leads the label and never shrinks. The Computer tab's icon is that Computer's chosen icon; when the Computer has a chosen colour, the icon (while selected) and the tab underline use it, and other tabs keep the theme accent underline. Service URLs do not add a second line. Full source/account identity remains in accessibility labels and the source drawer.

This first slice retains one active Computer plus authorized Organizations. It does not implement simultaneous multiple-Computer connections. Search and creation remain in their existing list-header placement until #2195/#2196. Activity inherits scope and keeps action/replies/unread paging; unsupported Cloud scope has an explicit notice and no borrowed Computer badge. All discloses that Cloud activity is not yet included. Source-owned history, credentials, drafts, permissions and send paths stay unchanged.

The older Host-band description below records prior presentation/customization behavior. The Chats Header and environment selector above supersede that entry layout; saved Computer customization remains available in the drawer.
The older Host-band description below records prior presentation behavior. The Chats Header and environment selector above supersede that entry layout; Computer customization (name, icon, colour) remains available in the drawer.

## Structure

Expand All @@ -68,17 +68,19 @@ The shell is set by [ADR-0211](../../docs/adr/0211-the-mobile-app-has-two-tabs-w
- The app stays connected to every paired Host at once.
- The Chats list and every chat show one Host at a time. The Chats header has a Slack-style band in the accent colour (a muted accent in dark mode); the list sits on a panel with rounded top corners below it.
- The **Host chip** at the top left shows the Host's initial tile, its name and ▾. Tapping it opens the shared **workspace drawer**.
- **Customize computer** sets how each Host looks, kept on the phone per Host. It is a form sheet with a live preview of the band, opened from that Host's ⋯ menu in the Host drawer (or a long press on its row), so each paired Host is customized where it is listed.
- Name: a local name shown in the Host chip and the drawer instead of the Host's own name; clearing it goes back to the Host's name.
- Avatar: the initial tile (default), one of eight pixel portraits from the PersonaBot avatar generator, or a photo cropped square.
- Banner: the accent band (default), a solid colour (ten swatches or a typed hex), a two-stop gradient (six presets or typed stops), or a picture under a dark scrim.
- A custom colour goes through the accent band's steps, so dark mode mutes it the same way. The ink is white or near-black, whichever reads on every stop; a picture always takes white ink with a soft shadow.
- **Customize computer** sets how each Host looks, kept on the phone per Host. It is a form sheet with the shared `DrawerHeader` (× close, centred title), opened from that Host's ⋯ menu in the Host drawer (or a long press on its row). Changes apply immediately; there is no confirm.
- Preview: the Chats environment strip in miniature (All, then this Computer's tab with its icon, name and underline), so the result is judged where it shows.
- Name: a local name shown in the Chats tab and the drawer instead of the Host's own name; clearing it goes back to the Host's name.
- Icon: a `Segmented` switch between **Symbols** (18 native symbols, SF Symbols on iOS and Material Symbols on Android, the desktop symbol by default) and **Emoji** (18 presets), on a `raised` card of round 44pt targets. There are no photos or free-form avatars: the icon only has to tell Computers apart in the tab strip and the drawer.
- Colour: **Theme colour** (default) or one of ten system colours (blue, indigo, purple, pink, red, orange, yellow, green, teal, graphite) with light and dark values. The colour moves toward `fg` until it reaches 3:1 against `base`, so yellow and graphite stay visible. It tints the icon, the drawer tile (a soft wash of the colour) and the Chats tab underline. The header never takes a custom fill.
- Reset to default is a danger row in its own group and asks first.
- Looks saved before icons existed migrate on first read: a solid banner colour, or a gradient's first stop, becomes the nearest preset colour; avatars and banner pictures are dropped and their files deleted.
- **Workspace drawer** switches between paired Computers and Cloud organization workspaces. It slides in from the left, covers about 85% of the width and dims the list behind it.
- On iOS 26, unless Reduce Transparency is on, it is a floating Liquid Glass sidebar: inset `sidebar.inset` from the screen's left, top and bottom edges with `sidebar.radius` corners concentric with the display. Its rows are clear; a pressed row and the current Computer or workspace show a `radius.lg` highlight inset from the sidebar's edges, as iOS sidebars do. The pairing card is frosted. A Computer's ⋯ opens a native pull-down menu anchored to it (Customize, Show this computer, Unpair); a long press on the row still opens the action sheet. Older iOS, Reduce Transparency and Android keep the opaque full-height drawer.
- Rounded **Computers / Cloud** tabs are the first row above one scrolling list, with no duplicate title or close button. Opening the drawer selects the current route's tab; switching tabs only changes the list, never the active computer or cloud session. Android uses opaque raised chips; iOS uses the existing glass material with Reduce Transparency, older OS and large-text fallbacks. Tabs expose their selected state to accessibility.
- One contextual plus action sits directly below the tabs, above the scrolling list: Computers opens **Pair a new computer** directly; Cloud opens **Join by link or QR** directly. There is no mixed action chooser or stacked icon group. Organization creation and service configuration live under **Manage cloud services** on the Cloud tab; Notifications stays at the bottom of a fixed footer on both tabs; Cloud service management sits above it. Only the directory scrolls.
- A cloud service is an instance/address; its organization is a cloud workspace; a channel belongs to that organization. An invitation already identifies its service and scope: workspace membership or access to only one channel. The existing preview and acceptance flow keeps this distinction explicit. No separate server-selection step or new authorization store is introduced.
- Each Host row has its Computer avatar tile (the same tile as the Host chip; the current Host's tile has an `fg` ring at radius `lg`, concentric with the tile, as Slack marks the current workspace), its name, an online/offline/checking dot and label, then one **count chip** on the right (see Count chip below). It shows **Needs you** when anything waits for the Human, because that matters most; otherwise it shows **Unread**, the count of unread conversations. A ⋯ button at the end, or a long press on the row, opens the Host's menu: Customize (name, avatar and banner), Show this computer, and Unpair, which asks for confirmation. The ⋯ menu is the system's own anchored menu: a SwiftUI pull-down on iOS and a Material 3 dropdown on Android, with Unpair in the danger colour.
- Each Host row has its Computer icon tile (its chosen icon on a wash of its colour; the current Host's tile has an `fg` ring at radius `lg`, concentric with the tile, as Slack marks the current workspace), its name, an online/offline/checking dot and label, then one **count chip** on the right (see Count chip below). It shows **Needs you** when anything waits for the Human, because that matters most; otherwise it shows **Unread**, the count of unread conversations. A ⋯ button at the end, or a long press on the row, opens the Host's menu: Customize (name, avatar and banner), Show this computer, and Unpair, which asks for confirmation. The ⋯ menu is the system's own anchored menu: a SwiftUI pull-down on iOS and a Material 3 dropdown on Android, with Unpair in the danger colour.
- The Host chip opens it, and so does a swipe right from the left edge of a tab's root screen. The edge swipe is never attached inside a pushed chat, where it stays the system Back.
- Tapping a Host switches to it and closes the drawer. Tapping the backdrop, swiping left or using the accessibility escape gesture closes it. Opening focuses the selected tab.
- It takes screen-reader focus when it opens and returns focus to the Host chip when it closes. With Reduce Motion on it appears without sliding.
Expand Down Expand Up @@ -134,7 +136,7 @@ The shell is set by [ADR-0211](../../docs/adr/0211-the-mobile-app-has-two-tabs-w
- Everything comes from the Host's `overviewUsage` and `overviewMemory`, the same reads as the Web Client's activity view; the card's week total matches its week total.
- **Connections**: the current Host and its connection status, Computers (paired Hosts, their status and unpairing, with the same confirmation and error notice as before), Notifications, Storage, and Open full client.
- **Storage** pushes a screen that reads the Host's `storageUsage`: the total in `display`, one bar split into media and files, messages, Memory and other (accent at falling opacity, `borderStrong` for other; decorative, the rows below carry the numbers), then one row per part with its size. **Clear chat media** picks an age with checkmark rows (30, 90, 180 days, 1 year, any age), media types and chats with switches (every chat with media starts on), and a danger **Clear…** button. The button asks the Host for `storageCleanupPreview` and shows a destructive confirmation whose message states how many files from how many messages are deleted, the space freed, that text stays, and what is kept and why; nothing that matches gets a dialog with only Done. Confirming calls `storageCleanupConfirm`, shows a success notice and reads the usage again; a `storage-preview-stale` refusal says something changed. **This phone → Clear image cache** empties expo-image's memory and disk caches at once, since it only costs a download. Cleared files show in their message as a dashed `{size} · Cleared` file card. A **Clear** checkmark section above the age picks **Chat media** or **Whole messages**; whole messages hide the type switches, list every chat with messages and its count, and confirm through `storageMessagesCleanupPreview` / `storageMessagesCleanupConfirm` with the message count, chats, files, Memory mentions, kept messages and whether more remain. Purged messages are hidden in the message list.
- **Interface**: App icon (the full DeepSeekBot portrait ships as the default icon; the chibi portrait is the alternate; both have dark and tinted variants on iOS), and Appearance (scheme, accent, chat wallpaper) once it exists. Each Host's name, avatar and banner are customized from its menu in the Host drawer, not here.
- **Interface**: App icon (the full DeepSeekBot portrait ships as the default icon; the chibi portrait is the alternate; both have dark and tinted variants on iOS), and Appearance (scheme, accent, chat wallpaper) once it exists. Each Host's name, icon and colour are customized from its menu in the Host drawer, not here.
- **Chats**: Channel sections and Hidden Channels, each pushing its own screen.

## Sheet and drawer surfaces
Expand Down
9 changes: 8 additions & 1 deletion apps/mobile/app/(tabs)/(home)/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,14 @@ const HomeContent = memo(function HomeContent({
const filters = useMemo(
() =>
conversationEnvironments(
saved ? { hostId: saved.hostId, name: shownHostName(look, saved.hostName) } : undefined,
saved
? {
hostId: saved.hostId,
name: shownHostName(look, saved.hostName),
icon: look.icon,
...(look.color === undefined ? {} : { color: look.color }),
}
: undefined,
cloud.rows.filter((r) => r.hasSession).map(cloudViewScope),
directory.workspaces,
t.allEnvironments,
Expand Down
12 changes: 2 additions & 10 deletions apps/mobile/app/host-look.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useLocalSearchParams, useRouter } from 'expo-router';
import { View } from 'react-native';

import { useHostSession } from '../src/host/host-session';
import { forgetImage, hostLooks, pickLookImage, useHostLook } from '../src/host/native-host-look';
import { hostLooks, useHostLook } from '../src/host/native-host-look';
import { useDesignTheme } from '../src/ui/design/theme';
import { space } from '../src/ui/design/tokens';
import { Notice } from '../src/ui/request-parts';
Expand Down Expand Up @@ -33,15 +33,7 @@ export default function HostLookScreen() {
hostName={host.hostName}
look={look}
actions={{
onChange(next) {
const before = hostLooks.look(hostId);
hostLooks.set(hostId, next);
if (before.avatar.kind === 'image' && before.avatar !== next.avatar)
forgetImage(before.avatar.uri);
if (before.banner.kind === 'image' && before.banner !== next.banner)
forgetImage(before.banner.uri);
},
onPickImage: (slot) => pickLookImage(hostId, slot),
onChange: (next) => hostLooks.set(hostId, next),
onClose: () => router.back(),
}}
/>
Expand Down
7 changes: 6 additions & 1 deletion apps/mobile/src/host/conversation-environments.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
import type { ConversationWorkspace } from '../cloud/conversations';
import type { HostColorId, HostIcon } from '../ui/design/host-look';

export type ConversationEnvironment = {
key: string;
title: string;
detail?: string;
accessibilityLabel?: string;
kind: 'all' | 'computer' | 'cloud';
hostIcon?: HostIcon;
hostColor?: HostColorId;
};
export const computerEnvironmentKey = (hostId: string) => JSON.stringify(['computer', hostId]);
export const cloudEnvironmentKey = (scope: string, organizationId: string) =>
JSON.stringify([scope, organizationId]);

export function conversationEnvironments(
computer: { hostId: string; name: string } | undefined,
computer: { hostId: string; name: string; icon?: HostIcon; color?: HostColorId } | undefined,
sourceScopes: readonly string[],
workspaces: readonly ConversationWorkspace[],
allTitle: string,
Expand All @@ -23,6 +26,8 @@ export function conversationEnvironments(
key: computerEnvironmentKey(computer.hostId),
title: computer.name,
kind: 'computer',
...(computer.icon === undefined ? {} : { hostIcon: computer.icon }),
...(computer.color === undefined ? {} : { hostColor: computer.color }),
});
const seen = new Set<string>();
for (const scope of sourceScopes) {
Expand Down
Loading
Loading