paseo-follow-up 2.3.0-beta.2 → 2.3.0-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +1,13 @@
1
- import { createContext, useContext, useEffect, useRef, useState, type ReactNode } from "react";
2
- import { Platform, View, type StyleProp, type ViewProps, type ViewStyle } from "react-native";
1
+ import { createContext, useContext, useEffect, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
2
+ import { AccessibilityInfo, Animated, Easing, Platform, View, type StyleProp, type ViewProps, type ViewStyle } from "react-native";
3
3
  import { useRpc } from "@getpaseo/plugin/client";
4
4
  import { Icon, useToast } from "@getpaseo/plugin/client/ui";
5
5
  import { useQueryClient } from "@tanstack/react-query";
6
6
  import { dismissRpc } from "../shared/contracts";
7
- import { Pressable } from "./text";
8
- import { focusRing, type Theme } from "./kit";
9
- import { withAlpha } from "./theme";
7
+ import { Pressable, Text } from "./text";
8
+ import { focusRing, keyboardFocus, type Theme } from "./kit";
9
+ import { useReducedMotion } from "./motion";
10
+ import { isLight, readable, solidFor, tint, withAlpha } from "./theme";
10
11
  import { liveBriefKey, overviewKey, workspaceKey } from "./keys";
11
12
  import { hasToastHost, pushToast, runAction } from "./toast-store";
12
13
  import type { InboxStore } from "./inbox-store";
@@ -21,12 +22,32 @@ import type { InboxStore } from "./inbox-store";
21
22
  * On desktop it appears while the pointer is over its card or focus is inside it (RevealScope), and always on the card
22
23
  * that is selected (Catch up's card, Home's detail pane: `DismissReveal` "always"). Hidden is opacity 0, never
23
24
  * unmounted, so the card doesn't move when it appears and the keyboard and screen readers always reach it.
25
+ *
26
+ * Two clicks, in place (dismiss-takes-two-clicks-in-place): the first click (tap, Enter, Space, ⇧D in Catch up) arms the
27
+ * x: it turns into a small red-tinted "Dismiss" pill on the same spot (solid red under the pointer), growing leftward over what sits beside it, so the
28
+ * card never reflows. The second click on it dismisses. It disarms quietly on a click or tap anywhere else, Esc, focus
29
+ * leaving it, the pointer leaving its card (after a short grace), or DISMISS_ARM_MS untouched. Only one x is armed at a
30
+ * time, on every surface. No pop-up; Undo stays.
24
31
  */
25
32
 
26
33
  /** As long as sign-off's Undo (6 s): the toast holds while the pointer or focus is on it. */
27
34
  export const DISMISS_UNDO_MS = 6_000;
28
35
  /** The x's tooltip and the second half of its accessibility label. */
29
36
  export const DISMISS_HINT = "it no longer needs you, and the agent isn't messaged";
37
+ /** How long an armed x waits for its second click (paused while the pointer is on it). */
38
+ export const DISMISS_ARM_MS = 4_000;
39
+ /** How long the pointer may be off the armed x's card before it disarms (a wobble isn't leaving). */
40
+ export const DISMISS_LEAVE_GRACE_MS = 600;
41
+ /** What a screen reader hears when the x arms, and the armed x's tooltip. */
42
+ export const DISMISS_CONFIRM = "Press again to dismiss";
43
+
44
+ /** The one armed x, app-wide: arming another disarms this one. */
45
+ let armedX: object | null = null;
46
+ const armWatchers = new Set<() => void>();
47
+ const setArmed = (x: object | null) => { if (armedX === x) return; armedX = x; for (const f of armWatchers) f(); };
48
+ const watchArmed = (f: () => void) => { armWatchers.add(f); return () => { armWatchers.delete(f); }; };
49
+ /** Disarm whatever x is armed (a surface closing, a test resetting). */
50
+ export function disarmDismiss(): void { setArmed(null); }
30
51
 
31
52
  export type DismissTarget = { workspaceId: string; key: string } | { agentId: string };
32
53
  const targetKey = (t: DismissTarget) => "agentId" in t ? `agent:${t.agentId}` : `${t.workspaceId}:${t.key}`;
@@ -65,8 +86,12 @@ export function useDismiss(): (target: DismissTarget, options?: { onDismissed?:
65
86
  /** "always": the card is the selected one (Catch up's card, Home's detail pane), so its x shows without hover. */
66
87
  export const DismissReveal = createContext<"hover" | "always">("hover");
67
88
  const Hovered = createContext<boolean>(false);
89
+ /** Whether the pointer is over the card (desktop web); null outside a RevealScope, where only the x itself knows. */
90
+ const PointerIn = createContext<boolean | null>(null);
68
91
 
69
- type DomNode = { addEventListener(type: string, f: () => void): void; removeEventListener(type: string, f: () => void): void; setAttribute?(k: string, v: string): void };
92
+ type DomNode = { setAttribute?(k: string, v: string): void; contains?(other: unknown): boolean };
93
+ type Listen = { addEventListener?(type: string, f: (e: DomEvent) => void, capture?: boolean): void; removeEventListener?(type: string, f: (e: DomEvent) => void, capture?: boolean): void };
94
+ type DomEvent = { key?: string; target?: unknown; preventDefault?(): void; stopPropagation?(): void };
70
95
 
71
96
  /**
72
97
  * A card whose x shows while the pointer is over it or focus is inside it (desktop web). Native and phones draw the x
@@ -78,29 +103,105 @@ export function RevealScope({ children, style, ...rest }: { children: ReactNode;
78
103
  // react-native-web forwards these to the DOM (as client/linked.tsx's hover does); React's onFocus/onBlur bubble, so
79
104
  // focus anywhere inside the card counts. Native ignores them: the x is always shown there.
80
105
  const web = Platform.OS === "web" ? { onMouseEnter: () => setHovered(true), onMouseLeave: () => setHovered(false), onFocus: () => setFocused(true), onBlur: () => setFocused(false) } : {};
81
- return <View style={style} {...rest} {...(web as object)}><Hovered.Provider value={hovered || focused}>{children}</Hovered.Provider></View>;
106
+ return <View style={style} {...rest} {...(web as object)}><PointerIn.Provider value={Platform.OS === "web" ? hovered : null}><Hovered.Provider value={hovered || focused}>{children}</Hovered.Provider></PointerIn.Provider></View>;
82
107
  }
83
108
 
84
109
  /**
85
110
  * The small x. `label` names what it dismisses ("Dismiss Q3", "Dismiss #12 is approved"); the hint follows it. Quiet by
86
111
  * design: the muted foreground at 14 px (16 on phones), no fill until hovered, never the size or colour of an action.
112
+ * Armed (the first click), it is a red "Dismiss" pill in the same place; the second click calls `onPress`.
87
113
  */
88
114
  export function DismissX({ theme, compact, label, onPress, disabled = false }: { theme: Theme; compact: boolean; label: string; onPress: () => void; disabled?: boolean }) {
89
115
  const c = theme.colors;
90
116
  const reveal = useContext(DismissReveal);
91
117
  const hovered = useContext(Hovered);
118
+ const pointerIn = useContext(PointerIn);
92
119
  const [focused, setFocused] = useState(false);
120
+ const [over, setOver] = useState(false);
121
+ // Keyboard focus (focus-visible) holds the timeout too: someone who armed it with Enter and is hearing "Press again
122
+ // to dismiss" shouldn't lose it to a timer. A mouse click also focuses; that doesn't count.
123
+ const [keyed, setKeyed] = useState(false);
124
+ const reduced = useReducedMotion();
125
+ const fade = useRef(new Animated.Value(1)).current;
126
+ const me = useRef({}).current;
127
+ const armed = useSyncExternalStore(watchArmed, () => armedX === me, () => false);
128
+ const disarm = () => { if (armedX === me) setArmed(null); };
93
129
  const touch = compact || Platform.OS !== "web";
94
- const shown = touch || reveal === "always" || hovered || focused;
130
+ const shown = touch || reveal === "always" || hovered || focused || armed;
95
131
  const tip = useRef<View>(null);
96
- useEffect(() => { if (Platform.OS === "web") (tip.current as unknown as DomNode | null)?.setAttribute?.("title", `Dismiss: ${DISMISS_HINT}`); }, []);
132
+ useEffect(() => { if (Platform.OS === "web") (tip.current as unknown as DomNode | null)?.setAttribute?.("title", armed ? DISMISS_CONFIRM : `Dismiss: ${DISMISS_HINT}`); }, [armed]);
133
+ // Gone (dismissed, the card moved on) or disabled: never leave an armed x behind.
134
+ useEffect(() => () => disarm(), []);
135
+ useEffect(() => { if (disabled) disarm(); }, [disabled, armed]);
136
+ // The quiet timeout, paused while the pointer rests on the pill (someone about to click it).
137
+ useEffect(() => { if (!armed || over || keyed) return; const t = setTimeout(disarm, DISMISS_ARM_MS); return () => clearTimeout(t); }, [armed, over, keyed]);
138
+ // The pill fades in (140 ms, ease-out, opacity only) from the x; reduced motion swaps at once. Disarming is instant,
139
+ // and the second press never waits on it.
140
+ useEffect(() => {
141
+ if (!armed) return;
142
+ if (reduced) { fade.setValue(1); return; }
143
+ fade.setValue(0);
144
+ Animated.timing(fade, { toValue: 1, duration: 140, easing: Easing.out(Easing.cubic), useNativeDriver: Platform.OS !== "web" }).start();
145
+ }, [armed, reduced]);
146
+ // The pointer leaving the card (it was in, now it isn't) disarms after a grace; coming back keeps it armed.
147
+ const wasIn = useRef(pointerIn);
148
+ useEffect(() => {
149
+ const left = wasIn.current === true && pointerIn === false;
150
+ wasIn.current = pointerIn;
151
+ if (!armed || !left) return;
152
+ const t = setTimeout(disarm, DISMISS_LEAVE_GRACE_MS);
153
+ return () => clearTimeout(t);
154
+ }, [armed, pointerIn]);
155
+ // Web: a click or tap anywhere but this x, or Esc, disarms. Esc is taken (capture, before Catch up's keys and the
156
+ // host's interrupt): pressing it here only disarms.
157
+ useEffect(() => {
158
+ if (!armed) return;
159
+ const g = globalThis as unknown as Listen & { document?: Listen };
160
+ const doc = g.document;
161
+ if (typeof doc?.addEventListener !== "function" || typeof g.addEventListener !== "function") return;
162
+ const onDown = (e: DomEvent) => { if (!(tip.current as unknown as DomNode | null)?.contains?.(e.target)) disarm(); };
163
+ const onKey = (e: DomEvent) => { if (e.key !== "Escape") return; e.preventDefault?.(); e.stopPropagation?.(); disarm(); };
164
+ doc.addEventListener("pointerdown", onDown, true);
165
+ g.addEventListener("keydown", onKey, true);
166
+ return () => { doc.removeEventListener?.("pointerdown", onDown, true); g.removeEventListener?.("keydown", onKey, true); };
167
+ }, [armed]);
168
+ const press = () => {
169
+ if (armed) { disarm(); onPress(); return; }
170
+ setArmed(me);
171
+ AccessibilityInfo.announceForAccessibility?.(DISMISS_CONFIRM);
172
+ };
97
173
  // Phones: a real 40 px box (react-native-web ignores hitSlop) pulled in by 6 px each side, so it lays out as 28 px;
98
174
  // native also gets 4 px of hitSlop, a 48 px target. The glyph stays small and muted.
99
175
  const box = touch ? 40 : 22;
100
- return <Pressable ref={tip} accessibilityRole="button" accessibilityLabel={`${label}: ${DISMISS_HINT}`} disabled={disabled} onPress={onPress}
101
- hitSlop={4} onFocus={() => setFocused(true)} onBlur={() => setFocused(false)}
102
- style={(state: { hovered?: boolean; pressed: boolean; focused?: boolean }) => ({ ...focusRing(state.focused, c), width: box, height: box, margin: touch ? -6 : 0, borderRadius: box / 2, alignItems: "center", justifyContent: "center",
103
- opacity: shown ? (disabled ? 0.4 : 1) : 0, backgroundColor: state.pressed ? c.surface2 : state.hovered ? withAlpha(c.foreground, 0.06) : "transparent" })}>
104
- {state => <Icon name="X" size={touch ? 16 : 14} color={(state as { hovered?: boolean }).hovered ? c.foreground : c.foregroundMuted} />}
176
+ // Armed: wider by the pill, and the extra width is taken back with a negative left margin, so it lays out exactly as
177
+ // the x did: nothing beside it moves, the pill draws over it (solid, so what's under it doesn't show through).
178
+ // Desktop's pill keeps a 3 px inset on the right. Phones: a 24 px pill in the same 40 px box, so the target stays and
179
+ // the weight doesn't outgrow the card's own age and chips.
180
+ const wide = touch ? 80 : 69;
181
+ const pull = touch ? -6 : 0;
182
+ return <Pressable ref={tip} accessibilityRole="button" accessibilityLabel={armed ? `${label}. ${DISMISS_CONFIRM}` : `${label}: ${DISMISS_HINT}`} disabled={disabled} onPress={press}
183
+ hitSlop={4} onFocus={() => { setFocused(true); setKeyed(Platform.OS === "web" && keyboardFocus()); }} onBlur={() => { setFocused(false); setKeyed(false); disarm(); }} onHoverIn={() => setOver(true)} onHoverOut={() => setOver(false)}
184
+ style={(state: { hovered?: boolean; pressed: boolean; focused?: boolean }) => armed
185
+ ? { ...focusRing(state.focused, c), width: wide, height: box, margin: pull, marginLeft: pull - (wide - box), borderRadius: box / 2, alignItems: "stretch", justifyContent: "center", zIndex: 1 }
186
+ : { ...focusRing(state.focused, c), width: box, height: box, margin: pull, borderRadius: box / 2, alignItems: "center", justifyContent: "center",
187
+ opacity: shown ? (disabled ? 0.4 : 1) : 0, backgroundColor: state.pressed ? c.surface2 : state.hovered ? withAlpha(c.foreground, 0.06) : "transparent" }}>
188
+ {state => {
189
+ const hot = state.pressed || !!(state as { hovered?: boolean }).hovered;
190
+ // Web screen readers: react-native-web's announceForAccessibility is a no-op, so a polite live region (always
191
+ // mounted, empty until armed) says it. Native announces through AccessibilityInfo above.
192
+ const live = Platform.OS === "web" ? <Text accessibilityLiveRegion="polite" style={{ position: "absolute", width: 1, height: 1, overflow: "hidden", opacity: 0 }}>{armed ? DISMISS_CONFIRM : ""}</Text> : null;
193
+ if (!armed) return <>{live}<Icon name="X" size={touch ? 16 : 14} color={hot ? c.foreground : c.foregroundMuted} /></>;
194
+ // Armed at rest: a danger tint with danger ink and a hairline, over the page ground so what it covers doesn't show
195
+ // through. It goes solid (white on deepened danger) only under the pointer or finger, the moment it acts. Red,
196
+ // quietly: Dismiss is undoable, and a solid red pill at rest read as a new blocker on an amber card.
197
+ const ink = isLight(c) ? solidFor(c.statusDanger) : readable(c.statusDanger, c);
198
+ return <>{live}<Animated.View style={{ opacity: fade, height: touch ? 24 : 22, marginLeft: touch ? 6 : 0, marginRight: touch ? 6 : 3, borderRadius: touch ? 12 : 11, overflow: "hidden", backgroundColor: c.surface0 }}>
199
+ <View style={{ flex: 1, borderRadius: touch ? 12 : 11, borderWidth: 1, alignItems: "center", justifyContent: "center",
200
+ borderColor: hot ? "transparent" : withAlpha(c.statusDanger, 0.35),
201
+ backgroundColor: hot ? solidFor(c.statusDanger, state.pressed ? 0.82 : 1) : tint(c.statusDanger, c) }}>
202
+ <Text numberOfLines={1} style={{ color: hot ? "#ffffff" : ink, fontSize: 12, lineHeight: 14, fontWeight: "600" }}>Dismiss</Text>
203
+ </View>
204
+ </Animated.View></>;
205
+ }}
105
206
  </Pressable>;
106
207
  }
package/client/header.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  import type { ReactNode } from "react";
2
+ import type { SettingsCategory } from "../shared/settings-nav";
2
3
  import { View } from "react-native";
3
4
  import { Pressable, Text } from "./text";
4
5
  import { Icon } from "@getpaseo/plugin/client/ui";
@@ -47,7 +48,7 @@ function LiveGlyph({ icon, colors }: { icon: LiveIcon; colors: Colors }) {
47
48
  }
48
49
 
49
50
  export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings, onRefresh, refreshing, onAuto, autoPending, notice, onOpenPr, resize, hideTitle = false, onHome, more }: {
50
- workspace: Workspace; theme: Theme; compact: boolean; now: number; onSettings: () => void; onRefresh: () => void; refreshing: boolean; onAuto: (next: boolean) => void; autoPending: boolean; notice: string | null; onOpenPr?: (key: string) => void;
51
+ workspace: Workspace; theme: Theme; compact: boolean; now: number; onSettings: (category?: SettingsCategory) => void; onRefresh: () => void; refreshing: boolean; onAuto: (next: boolean) => void; autoPending: boolean; notice: string | null; onOpenPr?: (key: string) => void;
51
52
  /** Expand to the larger view, or collapse back to the panel. Absent where the panel is already as wide as it gets. */
52
53
  resize?: { icon: "Maximize2" | "Minimize2"; label: string; onPress: () => void } | null;
53
54
  /** The larger view's screen bar already names the workspace. */
@@ -67,7 +68,7 @@ export function WorkspaceHeader({ workspace: w, theme, compact, now, onSettings,
67
68
  const controls = <View style={{ flexDirection: "row", alignItems: "center", gap: 2, marginVertical: compact ? -12 : -4, marginRight: compact ? -10 : -4 }}>
68
69
  {resize && <IconButton icon={resize.icon} label={resize.label} onPress={resize.onPress} theme={theme} compact={compact} />}
69
70
  {more}
70
- <IconButton icon="Settings" label="Follow-up settings" onPress={onSettings} theme={theme} compact={compact} />
71
+ <IconButton icon="Settings" label="Follow-up settings" onPress={() => onSettings()} theme={theme} compact={compact} />
71
72
  </View>;
72
73
  const tail = <>
73
74
  <View style={{ flexDirection: "row", gap: 6, marginTop: 2 }}>
@@ -3,7 +3,8 @@ import { Platform, TextInput, View } from "react-native";
3
3
  import { Pressable, Text } from "./text";
4
4
  import { Icon, ScrollView, useToast } from "@getpaseo/plugin/client/ui";
5
5
  import { homeCounts, type HomeGroupId, type HomeModel } from "../shared/home";
6
- import { filterHome, homeSearchDocs, indexDocs, defaultActive, omniboxResults, overseerProvider, workspaceProvider, type OmniboxItem, type OmniboxProvider } from "../shared/search";
6
+ import { layoutHint, filterHome, homeSearchDocs, indexDocs, defaultActive, omniboxResults, overseerProvider, workspaceProvider, type OmniboxItem, type OmniboxProvider } from "../shared/search";
7
+ import { LayoutCapture, type LayoutKey } from "../shared/layout-swap";
7
8
  import { DEFAULT_SORT, SORT_HINT, SORT_LABEL, SORT_MODES, type SortMode } from "../shared/sort";
8
9
  import { PRIORITY_SOURCE_LABEL } from "../shared/priorities";
9
10
  import { rankFooter } from "../shared/ranker";
@@ -13,7 +14,7 @@ import type { HomeSources } from "./home-data";
13
14
  import { useMinute } from "./home-data";
14
15
  import { Spinner } from "./motion";
15
16
  import { withAlpha, type Colors } from "./theme";
16
- import type { Theme } from "./kit";
17
+ import { text, type Theme } from "./kit";
17
18
  import { MenuItemContent, menuGlyph, menuItemRow } from "./menu-item";
18
19
  import { useLinkedIndex } from "./linked";
19
20
 
@@ -27,6 +28,8 @@ import { useLinkedIndex } from "./linked";
27
28
  export type Omnibox = {
28
29
  query: string;
29
30
  setQuery(q: string): void;
31
+ setPhysical?: (q: string | null) => void;
32
+ layoutHint?: string | null;
30
33
  /** null while the query is empty: the list shows its groups. */
31
34
  results: OmniboxItem[] | null;
32
35
  active: number;
@@ -42,6 +45,7 @@ export type Omnibox = {
42
45
  */
43
46
  export function useOmnibox(model: HomeModel, sources: HomeSources, extraProviders: readonly OmniboxProvider[] = []): Omnibox {
44
47
  const [query, setQueryState] = useState("");
48
+ const [physical, setPhysical] = useState<string | null>(null);
45
49
  // null: the default row. -1: none, so Enter does nothing.
46
50
  const [active, setActive] = useState<number | null>(null);
47
51
  const inputRef = useRef<TextInput | null>(null);
@@ -57,7 +61,7 @@ export function useOmnibox(model: HomeModel, sources: HomeSources, extraProvider
57
61
  const index = useMemo(() => searching ? indexDocs(homeSearchDocs({ model, paseo: sources.paseo.all(), tracked: sources.live.all(), archived: sources.live.archived(), agents: sources.extras.agents(), linked })) : null,
58
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
59
63
  [searching, model, live, paseo, extras, linked]);
60
- const providers = useMemo(() => index ? [workspaceProvider(index), ...extraProviders, overseerProvider(askOn)] : [], [index, extraProviders, askOn]);
64
+ const providers = useMemo(() => index ? [workspaceProvider(index, Date.now(), physical), ...extraProviders, overseerProvider(askOn)] : [], [index, extraProviders, askOn, physical]);
61
65
  const results = useMemo(() => searching ? omniboxResults(providers, query) : null, [providers, query, searching]);
62
66
  const setQuery = useCallback((q: string) => { setQueryState(q); setActive(null); }, []);
63
67
  const fallback = defaultActive(results);
@@ -67,7 +71,8 @@ export function useOmnibox(model: HomeModel, sources: HomeSources, extraProvider
67
71
  // A request made before this field mounted (the search key opening Home) is taken on mount.
68
72
  const token = useSyncExternalStore(sources.extras.subscribe, sources.extras.focusToken, sources.extras.focusToken);
69
73
  useEffect(() => { if (sources.extras.takeFocus()) inputRef.current?.focus(); }, [token, sources.extras]);
70
- return { query, setQuery, results, active: Math.min(current, Math.max(0, (results?.length ?? 1) - 1)), move, inputRef, askOn };
74
+ const hint = layoutHint((results ?? []).flatMap(r => r.hit ? [r.hit] : []));
75
+ return { query, setQuery, setPhysical, layoutHint: hint, results, active: Math.min(current, Math.max(0, (results?.length ?? 1) - 1)), move, inputRef, askOn };
71
76
  }
72
77
 
73
78
  type DomKey = { key: string; metaKey: boolean; ctrlKey: boolean; altKey: boolean; target: unknown; preventDefault(): void };
@@ -92,9 +97,10 @@ export function useSlashToFocus(omnibox: Omnibox, enabled = true) {
92
97
  * The one query field: Home's omnibox (SearchField) and the sidebar view's filter (FilterField) are this with
93
98
  * different words. `dense` is the phone layout: a 44px field with a rounder shape and body-size text.
94
99
  */
95
- export function QueryField({ theme, value, onChange, placeholder, icon, dense, inputRef, slashHint, slashTitle, onSubmit, onArrow, listKeys = false, count, autoFocus = false, onEscape }: {
100
+ export function QueryField({ theme, value, onChange, placeholder, icon, dense, inputRef, slashHint, slashTitle, onSubmit, onArrow, listKeys = false, count, autoFocus = false, onEscape, onLayoutQuery }: {
96
101
  /** Its arrows step into the list below (client/list-keys.ts): the sidebar filter, and Home's search while empty. */
97
102
  listKeys?: boolean;
103
+ onLayoutQuery?: (q: string | null) => void;
98
104
  /** "2 of 12" at the field's end (a panel section's search), in place of the field's own ✕: the section has its own. */
99
105
  count?: string;
100
106
  autoFocus?: boolean;
@@ -108,10 +114,31 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
108
114
  }) {
109
115
  const c = theme.colors;
110
116
  const [focused, setFocused] = useState(false);
117
+ const capture = useRef(new LayoutCapture());
118
+ const layoutCallback = useRef(onLayoutQuery); layoutCallback.current = onLayoutQuery;
119
+ useEffect(() => {
120
+ if (Platform.OS !== "web" || !onLayoutQuery) return;
121
+ type Input = { value: string; selectionStart: number | null; selectionEnd: number | null };
122
+ type InputEvent = LayoutKey & { target: unknown };
123
+ type Listen = (name: string, listener: (e: InputEvent) => void, capture: boolean) => void;
124
+ const doc = (globalThis as unknown as { document?: { addEventListener: Listen; removeEventListener: Listen } }).document;
125
+ if (!doc) return;
126
+ const belongs = (e: InputEvent) => e.target === inputRef.current;
127
+ const key = (e: InputEvent) => {
128
+ if (!belongs(e)) return;
129
+ const input = e.target as Input;
130
+ capture.current.key(e, input.value, input.selectionStart, input.selectionEnd);
131
+ };
132
+ const reset = (e: InputEvent) => { if (belongs(e)) { capture.current.reset(); layoutCallback.current?.(null); } };
133
+ doc.addEventListener("keydown", key, true);
134
+ const resets = ["paste", "cut", "drop", "compositionstart", "compositionend", "select"];
135
+ for (const event of resets) doc.addEventListener(event, reset, true);
136
+ return () => { doc.removeEventListener("keydown", key, true); for (const event of resets) doc.removeEventListener(event, reset, true); };
137
+ }, [inputRef, !!onLayoutQuery]);
111
138
  return <View style={{ flex: 1, minWidth: 0, flexDirection: "row", alignItems: "center", gap: dense ? 8 : 6, height: dense ? 44 : 32, paddingHorizontal: dense ? 12 : 8, borderRadius: dense ? 12 : 6,
112
139
  borderWidth: 1, borderColor: focused ? withAlpha(c.foreground, 0.35) : c.border, backgroundColor: c.surface1 }}>
113
140
  <Icon name={icon as never} size={dense ? 16 : 13} color={c.foregroundMuted} />
114
- <TextInput ref={inputRef} value={value} onChangeText={onChange} placeholder={placeholder} placeholderTextColor={c.foregroundMuted}
141
+ <TextInput ref={inputRef} value={value} onChangeText={q => { onLayoutQuery?.(capture.current.change(q)); onChange(q); }} placeholder={placeholder} placeholderTextColor={c.foregroundMuted}
115
142
  accessibilityLabel={placeholder} autoFocus={autoFocus} autoCorrect={false} autoCapitalize="none" spellCheck={false} returnKeyType="go"
116
143
  {...(listKeys ? { dataSet: { listKeys: "1" } } as object : {})}
117
144
  onFocus={() => setFocused(true)} onBlur={() => setFocused(false)}
@@ -144,7 +171,7 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
144
171
  export function SearchField({ theme, omnibox, dense, onEnter, anywhereKey }: { theme: Theme; omnibox: Omnibox; dense: boolean; onEnter: (item: OmniboxItem | null) => void; anywhereKey?: string | null }) {
145
172
  const { query, setQuery, results, active, move, inputRef, askOn } = omnibox;
146
173
  const placeholder = askOn ? dense ? "Search or ask the Overseer" : "Search, or ask the Overseer" : "Search workspaces, branches, PRs";
147
- return <QueryField theme={theme} value={query} onChange={setQuery} placeholder={placeholder} icon="Search" dense={dense} inputRef={inputRef} slashHint={anywhereKey || "/"}
174
+ return <QueryField theme={theme} onLayoutQuery={omnibox.setPhysical} value={query} onChange={setQuery} placeholder={placeholder} icon="Search" dense={dense} inputRef={inputRef} slashHint={anywhereKey || "/"}
148
175
  slashTitle={anywhereKey ? `${anywhereKey} from anywhere · / on Home` : "/ focuses the search"}
149
176
  onSubmit={() => { const item = results?.[active]; if (item || !query.trim()) onEnter(item ?? null); }} onArrow={move} listKeys={!query.trim()} />;
150
177
  }
@@ -153,8 +180,9 @@ export function SearchField({ theme, omnibox, dense, onEnter, anywhereKey }: { t
153
180
  * The sidebar view's filter (2.1): narrows the list in place with Home search's matcher (shared/search.ts
154
181
  * `filterHome`), keeping groups and the chosen order. Archived workspaces stay out; Home's search finds those.
155
182
  */
156
- export type ListFilter = { query: string; setQuery: (q: string) => void; model: HomeModel; hits: ReturnType<typeof filterHome>["hits"]; inputRef: { current: TextInput | null } };
183
+ export type ListFilter = { setPhysical?: (q: string | null) => void; layoutHint?: string | null; query: string; setQuery: (q: string) => void; model: HomeModel; hits: ReturnType<typeof filterHome>["hits"]; inputRef: { current: TextInput | null } };
157
184
  export function useListFilter(model: HomeModel, sources: HomeSources): ListFilter {
185
+ const [physical, setPhysical] = useState<string | null>(null);
158
186
  const [query, setQuery] = useState("");
159
187
  const inputRef = useRef<TextInput | null>(null);
160
188
  const live = useSyncExternalStore(sources.live.subscribe, sources.live.version, sources.live.version);
@@ -166,12 +194,17 @@ export function useListFilter(model: HomeModel, sources: HomeSources): ListFilte
166
194
  const index = useMemo(() => searching ? indexDocs(homeSearchDocs({ model, paseo: sources.paseo.all(), tracked: sources.live.all(), agents: sources.extras.agents(), linked })) : null,
167
195
  // eslint-disable-next-line react-hooks/exhaustive-deps
168
196
  [searching, model, live, paseo, extras, linked]);
169
- const filtered = useMemo(() => index ? filterHome(model, index, query) : { model, hits: null }, [index, model, query]);
170
- return { query, setQuery, model: filtered.model, hits: filtered.hits, inputRef };
197
+ const filtered = useMemo(() => index ? filterHome(model, index, query, Date.now(), physical) : { model, hits: null }, [index, model, query, physical]);
198
+ return { query, setQuery, setPhysical, layoutHint: layoutHint([...(filtered.hits?.values() ?? [])]), model: filtered.model, hits: filtered.hits, inputRef };
171
199
  }
172
200
  /** "Filter workspaces": a filter icon and no key binding, so it never reads as Paseo's own Search (the Command Center, ⌘K). */
173
201
  export function FilterField({ theme, filter, dense }: { theme: Theme; filter: ListFilter; dense: boolean }) {
174
- return <QueryField theme={theme} value={filter.query} onChange={filter.setQuery} placeholder="Filter workspaces" icon="ListFilter" dense={dense} inputRef={filter.inputRef} slashHint={false} listKeys />;
202
+ return <QueryField theme={theme} onLayoutQuery={filter.setPhysical} value={filter.query} onChange={filter.setQuery} placeholder="Filter workspaces" icon="ListFilter" dense={dense} inputRef={filter.inputRef} slashHint={false} listKeys />;
203
+ }
204
+
205
+ /** Kept outside the textbox: never changes the query or adds a decision to the search flow. */
206
+ export function LayoutNotice({ theme, query, dense }: { theme: Theme; query?: string | null; dense: boolean }) {
207
+ return <Text accessibilityLiveRegion="polite" numberOfLines={2} style={{ ...text(theme.colors, dense).meta, ...(query ? { paddingTop: 4 } : { height: 0 }) }}>{query ? `Showing results for “\u2068${query}\u2069”` : ""}</Text>;
175
208
  }
176
209
 
177
210
  // ---------- sort ----------
package/client/home.tsx CHANGED
@@ -27,7 +27,7 @@ import { DismissReveal } from "./dismiss";
27
27
  import { Age, BadgeView, BRIEF_KEY, glyphColor, HomeList, OVERSEER_KEY, PrChipView, PrSummaryText, type OverseerRowState } from "./home-list";
28
28
  import { answerLine, overseerRowState } from "../shared/overseer";
29
29
  import type { OmniboxItem } from "../shared/search";
30
- import { ListTop, SearchField, SortMenu, StatusStrip, UsageMeters, useOmnibox, useSlashToFocus } from "./home-chrome";
30
+ import { LayoutNotice, ListTop, SearchField, SortMenu, StatusStrip, UsageMeters, useOmnibox, useSlashToFocus } from "./home-chrome";
31
31
  import { useHomeModel, useTick, type HomeSources } from "./home-data";
32
32
  import { laterLabel, useInbox, UndoBar, useNextRelay } from "./inbox";
33
33
  import { Spinner } from "./motion";
@@ -249,6 +249,7 @@ function HomeBody(props: PluginScreenProps & { deps: HomeDeps; onboarding: Onboa
249
249
  {!(compact && nothing) && <SortMenu theme={theme} mode={model.sort} onChange={deps.sources.extras.setSort} rankedAt={model.rankedAt} touch={compact} rank={rank} onRerank={deps.sources.extras.rankNow} />}
250
250
  {compact && <IconButton theme={theme} compact icon="Settings" label="Follow-up settings" onPress={deps.openSettings} />}
251
251
  </View>
252
+ <View style={{ paddingHorizontal: 16 }}><LayoutNotice theme={theme} query={omnibox.layoutHint} dense={compact} /></View>
252
253
  {!compact && !omnibox.results && <StatusStrip theme={theme} model={model} filter={filter} onFilter={setFilter} touch={compact} dense={compact} />}
253
254
  {!compact && !omnibox.results && <UsageMeters theme={theme} sources={deps.sources} dense={compact} hold={!!model.hold} />}
254
255
  {!compact && !omnibox.results && <SetupOffer theme={theme} compact={compact} view={props.onboarding} />}
@@ -180,7 +180,8 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
180
180
  </View>
181
181
  <View style={item.kind === "reviewers" ? { alignSelf: "flex-start" } : undefined}>{pair ?? button}</View>
182
182
  {/* Top right, a step away from the action so a thumb aimed at it doesn't land here. */}
183
- <View style={{ alignSelf: "flex-start", marginTop: -4, marginRight: -6, marginLeft: 2 }}>{x}</View>
183
+ {/* Flush (Catch up's bordered card): no pull to the edge, so the armed Dismiss pill keeps clear of the border. */}
184
+ <View style={{ alignSelf: "flex-start", marginTop: -4, marginRight: flush ? 0 : -6, marginLeft: 2 }}>{x}</View>
184
185
  </RevealScope>
185
186
  </CardRow>;
186
187
  return <CardRow key={item.key} theme={theme} compact={compact} first={index === 0 && flush} style={flush ? { paddingHorizontal: 0 } : undefined}>
@@ -198,7 +199,7 @@ export function NeedsYouList({ workspace: w, theme, compact, actions, now = Date
198
199
  </View>}
199
200
  {notice}
200
201
  </View>
201
- <View style={{ marginTop: -3, marginRight: -5 }}>{x}</View>
202
+ <View style={{ marginTop: -3, marginRight: flush ? 2 : -5 }}>{x}</View>
202
203
  </RevealScope>
203
204
  </CardRow>;
204
205
  })}
package/client/panel.tsx CHANGED
@@ -1,4 +1,5 @@
1
1
  import { useEffect, useState, type ReactNode } from "react";
2
+ import type { SettingsCategory } from "../shared/settings-nav";
2
3
  import { recoveryActions } from "./recovery-actions";
3
4
  import { View } from "react-native";
4
5
  import { Text } from "./text";
@@ -42,7 +43,7 @@ import { ToastHost, useQuestionOpener } from "./toasts";
42
43
 
43
44
  export { overviewKey, workspaceKey };
44
45
 
45
- export type PanelLinks = { openSettings: () => void; openOverview: () => void; openLarge?: (workspaceId: string) => void };
46
+ export type PanelLinks = { openSettings: (category?: SettingsCategory) => void; openOverview: () => void; openLarge?: (workspaceId: string) => void };
46
47
  type PanelProps = PluginWorkspacePanelProps & PanelLinks & { inbox?: InboxStore; live?: LiveStore; briefDeps?: BriefDeps; sources?: HomeSources };
47
48
 
48
49
  /**
@@ -127,19 +128,19 @@ function NothingYet({ theme, layout, loadError, openOverview, openSettings }: Pa
127
128
  </View>)}
128
129
  </View>
129
130
  {loadError && <Text accessibilityRole="alert" style={[tp.meta, { color: c.statusDanger }]}>{loadError}</Text>}
130
- <View style={{ flexDirection: "row" }}><Button theme={theme} compact kind="secondary" icon="Settings" title="Project settings" accessibilityHint="Choose which projects Follow-up tracks" onPress={openSettings} /></View>
131
+ <View style={{ flexDirection: "row" }}><Button theme={theme} compact kind="secondary" icon="Settings" title="Project settings" accessibilityHint="Choose which projects Follow-up tracks" onPress={() => openSettings("following")} /></View>
131
132
  </ScrollView>
132
133
  </View>;
133
134
  }
134
135
 
135
136
  /** The panel's top bar: back to Home, and settings. No other workspace's counts. */
136
- export function PanelTop({ theme, compact, openOverview, openSettings }: { theme: Theme; compact: boolean; openOverview: () => void; openSettings?: () => void }) {
137
+ export function PanelTop({ theme, compact, openOverview, openSettings }: { theme: Theme; compact: boolean; openOverview: () => void; openSettings?: (category?: SettingsCategory) => void }) {
137
138
  const c = theme.colors;
138
139
  return <View style={{ flexDirection: "row", alignItems: "center", gap: 6, paddingHorizontal: compact ? 12 : 8, paddingVertical: 6, borderBottomWidth: 1, borderBottomColor: c.border }}>
139
140
  <Button theme={theme} compact={compact} kind="ghost" icon="House" title="Home" accessibilityHint="Opens Follow-up Home with every workspace" onPress={openOverview} />
140
141
  <View style={{ flex: 1 }} />
141
142
  {openSettings && <VersionMark theme={theme} touch={compact} openSettings={openSettings} />}
142
- {openSettings && <IconButton icon="Settings" label="Follow-up settings" onPress={openSettings} theme={theme} compact={compact} />}
143
+ {openSettings && <IconButton icon="Settings" label="Follow-up settings" onPress={() => openSettings()} theme={theme} compact={compact} />}
143
144
  </View>;
144
145
  }
145
146
 
@@ -342,7 +343,7 @@ const folds = z.object({ open: z.array(z.string()) });
342
343
  export const WIDE_MIN = 820;
343
344
 
344
345
  export function WorkspaceView({ theme, layout, workspace: w, navigation, loadError, openSettings, openOverview, folds: { isOpen, toggle }, resize, large = false, top, ask, sources }: PluginHostProps & {
345
- navigation?: PluginWorkspacePanelProps["navigation"]; workspace: Workspace; loadError?: string | null; openSettings: () => void; openOverview: () => void; top?: ReactNode; /** The main agent's open brief and its card, for the Needs you block. */ ask?: { brief: Brief; card: ReactNode } | null;
346
+ navigation?: PluginWorkspacePanelProps["navigation"]; workspace: Workspace; loadError?: string | null; openSettings: (category?: SettingsCategory) => void; openOverview: () => void; top?: ReactNode; /** The main agent's open brief and its card, for the Needs you block. */ ask?: { brief: Brief; card: ReactNode } | null;
346
347
  folds: Folds; resize: { icon: "Maximize2" | "Minimize2"; label: string; onPress: () => void } | null; large?: boolean;
347
348
  /** Home's sources: the header's More menu (the row menu). Absent in the larger view. */
348
349
  sources?: HomeSources;
@@ -0,0 +1,41 @@
1
+ import { createElement, type ComponentType } from "react";
2
+ import type { PluginClientContext, PluginSurfaceProps } from "@getpaseo/plugin/client";
3
+ import { FOLLOW_UP_ICON } from "./follow-up-icon";
4
+ import { SETTINGS_CATEGORIES, deviceStorage, isCategory, readCategory, writeCategory, type KeyValue, type SettingsCategory } from "../shared/settings-nav";
5
+
6
+ /**
7
+ * Where Follow-up's settings live in Paseo's Settings (`settings-link-lands-on-its-category`).
8
+ *
9
+ * Paseo 0.16 draws a plugin's settings screens as one native tab strip on the plugin's page (the app's
10
+ * plugins/settings/index.tsx `SettingsTabs`, unchanged in 0.17.0-beta.1), so there each category is its own screen
11
+ * and Follow-up draws no tabs of its own. Paseo 0.15 lists every settings screen as its own row in the plugin's •••
12
+ * menu, so there it keeps one screen, "Follow-up", with its own tabs (`FollowSettings` without a category).
13
+ *
14
+ * General keeps the old screen id, so a saved link or restored route to it lands on the first tab. Every link into
15
+ * settings goes through `open(category)`: it remembers the category and opens the screen that shows it; with no
16
+ * category it reopens the last one this device showed.
17
+ */
18
+ export const SETTINGS_SCREEN = "projects";
19
+ const screenId = (category: SettingsCategory) => category === "general" ? SETTINGS_SCREEN : category;
20
+
21
+ /** The 0.16 app's client API (feeds, sidebar views): fixed for the app's lifetime. */
22
+ export const hasNativeSettingsTabs = (client: object) => {
23
+ const c = client as { subscribe?: unknown; addSidebarView?: unknown };
24
+ return typeof c.subscribe === "function" && typeof c.addSidebarView === "function";
25
+ };
26
+
27
+ export type SettingsScreenComponent = ComponentType<PluginSurfaceProps & { category?: SettingsCategory }>;
28
+
29
+ export function createSettings(client: Pick<PluginClientContext, "addSettingsScreen" | "openSettings">, Screen: SettingsScreenComponent, store: KeyValue = deviceStorage) {
30
+ const native = hasNativeSettingsTabs(client);
31
+ const removers = native
32
+ ? SETTINGS_CATEGORIES.map(cat => client.addSettingsScreen({ id: screenId(cat.id), title: cat.title, icon: cat.icon,
33
+ Component: (props: PluginSurfaceProps) => createElement(Screen, { ...props, category: cat.id }) }))
34
+ : [client.addSettingsScreen({ id: SETTINGS_SCREEN, title: "Follow-up", icon: FOLLOW_UP_ICON, Component: (props: PluginSurfaceProps) => createElement(Screen, props) })];
35
+ /** `category` may be anything a caller passes (a press event too): only a known category counts. */
36
+ const open = (category?: unknown) => {
37
+ if (isCategory(category)) writeCategory(category, store);
38
+ client.openSettings(native ? screenId(readCategory(store)) : SETTINGS_SCREEN);
39
+ };
40
+ return { native, open, remove: () => { for (const r of removers) r(); } };
41
+ }
@@ -1,4 +1,4 @@
1
- import { useState } from "react";
1
+ import { useEffect, useState } from "react";
2
2
  import { useViewSync, useViewVersion } from "./view-store";
3
3
  import { ActivityIndicator, TextInput, View } from "react-native";
4
4
  import { Pressable, Text } from "./text";
@@ -226,16 +226,22 @@ function useSummaries(): Partial<Record<SettingsCategory, string | null>> {
226
226
  * on this device. Phone: the category list, drilling in with a back row. Only the open category mounts, so only its
227
227
  * data loads.
228
228
  */
229
+ const REVIEWERS_INFO = "Who Add reviewers asks on a PR: a list per repository, or the default for every repository without one. A login is a GitHub user (octocat) or a team (org/team). Teammates each keep their own lists.";
230
+
229
231
  /** Settings → General → Help → Report a bug. */
230
232
  export const REPORT_HINT = "Or an idea or feedback. An agent writes it up and shows you the issue before filing it.";
231
233
 
232
- export function FollowSettings({ theme, layout, openSetup, openReport }: PluginSurfaceProps & { openSetup?: (resume?: boolean) => void; openReport?: () => void }) {
234
+ export function FollowSettings({ theme, layout, openSetup, openReport, category: only }: PluginSurfaceProps & { openSetup?: (resume?: boolean) => void; openReport?: () => void;
235
+ /** Paseo 0.16: this screen is one category, and Paseo's own tabs switch between them (client/settings-screens.ts). */
236
+ category?: SettingsCategory }) {
233
237
  const compact = layout.compact;
234
238
  const c = theme.colors; const t = text(c, compact);
235
239
  // The category comes from device storage on every render, so the first paint is the localStorage cache and the
236
240
  // device document takes over when it loads, never the default in between.
237
241
  useViewSync(); useViewVersion();
238
- const category = readCategory();
242
+ const category = only ?? readCategory();
243
+ // A category screen remembers itself, so "Follow-up: settings" and the gear reopen the tab last shown on this device.
244
+ useEffect(() => { if (only && readCategory() !== only) writeCategory(only); }, [only]);
239
245
  // The phone reopens in the last category, like desktop; before any pick it starts on the list. Until the developer
240
246
  // drills in or out, that follows storage too (the phone's document loads after the first paint).
241
247
  const [chosen, setDrilled] = useState<boolean | null>(null);
@@ -248,14 +254,28 @@ export function FollowSettings({ theme, layout, openSetup, openReport }: PluginS
248
254
  const setup = openSetup ? { entry, open: () => openSetup(entry.resume) } : undefined;
249
255
  const content = category === "general" ? <GeneralCategory theme={theme} compact={compact} setup={setup} openReport={openReport} />
250
256
  : category === "following" ? <FollowingCategory theme={theme} compact={compact} />
251
- : category === "reviewers" ? <View style={{ gap: 8 }}>
252
- <Text style={t.meta}>Who Add reviewers asks on a PR: a list per repository, or the default for every repository without one. A login is a GitHub user (octocat) or a team (org/team). Teammates each keep their own lists.</Text>
257
+ // Under Paseo's tabs, Reviewers is a titled section like every other category, its explanation in the info tip.
258
+ : category === "reviewers" ? only ? <SettingsSection title="Reviewer lists" info={REVIEWERS_INFO}><ReviewerSettings theme={theme} compact={compact} /></SettingsSection>
259
+ : <View style={{ gap: 8 }}>
260
+ <Text style={t.meta}>{REVIEWERS_INFO}</Text>
253
261
  <ReviewerSettings theme={theme} compact={compact} />
254
262
  </View>
255
263
  : category === "agents" ? <AgentsCategory theme={theme} compact={compact} />
256
264
  : <DisplaySections theme={theme} />;
257
265
  // Phones: the shared gutter and the bottom inset (the gesture bar), like every other Follow-up surface.
258
266
  const page = { padding: compact ? space(true).gutter : 24, gap: 18, maxWidth: 720, width: "100%" as const, alignSelf: "center" as const, paddingBottom: 40 };
267
+ const line = summaries[category];
268
+ // General's status card and the Agents card header say it already; their lines are for the phone list.
269
+ // Reviewers' card says its own state, so under Paseo's tabs it has no line of its own.
270
+ const lead = line && category !== "general" && category !== "agents" && !(only && category === "reviewers") ? <Text style={[t.meta, !only && !compact ? { marginTop: -6 } : null]}>{line}</Text> : null;
271
+ // One category under Paseo's own tabs: no tabs, list or back row of Follow-up's own, and no column or gutter of its
272
+ // own either. Paseo's plugin page scrolls and sets the width, so the category lines up with its tabs. The line sits
273
+ // on the section titles' inset at a readable measure, and a section's worth of space parts the last card from
274
+ // Paseo's own Details below.
275
+ if (only) return <View style={{ gap: 18, paddingTop: 12, paddingBottom: 40 }}>
276
+ {lead && <View style={{ paddingHorizontal: 5, maxWidth: 680 }}>{lead}</View>}
277
+ {content}
278
+ </View>;
259
279
  // The host's header sits right above: no extra top space on a phone.
260
280
  if (compact) return <ScrollView style={{ flex: 1, backgroundColor: c.surface0 }} contentContainerStyle={{ ...page, paddingTop: 4, ...bottomInset(true, 28) }}>
261
281
  {drilled ? <>
@@ -263,11 +283,9 @@ export function FollowSettings({ theme, layout, openSetup, openReport }: PluginS
263
283
  {content}
264
284
  </> : <CategoryList summaries={summaries} theme={theme} onOpen={id => { pick(id); setDrilled(true); }} />}
265
285
  </ScrollView>;
266
- const line = summaries[category];
267
286
  return <ScrollView style={{ flex: 1, backgroundColor: c.surface0 }} stickyHeaderIndices={[0]} contentContainerStyle={{ ...page, paddingTop: 0 }}>
268
287
  <View style={{ paddingTop: 24, backgroundColor: c.surface0 }}><CategoryTabs value={category} onChange={pick} theme={theme} /></View>
269
- {/* General's status card and the Agents card header say it already; their lines are for the phone list. */}
270
- {line && category !== "general" && category !== "agents" ? <Text style={[t.meta, { marginTop: -6 }]}>{line}</Text> : null}
288
+ {lead}
271
289
  {content}
272
290
  </ScrollView>;
273
291
  }
@@ -6,7 +6,7 @@ import { Text } from "./text";
6
6
  import { UndoBar, useInbox, useSidebarViewMounted } from "./inbox";
7
7
  import { HomeList, OVERSEER_KEY, type OverseerRowState } from "./home-list";
8
8
  import { sidebarSelected } from "./theme";
9
- import { FilterField, SortMenu, useListFilter } from "./home-chrome";
9
+ import { FilterField, LayoutNotice, SortMenu, useListFilter } from "./home-chrome";
10
10
  import { useHomeModel, type HomeSources } from "./home-data";
11
11
  import { useRowMenu } from "./row-actions";
12
12
  import { RenameHost } from "./rename";
@@ -90,11 +90,12 @@ export function inboxSidebarView(sources: HomeSources, openOverseerHome: () => v
90
90
  keys={{ mode: "focus", onOpen: onSelect }}
91
91
  // The open chat's row wears Paseo's own selected-item fill, so it reads like a selected native item.
92
92
  selectedBg={sidebarSelected(c)}
93
- // One row, nothing else (invariant 8): the filter takes the width, the sort is an icon. zIndex keeps the
93
+ // One control row: the filter takes the width, the sort is an icon. A layout hint may sit below. zIndex keeps the
94
94
  // sort menu above the list on web, where every View is its own stacking context.
95
- top={<View style={{ zIndex: 10, flexDirection: "row", alignItems: "center", gap: touch ? 8 : 4, paddingHorizontal: touch ? 12 : 8, paddingVertical: touch ? 8 : 6, borderBottomWidth: 1, borderBottomColor: c.border }}>
96
- <FilterField theme={view.theme} filter={filter} dense={touch} />
97
- <SortMenu theme={view.theme} mode={full.sort} onChange={sources.extras.setSort} rankedAt={full.rankedAt} touch={touch} compact rank={rank} onRerank={sources.extras.rankNow} />
95
+ top={<View style={{ zIndex: 10, paddingHorizontal: touch ? 12 : 8, paddingVertical: touch ? 8 : 6, borderBottomWidth: 1, borderBottomColor: c.border }}>
96
+ <View style={{ flexDirection: "row", alignItems: "center", gap: touch ? 8 : 4 }}><FilterField theme={view.theme} filter={filter} dense={touch} />
97
+ <SortMenu theme={view.theme} mode={full.sort} onChange={sources.extras.setSort} rankedAt={full.rankedAt} touch={touch} compact rank={rank} onRerank={sources.extras.rankNow} /></View>
98
+ <LayoutNotice theme={view.theme} query={filter.layoutHint} dense={touch} />
98
99
  </View>}
99
100
  footer={filter.hits && !touch ? <Text style={{ color: c.foregroundMuted, fontSize: 11, paddingHorizontal: 8, paddingTop: 10, paddingBottom: 32 }}>Filtering this list · Esc clears</Text> : undefined} />
100
101
  <View style={{ position: "absolute", left: 8, right: 8, bottom: 8 }}><UndoBar store={sources.inbox} theme={view.theme} touch={touch} /></View>