paseo-follow-up 2.6.0-beta.4 → 2.6.0-beta.6
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.
- package/client/display.tsx +11 -2
- package/client/field.tsx +54 -4
- package/client/home-chrome.tsx +40 -15
- package/client/home-list.tsx +20 -7
- package/client/home-view.ts +6 -7
- package/client/panel.tsx +26 -15
- package/client/report-issue.tsx +21 -4
- package/client/reviewers.tsx +3 -2
- package/client/row-actions.ts +2 -0
- package/client/turn-view.tsx +61 -5
- package/client/workspace-data.ts +22 -3
- package/index.server.ts +41 -7
- package/package.json +1 -1
- package/server/agent-actions.ts +2 -1
- package/server/agent-parity.ts +1 -1
- package/server/daemon.ts +17 -2
- package/server/directory.ts +3 -1
- package/server/engine.ts +28 -2
- package/server/feeds.ts +10 -4
- package/server/github.ts +22 -7
- package/server/inbox.ts +25 -1
- package/server/mcp-source.ts +2 -2
- package/server/mcp.mjs +2 -2
- package/server/report-issue/index.ts +42 -11
- package/server/report-issue-adapter.ts +84 -3
- package/server/report-send.ts +3 -3
- package/server/turn-events.ts +8 -3
- package/shared/check-watch.ts +18 -3
- package/shared/contracts.ts +1 -1
- package/shared/inbox.ts +11 -0
- package/shared/list.ts +19 -0
- package/shared/model.ts +10 -0
- package/shared/peek.ts +46 -1
- package/shared/placeholder-fit.ts +65 -0
- package/shared/reopen.ts +50 -0
- package/shared/report-send.ts +20 -1
- package/shared/row-menu.ts +4 -0
- package/shared/search.ts +13 -0
- package/shared/status-invariants.ts +12 -0
package/client/display.tsx
CHANGED
|
@@ -21,6 +21,14 @@ export function subscribeDisplay(listener: (values: Display) => void) { listener
|
|
|
21
21
|
let latest: Display | null = null;
|
|
22
22
|
listeners.add(values => { latest = values; });
|
|
23
23
|
export const displayValues = (): Display | null => latest;
|
|
24
|
+
/**
|
|
25
|
+
* The Display document as it arrives (the feed's push or a read), for Home's order (client/home-view.ts): one
|
|
26
|
+
* follow.display-feed per client, the Display store's (invariant 142). A late follower gets the last document at once.
|
|
27
|
+
*/
|
|
28
|
+
type DisplayDoc = { status: string; values?: unknown };
|
|
29
|
+
let latestDoc: DisplayDoc | null = null;
|
|
30
|
+
const docFollowers = new Set<(doc: DisplayDoc) => void>();
|
|
31
|
+
export function followDisplayDoc(follower: (doc: DisplayDoc) => void) { docFollowers.add(follower); if (latestDoc) follower(latestDoc); return () => { docFollowers.delete(follower); }; }
|
|
24
32
|
|
|
25
33
|
/** R2's measurement, where it's cheap to look: how often agents stated what they need on a flagged turn. */
|
|
26
34
|
export function briefShareText(stats: { days: number; total: number; tool: number; structured: number; fallback: number } | undefined): string {
|
|
@@ -156,8 +164,9 @@ export function contributeDisplay(client: PluginClientContext, item: PluginSideb
|
|
|
156
164
|
// Retain the last valid preference through temporary disconnects.
|
|
157
165
|
} finally { pending = false; }
|
|
158
166
|
};
|
|
159
|
-
const apply = (result:
|
|
167
|
+
const apply = (result: DisplayDoc) => {
|
|
160
168
|
if (!disposed && result.status === "ready") {
|
|
169
|
+
latestDoc = result; for (const follower of docFollowers) follower(result);
|
|
161
170
|
const parsed = displayPreferences.schema.safeParse(result.values);
|
|
162
171
|
if (parsed.success) { sidebar.set(parsed.data.showSidebar); for (const listener of listeners) listener(parsed.data); }
|
|
163
172
|
}
|
|
@@ -175,7 +184,7 @@ export function contributeDisplay(client: PluginClientContext, item: PluginSideb
|
|
|
175
184
|
return () => {
|
|
176
185
|
disposed = true; feed?.stop();
|
|
177
186
|
if (timer) clearInterval(timer); offVisible();
|
|
178
|
-
listeners.delete(update);
|
|
187
|
+
listeners.delete(update); latestDoc = null;
|
|
179
188
|
sidebar.dispose();
|
|
180
189
|
};
|
|
181
190
|
}
|
package/client/field.tsx
CHANGED
|
@@ -1,17 +1,46 @@
|
|
|
1
1
|
// Every text field in Follow-up (`the-keyboard-never-covers-a-field`, tests/keyboard-field.test.ts): the SDK's
|
|
2
2
|
// TextInput, so Paseo still positions it inside its sheets, plus a report to the nearest KeyboardRoom
|
|
3
3
|
// (client/keyboard.tsx) when it gains or loses focus, so the room keeps it above a phone's keyboard.
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
// A one-line field's placeholder always fits its line (`a-placeholder-never-wraps`, invariant 153,
|
|
5
|
+
// shared/placeholder-fit.ts): Android's EditText wraps a one-line field's hint and the field clips the second line,
|
|
6
|
+
// so the field measures its own text room and draws the longest wording that fits.
|
|
7
|
+
import { forwardRef, useCallback, useRef, useState } from "react";
|
|
8
|
+
import { Platform, StyleSheet, useWindowDimensions, type LayoutChangeEvent, type TextInput as NativeTextInput, type TextInputProps } from "react-native";
|
|
6
9
|
import { TextInput } from "@getpaseo/plugin/client/ui";
|
|
7
10
|
import { useFieldRoom, type FocusedField } from "./keyboard";
|
|
11
|
+
import { drawnFontSize, estimateTextWidth, fitPlaceholder, fullPlaceholder, textRoom, type Placeholder } from "../shared/placeholder-fit";
|
|
8
12
|
|
|
9
13
|
export type FieldRef = NativeTextInput;
|
|
14
|
+
export type FieldProps = Omit<TextInputProps, "placeholder"> & {
|
|
15
|
+
/** The hint, or its wordings preferred first ("Search or ask the Overseer", "Search or ask", "Search"). */
|
|
16
|
+
placeholder?: Placeholder;
|
|
17
|
+
};
|
|
10
18
|
|
|
11
|
-
|
|
19
|
+
/** Android's EditText pads its text where the style sets no horizontal padding (Material: about 12 dp a side). */
|
|
20
|
+
const ANDROID_TEXT_PAD = 12;
|
|
21
|
+
|
|
22
|
+
type WebInput = { getBoundingClientRect?: () => unknown; ownerDocument?: { defaultView?: { getComputedStyle(n: unknown): Record<string, string> } } };
|
|
23
|
+
let canvas: { getContext(k: "2d"): { font: string; measureText(t: string): { width: number } } | null } | null = null;
|
|
24
|
+
/** The browser's own measure of `text` in this input's font, or null where there is none (native, tests). */
|
|
25
|
+
function webMeasure(node: unknown): ((text: string) => number) | null {
|
|
26
|
+
const input = node as WebInput | null;
|
|
27
|
+
const css = input?.ownerDocument?.defaultView?.getComputedStyle(input);
|
|
28
|
+
const doc = (globalThis as { document?: { createElement(t: string): unknown } }).document;
|
|
29
|
+
if (!css || !doc) return null;
|
|
30
|
+
canvas ??= doc.createElement("canvas") as typeof canvas;
|
|
31
|
+
const ctx = canvas?.getContext("2d");
|
|
32
|
+
if (!ctx) return null;
|
|
33
|
+
ctx.font = css.font || `${css.fontStyle} ${css.fontWeight} ${css.fontSize} ${css.fontFamily}`;
|
|
34
|
+
const spacing = parseFloat(css.letterSpacing) || 0;
|
|
35
|
+
return text => ctx.measureText(text).width + spacing * [...text].length + 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const Field = forwardRef<NativeTextInput, FieldProps>(function Field({ onFocus, onBlur, onLayout, placeholder, accessibilityLabel, ...props }, ref) {
|
|
12
39
|
const own = useRef<NativeTextInput | null>(null);
|
|
13
40
|
const { room, scroll } = useFieldRoom();
|
|
14
41
|
const me = useRef<FocusedField | null>(null);
|
|
42
|
+
const [width, setWidth] = useState<number | null>(null);
|
|
43
|
+
const { fontScale } = useWindowDimensions();
|
|
15
44
|
const setRef = useCallback((input: NativeTextInput | null) => {
|
|
16
45
|
own.current = input;
|
|
17
46
|
if (typeof ref === "function") ref(input); else if (ref) ref.current = input;
|
|
@@ -29,5 +58,26 @@ export const Field = forwardRef<NativeTextInput, TextInputProps>(function Field(
|
|
|
29
58
|
if (me.current) room?.blur(me.current);
|
|
30
59
|
onBlur?.(e);
|
|
31
60
|
};
|
|
32
|
-
|
|
61
|
+
// Only a one-line field with a hint measures itself; a multi-line field's hint wraps as its text does.
|
|
62
|
+
const fits = placeholder !== undefined && !props.multiline;
|
|
63
|
+
const layout = (e: LayoutChangeEvent) => {
|
|
64
|
+
const w = Math.round(e.nativeEvent.layout.width);
|
|
65
|
+
if (fits && w !== width) setWidth(w);
|
|
66
|
+
onLayout?.(e);
|
|
67
|
+
};
|
|
68
|
+
const full = placeholder === undefined ? undefined : fullPlaceholder(placeholder);
|
|
69
|
+
// Before its width is known a phone field shows its shortest wording, so Android never draws one frame wrapped.
|
|
70
|
+
let shown = fits && width === null && Platform.OS !== "web" ? fitPlaceholder(placeholder, null, () => 0, "shortest") : full;
|
|
71
|
+
if (fits && width !== null) {
|
|
72
|
+
const style = (StyleSheet.flatten(props.style) ?? {}) as Record<string, unknown>;
|
|
73
|
+
const web = Platform.OS === "web" ? webMeasure(own.current) : null;
|
|
74
|
+
const size = drawnFontSize(style, Platform.OS === "web" ? 1 : fontScale, props);
|
|
75
|
+
const spacing = typeof style.letterSpacing === "number" ? style.letterSpacing : 0;
|
|
76
|
+
const measure = web ?? ((t: string) => estimateTextWidth(t, size, spacing));
|
|
77
|
+
shown = fitPlaceholder(placeholder, textRoom(width, style, Platform.OS === "android" ? ANDROID_TEXT_PAD : 0), measure);
|
|
78
|
+
}
|
|
79
|
+
// A one-line field is named by its full wording whatever the width shows, so a screen reader hears one name.
|
|
80
|
+
const label = accessibilityLabel ?? (fits ? full : undefined);
|
|
81
|
+
return <TextInput {...props} placeholder={shown} accessibilityLabel={label} numberOfLines={props.multiline ? props.numberOfLines : 1}
|
|
82
|
+
ref={setRef} onFocus={focus} onBlur={blur} onLayout={fits || onLayout ? layout : undefined} />;
|
|
33
83
|
});
|
package/client/home-chrome.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatingSurface } from "./floating-surface";
|
|
2
|
-
import { useCallback, useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
|
|
2
|
+
import { useCallback, useDeferredValue, useEffect, useMemo, useRef, useState, useSyncExternalStore, type ReactNode } from "react";
|
|
3
3
|
import { Platform, View, type TextInput } from "react-native";
|
|
4
4
|
import { AttachImageButton, ImageField, useImageAttachments, type ImageAttachments } from "./image-attach";
|
|
5
5
|
import { OVERSEER_ASK_KEY } from "./unsent-images";
|
|
@@ -8,6 +8,7 @@ import { Icon, ScrollView, useToast } from "@getpaseo/plugin/client/ui";
|
|
|
8
8
|
import { homeCounts, type HomeGroupId, type HomeModel } from "../shared/home";
|
|
9
9
|
import { layoutHint, filterHome, homeSearchDocs, indexDocs, defaultActive, omniboxResults, overseerProvider, workspaceProvider, type OmniboxItem, type OmniboxProvider } from "../shared/search";
|
|
10
10
|
import { LayoutCapture, type LayoutKey } from "../shared/layout-swap";
|
|
11
|
+
import { fullPlaceholder, type Placeholder } from "../shared/placeholder-fit";
|
|
11
12
|
import { DEFAULT_SORT, isMenuSort, MENU_SORTS, SORT_HINT, SORT_LABEL, type SortMode } from "../shared/sort";
|
|
12
13
|
import { GROUPING_LABEL, GROUPINGS, homeViewFiltered, SHOW_ITEMS, SHOW_LABEL, TITLE_LABEL, TITLE_SOURCES, type HomeView } from "../shared/home-arrange";
|
|
13
14
|
import { PRIORITY_SOURCE_LABEL } from "../shared/priorities";
|
|
@@ -36,9 +37,11 @@ export type Omnibox = {
|
|
|
36
37
|
setQuery(q: string): void;
|
|
37
38
|
setPhysical?: (q: string | null) => void;
|
|
38
39
|
layoutHint?: string | null;
|
|
39
|
-
/** null while the query is empty: the list shows its groups. */
|
|
40
|
+
/** null while the query is empty: the list shows its groups. They may trail `query` by a key (useDeferredValue). */
|
|
40
41
|
results: OmniboxItem[] | null;
|
|
41
42
|
active: number;
|
|
43
|
+
/** What Enter takes: the active result for the query as typed, even when the list hasn't caught up with it yet. */
|
|
44
|
+
enterItem(): OmniboxItem | null;
|
|
42
45
|
move(delta: number): void;
|
|
43
46
|
inputRef: React.RefObject<TextInput | null>;
|
|
44
47
|
/** The search field's onLayout: a waiting search request tries again when the field comes on screen. */
|
|
@@ -67,7 +70,10 @@ export function useOmnibox(model: HomeModel, sources: HomeSources, extraProvider
|
|
|
67
70
|
const live = useSyncExternalStore(sources.live.subscribe, sources.live.version, sources.live.version);
|
|
68
71
|
const paseo = useSyncExternalStore(sources.paseo.subscribe, sources.paseo.version, sources.paseo.version);
|
|
69
72
|
const extras = useSyncExternalStore(sources.extras.subscribe, sources.extras.version, sources.extras.version);
|
|
70
|
-
|
|
73
|
+
// typing-never-redraws-unchanged-rows (invariant 148): the field takes each key at once; the results follow the
|
|
74
|
+
// typed query at low priority, so a key never waits on the list, and a newer key drops a list render still running.
|
|
75
|
+
const shown = useDeferredValue(query);
|
|
76
|
+
const searching = shown.trim().length > 0;
|
|
71
77
|
const overseer = useSyncExternalStore(sources.extras.subscribe, sources.extras.overseer, sources.extras.overseer);
|
|
72
78
|
const askOn = !!overseer?.enabled;
|
|
73
79
|
// An ask Paseo hasn't taken yet keeps its images under OVERSEER_ASK_KEY (client/unsent-images.ts).
|
|
@@ -75,11 +81,14 @@ export function useOmnibox(model: HomeModel, sources: HomeSources, extraProvider
|
|
|
75
81
|
// Linked keys and titles: fetched only while there's a query (client/linked.tsx explains why).
|
|
76
82
|
const linked = useLinkedIndex(searching);
|
|
77
83
|
// Built lazily: nothing is indexed until the developer types.
|
|
78
|
-
const
|
|
84
|
+
const buildIndex = () => indexDocs(homeSearchDocs({ model, paseo: sources.paseo.all(), tracked: sources.live.all(), archived: sources.live.archived(), agents: sources.extras.agents(), linked }));
|
|
85
|
+
const index = useMemo(() => searching ? buildIndex() : null,
|
|
79
86
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
80
87
|
[searching, model, live, paseo, extras, linked]);
|
|
81
|
-
const
|
|
82
|
-
|
|
88
|
+
const providersOf = (i: ReturnType<typeof indexDocs>) => [workspaceProvider(i, Date.now(), physical), ...extraProviders, overseerProvider(askOn)];
|
|
89
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
90
|
+
const providers = useMemo(() => index ? providersOf(index) : [], [index, extraProviders, askOn, physical]);
|
|
91
|
+
const results = useMemo(() => searching ? omniboxResults(providers, shown) : null, [providers, shown, searching]);
|
|
83
92
|
const setQuery = useCallback((q: string) => { setQueryState(q); setActive(null); }, []);
|
|
84
93
|
const fallback = defaultActive(results);
|
|
85
94
|
const current = active ?? fallback;
|
|
@@ -90,7 +99,16 @@ export function useOmnibox(model: HomeModel, sources: HomeSources, extraProvider
|
|
|
90
99
|
const onSearchLayout = useSearchFocusField(sources.extras.searchFocus, inputRef, setQuery);
|
|
91
100
|
const focusSearch = useCallback(() => { const f = sources.extras.searchFocus; if (!f.shown()) return false; f.request(); return true; }, [sources.extras.searchFocus]);
|
|
92
101
|
const hint = layoutHint((results ?? []).flatMap(r => r.hit ? [r.hit] : []));
|
|
93
|
-
|
|
102
|
+
const shownActive = Math.min(current, Math.max(0, (results?.length ?? 1) - 1));
|
|
103
|
+
// Enter right after a key: the list may still show the query before it, so Enter reads the typed query's own results
|
|
104
|
+
// (Ask the Overseer sends what was typed, never the query a key earlier).
|
|
105
|
+
const enterItem = (): OmniboxItem | null => {
|
|
106
|
+
if (shown === query) return results?.[shownActive] ?? null;
|
|
107
|
+
if (!query.trim()) return null;
|
|
108
|
+
const fresh = omniboxResults(providersOf(index ?? buildIndex()), query);
|
|
109
|
+
return fresh[defaultActive(fresh)] ?? null;
|
|
110
|
+
};
|
|
111
|
+
return { query, setQuery, setPhysical, layoutHint: hint, results, active: shownActive, enterItem, move, inputRef, onSearchLayout, focusSearch, askOn, images };
|
|
94
112
|
}
|
|
95
113
|
|
|
96
114
|
type DomKey = { key: string; metaKey: boolean; ctrlKey: boolean; altKey: boolean; target: unknown; preventDefault(): void };
|
|
@@ -129,7 +147,9 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
|
|
|
129
147
|
autoFocus?: boolean;
|
|
130
148
|
/** Esc's own action (a section search closes); without it Esc clears, then leaves the field. */
|
|
131
149
|
onEscape?: () => void;
|
|
132
|
-
theme: Theme; value: string; onChange: (q: string) => void;
|
|
150
|
+
theme: Theme; value: string; onChange: (q: string) => void; icon: string; dense: boolean;
|
|
151
|
+
/** Its wordings, preferred first: the field shows the longest that fits its one line (invariant 153). */
|
|
152
|
+
placeholder: Placeholder;
|
|
133
153
|
/** The key chip at the field's end (web, desktop width): "/" or the search-from-anywhere key; false for none. */
|
|
134
154
|
/** The chip's hover title (web): what each key does. */
|
|
135
155
|
slashTitle?: string;
|
|
@@ -162,7 +182,7 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
|
|
|
162
182
|
borderWidth: 1, borderColor: focused ? withAlpha(c.foreground, 0.35) : c.border, backgroundColor: c.surface1 }}>
|
|
163
183
|
<Icon name={icon as never} size={dense ? 16 : 13} color={c.foregroundMuted} />
|
|
164
184
|
<Field ref={inputRef} onLayout={onLayout} value={value} onChangeText={q => { onLayoutQuery?.(capture.current.change(q)); onChange(q); }} placeholder={placeholder} placeholderTextColor={c.foregroundMuted}
|
|
165
|
-
accessibilityLabel={placeholder} autoFocus={autoFocus} autoCorrect={false} autoCapitalize="none" spellCheck={false} returnKeyType="go"
|
|
185
|
+
accessibilityLabel={fullPlaceholder(placeholder)} autoFocus={autoFocus} autoCorrect={false} autoCapitalize="none" spellCheck={false} returnKeyType="go"
|
|
166
186
|
{...(listKeys || onLayout ? { dataSet: { ...(listKeys ? { listKeys: "1" } : {}), ...(onLayout ? { followUpSearch: "1" } : {}) } } as object : {})}
|
|
167
187
|
onFocus={() => setFocused(true)} onBlur={() => setFocused(false)}
|
|
168
188
|
onSubmitEditing={onSubmit}
|
|
@@ -178,7 +198,7 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
|
|
|
178
198
|
style={{ flex: 1, minWidth: 0, color: c.foreground, fontSize: dense ? 15 : 13, paddingVertical: 0, ...(Platform.OS === "web" ? { outlineStyle: "none" } as object : {}) }} />
|
|
179
199
|
{trailing}
|
|
180
200
|
{count !== undefined ? !!count && <Text accessibilityLiveRegion="polite" style={{ color: c.foregroundMuted, fontSize: dense ? 13 : 12, fontVariant: ["tabular-nums"] }}>{count}</Text>
|
|
181
|
-
: !!value && <Pressable accessibilityRole="button" accessibilityLabel={`Clear ${placeholder.toLowerCase()}`} hitSlop={dense ? 14 : 8} onPress={() => { onChange(""); inputRef.current?.focus(); }}>
|
|
201
|
+
: !!value && <Pressable accessibilityRole="button" accessibilityLabel={`Clear ${fullPlaceholder(placeholder).toLowerCase()}`} hitSlop={dense ? 14 : 8} onPress={() => { onChange(""); inputRef.current?.focus(); }}>
|
|
182
202
|
<Icon name="X" size={dense ? 16 : 13} color={c.foregroundMuted} />
|
|
183
203
|
</Pressable>}
|
|
184
204
|
{slashHint && !value && !focused && !dense && Platform.OS === "web" && <Text accessibilityElementsHidden importantForAccessibility="no"
|
|
@@ -187,22 +207,27 @@ export function QueryField({ theme, value, onChange, placeholder, icon, dense, i
|
|
|
187
207
|
</View>;
|
|
188
208
|
}
|
|
189
209
|
|
|
210
|
+
/** Home's search wordings, longest first: a phone's half-width field shows the longest that fits (invariant 153). */
|
|
211
|
+
export const searchPlaceholder = (askOn: boolean, dense: boolean): readonly string[] => askOn
|
|
212
|
+
? [dense ? "Search or ask the Overseer" : "Search, or ask the Overseer", "Search or ask", "Search"]
|
|
213
|
+
: ["Search workspaces, branches, PRs", "Search workspaces", "Search"];
|
|
214
|
+
|
|
190
215
|
/**
|
|
191
216
|
* Home's search. Its chip names the search-from-anywhere key when one is set (it works here too), else "/"; plain "/"
|
|
192
217
|
* focuses it on Home either way (useSlashToFocus).
|
|
193
218
|
*/
|
|
194
219
|
/** `onEnter`: the active result, or null when the query is empty (Home then opens its selection). */
|
|
195
220
|
export function SearchField({ theme, omnibox, dense, onEnter, anywhereKey }: { theme: Theme; omnibox: Omnibox; dense: boolean; onEnter: (item: OmniboxItem | null) => void; anywhereKey?: string | null }) {
|
|
196
|
-
const { query, setQuery,
|
|
197
|
-
const placeholder = askOn
|
|
221
|
+
const { query, setQuery, move, inputRef, askOn } = omnibox;
|
|
222
|
+
const placeholder = searchPlaceholder(askOn, dense);
|
|
198
223
|
// The bar stays one line: a paste or drop lands here, and Home draws the thumbnails on their own line under it.
|
|
199
224
|
if (askOn) return <ImageField model={omnibox.images} theme={theme} compact={dense} row={false} attach="inline" style={{ flex: 1, minWidth: 0 }}><QueryField theme={theme} onLayoutQuery={omnibox.setPhysical} value={query} onChange={setQuery} placeholder={placeholder} icon="Search" dense={dense} inputRef={inputRef} onLayout={omnibox.onSearchLayout} slashHint={anywhereKey || "/"}
|
|
200
225
|
trailing={<AttachImageButton model={omnibox.images} theme={theme} compact={dense} label="Add image for the Overseer" />}
|
|
201
226
|
slashTitle={anywhereKey ? `${anywhereKey} from anywhere · / on Home` : "/ focuses the search"}
|
|
202
|
-
onSubmit={() => { const item =
|
|
227
|
+
onSubmit={() => { const item = omnibox.enterItem(); if (item || !query.trim()) onEnter(item ?? null); }} onArrow={move} listKeys={!query.trim()} /></ImageField>;
|
|
203
228
|
return <QueryField theme={theme} onLayoutQuery={omnibox.setPhysical} value={query} onChange={setQuery} placeholder={placeholder} icon="Search" dense={dense} inputRef={inputRef} onLayout={omnibox.onSearchLayout} slashHint={anywhereKey || "/"}
|
|
204
229
|
slashTitle={anywhereKey ? `${anywhereKey} from anywhere · / on Home` : "/ focuses the search"}
|
|
205
|
-
onSubmit={() => { const item =
|
|
230
|
+
onSubmit={() => { const item = omnibox.enterItem(); if (item || !query.trim()) onEnter(item ?? null); }} onArrow={move} listKeys={!query.trim()} />;
|
|
206
231
|
}
|
|
207
232
|
|
|
208
233
|
/**
|
|
@@ -228,7 +253,7 @@ export function useListFilter(model: HomeModel, sources: HomeSources): ListFilte
|
|
|
228
253
|
}
|
|
229
254
|
/** "Filter workspaces": a filter icon and no key binding, so it never reads as Paseo's own Search (the Command Center, ⌘K). */
|
|
230
255
|
export function FilterField({ theme, filter, dense }: { theme: Theme; filter: ListFilter; dense: boolean }) {
|
|
231
|
-
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 />;
|
|
256
|
+
return <QueryField theme={theme} onLayoutQuery={filter.setPhysical} value={filter.query} onChange={filter.setQuery} placeholder={["Filter workspaces", "Filter"]} icon="ListFilter" dense={dense} inputRef={filter.inputRef} slashHint={false} listKeys />;
|
|
232
257
|
}
|
|
233
258
|
|
|
234
259
|
/** Kept outside the textbox: never changes the query or adds a decision to the search flow. */
|
package/client/home-list.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { View, type FlatList as NativeFlatList } from "react-native";
|
|
|
4
4
|
import { Pressable, Text } from "./text";
|
|
5
5
|
import { Icon, FlatList } from "@getpaseo/plugin/client/ui";
|
|
6
6
|
import { type Badge, type HomeGroupId, type HomeModel, type Workstream, prChipSpoken, railChips } from "../shared/home";
|
|
7
|
-
import { ASK_KEY, excerpt, FIELD_LABEL, type OmniboxItem, type Range, type RowHit, type SearchHit } from "../shared/search";
|
|
7
|
+
import { ASK_KEY, excerpt, FIELD_LABEL, type OmniboxItem, type Range, type RowHit, type SearchHit, sameHit } from "../shared/search";
|
|
8
8
|
import { AskRow, PriorityLine } from "./home-chrome";
|
|
9
9
|
import { age, wakeLabel, wakeShort } from "../shared/inbox";
|
|
10
10
|
import { headlineColor, mergedColor, readable, runningColor, tint, toneColor, withAlpha, type Colors } from "./theme";
|
|
@@ -129,10 +129,14 @@ export function HomeList({ model, theme, dense = false, touch, selectedKey, onSe
|
|
|
129
129
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
130
130
|
[model, closed, openProjects, pages, briefLine, results, hits, filter, !!overseer, touch, !!afterNeeds, arranged]);
|
|
131
131
|
// A result picks through onResult; Row only knows its key.
|
|
132
|
+
// Read through a ref, so a key that brings new results (and Home's new onResult) never hands every row a new onSelect
|
|
133
|
+
// (typing-never-redraws-unchanged-rows).
|
|
134
|
+
const picking = useRef({ results, onResult }); picking.current = { results, onResult };
|
|
132
135
|
const pickResult = useCallback((key: string) => {
|
|
136
|
+
const { results, onResult } = picking.current;
|
|
133
137
|
const item = results?.find(i => !i.ask && i.key === key);
|
|
134
138
|
if (item) onResult?.(item);
|
|
135
|
-
}, [
|
|
139
|
+
}, []);
|
|
136
140
|
|
|
137
141
|
const render = useCallback(({ item }: { item: Entry }) => {
|
|
138
142
|
switch (item.type) {
|
|
@@ -305,10 +309,16 @@ export function WakeTime({ until, c, size = 12 }: { until: string; c: Colors; si
|
|
|
305
309
|
const text = wakeShort(until, Math.max(now, Date.now()));
|
|
306
310
|
return text ? <Text style={{ color: c.foregroundMuted, fontSize: size, fontVariant: ["tabular-nums"], minWidth: 26, textAlign: "right" }}>{text}</Text> : null;
|
|
307
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* typing-never-redraws-unchanged-rows (invariant 148): how many times a row and its chip rail drew, read by
|
|
314
|
+
* tests/search-rows.test.ts. A row draws again only when what it shows moved; its rail and time only when the row did.
|
|
315
|
+
*/
|
|
316
|
+
let rowDraws = 0, chipRails = 0;
|
|
317
|
+
export const rowRenders = () => ({ rows: rowDraws, rails: chipRails });
|
|
308
318
|
/** The right-hand time: when a Later row comes back, otherwise how long ago. */
|
|
309
|
-
function RowTime({ s, c, size }: { s: Workstream; c: Colors; size: number }) {
|
|
319
|
+
const RowTime = memo(function RowTime({ s, c, size }: { s: Workstream; c: Colors; size: number }) {
|
|
310
320
|
return <View testID="follow-up-row-time" style={{ flexShrink: 0 }}>{s.group === "later" && s.wakeAt ? <WakeTime until={s.wakeAt} c={c} size={size} /> : <Age iso={s.at} c={c} size={size} />}</View>;
|
|
311
|
-
}
|
|
321
|
+
}, (a, b) => a.s.sig === b.s.sig && a.c === b.c && a.size === b.size);
|
|
312
322
|
|
|
313
323
|
/**
|
|
314
324
|
* row-chips-never-cover-the-time: a desktop row's badges and PR chip, in priority order (most telling first). They yield
|
|
@@ -316,13 +326,15 @@ function RowTime({ s, c, size }: { s: Workstream; c: Colors; size: number }) {
|
|
|
316
326
|
* clips (so the lowest-priority chips drop, last first), and a lone chip truncates. Guarded by
|
|
317
327
|
* `scripts/screenshots.mjs --only rowchips` (CDP boxes at list widths 320, 360 and 400) and tests/row-chips.test.ts.
|
|
318
328
|
*/
|
|
319
|
-
function ChipRail({ s, c, dim = false }: { s: Workstream; c: Colors; /** An Older row: chips at 60 %, like its glyph. */ dim?: boolean }) {
|
|
329
|
+
const ChipRail = memo(function ChipRail({ s, c, dim = false }: { s: Workstream; c: Colors; /** An Older row: chips at 60 %, like its glyph. */ dim?: boolean }) {
|
|
330
|
+
chipRails++;
|
|
320
331
|
const chips = railChips(s);
|
|
321
332
|
if (chips.length === 0) return null;
|
|
322
333
|
return <View testID="follow-up-row-chips" style={{ ...(dim ? { opacity: 0.6 } : {}), flexShrink: 1000, minWidth: 0, height: 20, overflow: "hidden", flexDirection: "row", flexWrap: "wrap", justifyContent: "flex-end", columnGap: 10, rowGap: 4 }}>
|
|
323
334
|
{chips.map(ch => ch.kind === "badge" ? <BadgeView key={ch.badge.text} b={ch.badge} c={c} /> : <PrChipView key="pr" s={s} c={c} />)}
|
|
324
335
|
</View>;
|
|
325
|
-
|
|
336
|
+
// Show › Pull request off hands the rail a copy without the PR and the same sig, so the PR's presence counts too.
|
|
337
|
+
}, (a, b) => a.s.sig === b.s.sig && !!a.s.pr === !!b.s.pr && a.c === b.c && a.dim === b.dim);
|
|
326
338
|
|
|
327
339
|
/** The age on the right. It re-renders on the shared minute clock without touching its row. */
|
|
328
340
|
export function Age({ iso, c, size = 12 }: { iso: string | null; c: Colors; size?: number }) {
|
|
@@ -362,6 +374,7 @@ export function rowDetail(s: Workstream, view: HomeView, facts: HomeListProps["f
|
|
|
362
374
|
|
|
363
375
|
type RowProps = { s: Workstream; sig: string; detail?: RowDetail; detailSig?: string; theme: Theme; dense: boolean; touch: boolean; selected: boolean; onSelect: (key: string) => void; onOpen?: (key: string) => void; onMenu: OpenRowMenu; menuOpen?: boolean; hit?: RowHit | null; onSendNow?: (s: Workstream) => Promise<void>; selectedBg?: string };
|
|
364
376
|
const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect, onOpen, onMenu, menuOpen = false, hit = null, onSendNow, selectedBg, detail }: RowProps) {
|
|
377
|
+
rowDraws++;
|
|
365
378
|
// Title › Branch name swaps the row's title; everything else reads the workstream as built.
|
|
366
379
|
const s = detail && detail.title !== raw.title ? { ...raw, title: detail.title } : raw;
|
|
367
380
|
const showTime = detail?.time ?? true;
|
|
@@ -454,7 +467,7 @@ const Row = memo(function Row({ s: raw, theme, dense, touch, selected, onSelect,
|
|
|
454
467
|
</View>{!!why && <View style={{ paddingRight: 40 }}><PriorityLine reason={why.reason} source={why.source} c={c} /></View>}</View>}
|
|
455
468
|
{!touch && !dense && showTime && <RowTime s={s} c={c} size={12} />}
|
|
456
469
|
</Pressable>;
|
|
457
|
-
}, (a, b) => a.sig === b.sig && a.selected === b.selected && a.theme === b.theme && a.dense === b.dense && a.touch === b.touch && a.onSelect === b.onSelect && a.onOpen === b.onOpen && a.onMenu === b.onMenu && a.menuOpen === b.menuOpen && a.hit
|
|
470
|
+
}, (a, b) => a.sig === b.sig && a.selected === b.selected && a.theme === b.theme && a.dense === b.dense && a.touch === b.touch && a.onSelect === b.onSelect && a.onOpen === b.onOpen && a.onMenu === b.onMenu && a.menuOpen === b.menuOpen && sameHit(a.hit, b.hit) && a.onSendNow === b.onSendNow && a.selectedBg === b.selectedBg && a.detailSig === b.detailSig);
|
|
458
471
|
|
|
459
472
|
/**
|
|
460
473
|
* Paseo's detail line under a row: branch, project, the PR with its checks, labels (as Display › Show leaves them),
|
package/client/home-view.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { DispatchRecord } from "../shared/dispatch";
|
|
2
2
|
import type { PluginClientContext } from "@getpaseo/plugin/client";
|
|
3
3
|
import type { ImageUpload } from "../shared/images";
|
|
4
|
-
import { contextAskRpc, contextListRpc, questionActionRpc, dispatchRecordsRpc,
|
|
4
|
+
import { contextAskRpc, contextListRpc, questionActionRpc, dispatchRecordsRpc, homeFeed, queueNeedsSchema, overseerAskRpc, overseerRestartRpc, overseerStartRpc, overseerStatusRpc, prioritiesRpc, prStatsSettingsRpc, rankNowRpc, rankStatusRpc, usageRpc } from "../shared/contracts";
|
|
5
5
|
import { openFeed } from "./feeds";
|
|
6
|
+
import { followDisplayDoc } from "./display";
|
|
6
7
|
import { sharedRead, USAGE_SHARED_MS } from "./shared-read";
|
|
7
8
|
import type { RpcInput, RpcOutput } from "@getpaseo/plugin";
|
|
8
9
|
import type { Priority } from "../shared/priorities";
|
|
@@ -162,12 +163,10 @@ export function createHomeExtras(client: PluginClientContext) {
|
|
|
162
163
|
down: () => { if (usagePolls) { usagePolls(); usagePolls = null; } homePolls ??= pollHome(); },
|
|
163
164
|
up: () => { homePolls?.(); homePolls = null; },
|
|
164
165
|
});
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}) : null;
|
|
170
|
-
const stopFeeds = () => { home?.stop(); display?.stop(); for (const off of [homePolls, sortPolls, usagePolls]) off?.(); homePolls = sortPolls = usagePolls = null; };
|
|
166
|
+
// The Display document comes from the Display store's feed (client/display.tsx), which reads it while that feed is
|
|
167
|
+
// down: one follow.display-feed per client (invariant 142).
|
|
168
|
+
const display = home ? followDisplayDoc(doc => { if (!stopped) void sync.apply(doc).then(changed => { if (changed) emit(); }); }) : null;
|
|
169
|
+
const stopFeeds = () => { home?.stop(); display?.(); for (const off of [homePolls, sortPolls, usagePolls]) off?.(); homePolls = sortPolls = usagePolls = null; };
|
|
171
170
|
if (home) {
|
|
172
171
|
// The Display feed's first event is the document (ValueFeed sends the current value first), so the order and the
|
|
173
172
|
// old-choice migration apply from it (sync.apply): no read of its own at open (one-read-per-key-at-mount).
|
package/client/panel.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { finishedTask } from "../shared/finished";
|
|
2
|
-
import { createContext, useContext, useEffect, useRef, useState, type ReactNode } from "react";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useRef, useState, type ReactNode } from "react";
|
|
3
3
|
import { PagedRows } from "./paged-list";
|
|
4
4
|
import type { SettingsCategory } from "../shared/settings-nav";
|
|
5
5
|
import { recoveryActions } from "./recovery-actions";
|
|
@@ -373,6 +373,26 @@ function Slot({ id, onHeight, children }: { id: string; onHeight: (id: string, h
|
|
|
373
373
|
return <View onLayout={e => onHeight(id, Math.round(e.nativeEvent.layout.height))}>{children}</View>;
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
+
type PanelCard = { key: string; node: ReactNode; column?: number };
|
|
377
|
+
/**
|
|
378
|
+
* The cards in columns, placed from their measured heights (invariant 149, a-card-resize-redraws-no-other-card). The
|
|
379
|
+
* heights live here, not in WorkspaceView: a card that grows or shrinks (a question picked or closed in Needs you)
|
|
380
|
+
* redraws these columns alone, and every card in them is the same element as before, so React skips it.
|
|
381
|
+
*/
|
|
382
|
+
function Columns({ cards, columns }: { cards: readonly PanelCard[]; columns: number }) {
|
|
383
|
+
// Measured heights and the last placement (so a card whose height changes with its column doesn't flip back and forth).
|
|
384
|
+
const [heights, setHeights] = useState<Record<string, number>>({});
|
|
385
|
+
const placed = useRef<Record<string, number>>({});
|
|
386
|
+
const onHeight = useCallback((id: string, h: number) => setHeights(prev => prev[id] === h ? prev : { ...prev, [id]: h }), []);
|
|
387
|
+
const where = placeCards(cards, columns, heights, placed.current);
|
|
388
|
+
placed.current = where;
|
|
389
|
+
return <View style={{ flexDirection: "row", alignItems: "flex-start" }}>
|
|
390
|
+
{Array.from({ length: columns }, (_, col) => <View key={col} style={{ flex: columns === 2 ? (col === 0 ? AGENT_SHARE : 1 - AGENT_SHARE) : 1, minWidth: 0 }}>
|
|
391
|
+
{cards.filter(x => where[x.key] === col).map(x => <Slot key={x.key} id={x.key} onHeight={onHeight}>{x.node}</Slot>)}
|
|
392
|
+
</View>)}
|
|
393
|
+
</View>;
|
|
394
|
+
}
|
|
395
|
+
|
|
376
396
|
/** A pending permission of one agent in the workspace, with Allow and Deny, in Needs you (`permissions`). */
|
|
377
397
|
function AgentPermissions({ agentId, theme, compact }: { agentId: string; theme: Theme; compact: boolean }) {
|
|
378
398
|
const agent = useAgentLive(agentId);
|
|
@@ -439,7 +459,9 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
|
|
|
439
459
|
const invalidated = () => { void cache.invalidateQueries({ queryKey: workspaceKey(w.id) }); void cache.invalidateQueries({ queryKey: overviewKey }); };
|
|
440
460
|
const auto = useMutation({ mutationFn: (next: boolean) => control({ workspaceId: w.id, enable_auto_sends: next }), onSuccess: (_, next) => { toast.show(next ? "Auto-send on for this workspace" : "Auto-send off · repairs wait for your Send"); invalidated(); }, onError: e => toast.error(errorText(e)) });
|
|
441
461
|
// Opening a workspace reads its PRs now: background polling backs off for settled repositories (server/github.ts).
|
|
442
|
-
|
|
462
|
+
// Nothing reads the workspace again after it (invariant 150): a change it finds moves the list copy's updatedAt, which
|
|
463
|
+
// re-reads once (useWorkspace), and its read stamps reach the "Checked" line through the feed.
|
|
464
|
+
useEffect(() => { void refresh({ workspaceId: w.id }).catch(() => undefined); }, [w.id]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
443
465
|
const update = useMutation({ mutationFn: () => refresh({ workspaceId: w.id }), onSuccess: () => setTimeout(invalidated, 1200), onError: e => toast.error(errorText(e)) });
|
|
444
466
|
const openAgent = navigation ? (agentId: string) => navigation.openAgent({ agentId }) : undefined;
|
|
445
467
|
const done = summary(w, now).status === "done";
|
|
@@ -481,10 +503,6 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
|
|
|
481
503
|
const workspaceCard = <WorkspaceCard workspace={w} theme={theme} compact={compact} openAgent={openAgent} browserReady={browser.data ? browser.data.ready : null} openOverview={openOverview} editSpec={() => setSpecOpen(true)} />;
|
|
482
504
|
// Home is a screen, with no client state (useAgent throws there): agent titles read the short id.
|
|
483
505
|
const extras = place === "home" ? <AgentTitleSource.Provider value={noClientState}>{workspaceCard}</AgentTitleSource.Provider> : workspaceCard;
|
|
484
|
-
// Measured heights and the last placement (so a card whose height changes with its column doesn't flip back and forth).
|
|
485
|
-
const [heights, setHeights] = useState<Record<string, number>>({});
|
|
486
|
-
const placed = useRef<Record<string, number>>({});
|
|
487
|
-
const onHeight = (id: string, h: number) => setHeights(prev => prev[id] === h ? prev : { ...prev, [id]: h });
|
|
488
506
|
// Priority order. The left column (the wide one in two) is the agent's, or Needs you's while anything waits on the
|
|
489
507
|
// developer: it reads first, as in one column, and the agent card moves to the next column. In two columns the
|
|
490
508
|
// decisions and PRs stay right and the record joins the shorter column; in three every other card goes to the
|
|
@@ -492,26 +510,19 @@ export function WorkspaceView({ theme, layout, workspace: w, navigation, loadErr
|
|
|
492
510
|
const waiting = needsYou(w, now).length > 0 || !!permissions || !!ask?.card;
|
|
493
511
|
const right = lay.columns === 2 ? 1 : undefined;
|
|
494
512
|
const agentCol = waiting ? 1 : 0;
|
|
495
|
-
const cards:
|
|
513
|
+
const cards: PanelCard[] = [
|
|
496
514
|
{ key: "shipped", node: shipped, column: 0 }, ...(waiting ? [{ key: "needs", node: needs, column: 0 }] : []),
|
|
497
515
|
{ key: "agent", node: agentCard, column: agentCol }, { key: "messages", node: messages, column: agentCol }, { key: "history", node: history, column: agentCol },
|
|
498
516
|
...(waiting ? [] : [{ key: "needs", node: needs, column: right }]), { key: "questions", node: questions, column: right }, { key: "stacks", node: stacks, column: right },
|
|
499
517
|
{ key: "tasks", node: tasks, column: right }, { key: "log", node: log }, { key: "extras", node: extras },
|
|
500
518
|
].filter(x => !!x.node);
|
|
501
|
-
const where = placeCards(cards, lay.columns, heights, placed.current);
|
|
502
|
-
placed.current = where;
|
|
503
519
|
const one = <>{shipped}{needs}{agentCard}{messages}{questions}{history}{stacks}{tasks}{log}{extras}</>;
|
|
504
|
-
const columns = multi && <View style={{ flexDirection: "row", alignItems: "flex-start" }}>
|
|
505
|
-
{Array.from({ length: lay.columns }, (_, col) => <View key={col} style={{ flex: lay.columns === 2 ? (col === 0 ? AGENT_SHARE : 1 - AGENT_SHARE) : 1, minWidth: 0 }}>
|
|
506
|
-
{cards.filter(x => where[x.key] === col).map(x => <Slot key={x.key} id={x.key} onHeight={onHeight}>{x.node}</Slot>)}
|
|
507
|
-
</View>)}
|
|
508
|
-
</View>;
|
|
509
520
|
return <View testID={`follow-up-view-${place}`} onLayout={event => setWidth(event.nativeEvent.layout.width)} style={{ flex: 1, backgroundColor: theme.colors.surface0 }}>
|
|
510
521
|
{/* Agent rows peek at their agent's turn on hover (client/turn-view.tsx), where Recent steps start folded. */}
|
|
511
522
|
<PeekHost where={place === "panel" ? "panel" : "main"} theme={theme} compact={compact} openAgent={openAgent} names={agentName} enabled={place === "panel"}>
|
|
512
523
|
<DockedPane compact={compact} scrollRef={scrollRef as never} header={!compact || place !== "panel" ? top : undefined} dock={dock} style={{ flex: 1 }} contentContainerStyle={{ paddingBottom: 20 }}>
|
|
513
524
|
{header}
|
|
514
|
-
{multi ? columns : one}
|
|
525
|
+
{multi ? <Columns cards={cards} columns={lay.columns} /> : one}
|
|
515
526
|
</DockedPane>
|
|
516
527
|
</PeekHost>
|
|
517
528
|
<PrSheet workspace={w} prKey={sheet?.key ?? null} intent={sheet?.intent ?? null} theme={theme} compact={compact} browserReady={browser.data?.ready ?? false} onClose={() => setSheet(null)} />
|
package/client/report-issue.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { Pressable, Text } from "./text";
|
|
|
4
4
|
import { openExternalUrl, useRpc, type PluginHostProps } from "@getpaseo/plugin/client";
|
|
5
5
|
import { Icon, Modal, ScrollView } from "@getpaseo/plugin/client/ui";
|
|
6
6
|
import { reportLinkRpc, reportSendRpc, reportTargetsRpc } from "../shared/contracts";
|
|
7
|
-
import { NEW_AGENT, NEW_WORKSPACE, PICKER_MAX, defaultChoice, pickerScrolls, newAgentLines, pickerRows, targetLines, type PickerRow, type SendTargets } from "../shared/report-send";
|
|
7
|
+
import { ABOUT_LINE, NEW_AGENT, NEW_WORKSPACE, PICKER_MAX, reportAbout, defaultChoice, pickerScrolls, newAgentLines, pickerRows, targetLines, type PickerRow, type SendTargets } from "../shared/report-send";
|
|
8
8
|
import { errorText } from "../shared/errors";
|
|
9
9
|
import { BRAND_ICONS } from "./brand-icons";
|
|
10
10
|
import { Button, SubmitScope, text } from "./kit";
|
|
@@ -19,7 +19,9 @@ import { Field } from "./field";
|
|
|
19
19
|
* interviews them, dry-runs follow_report_issue and shows the exact issue before filing it.
|
|
20
20
|
*/
|
|
21
21
|
export type ReportKind = "bug" | "feature" | "feedback";
|
|
22
|
-
export type ReportRequest = { kind?: ReportKind; error?: string | null; at?: number; agentId?: string; workspaceId?: string
|
|
22
|
+
export type ReportRequest = { kind?: ReportKind; error?: string | null; at?: number; agentId?: string; workspaceId?: string;
|
|
23
|
+
/** The workspace the report is about (the row menu's Report a bug…) and its title, for the About line. */
|
|
24
|
+
about?: string; aboutTitle?: string };
|
|
23
25
|
|
|
24
26
|
const slot = createHostSlot<ReportRequest>();
|
|
25
27
|
/**
|
|
@@ -78,13 +80,16 @@ export function ReportSheet({ request, theme, layout, openAgent, onClose }: { re
|
|
|
78
80
|
const [choosing, setChoosing] = useState(false);
|
|
79
81
|
const [phase, setPhase] = useState<Phase>({ kind: "edit" });
|
|
80
82
|
const [targets, setTargets] = useState<SendTargets | null>(null);
|
|
83
|
+
const [aboutRemoved, setAboutRemoved] = useState(false);
|
|
84
|
+
const about = reportAbout(request, kind, aboutRemoved);
|
|
85
|
+
const aboutName = request.aboutTitle || "this workspace";
|
|
81
86
|
const readTargets = useRpc(reportTargetsRpc); const send = useRpc(reportSendRpc); const link = useRpc(reportLinkRpc);
|
|
82
87
|
useEffect(() => {
|
|
83
88
|
let live = true;
|
|
84
89
|
readTargets({ workspaceId: request.workspaceId, agentId: request.agentId }).then(r => { if (live) setTargets(r); }).catch(() => { if (live) setTargets({ agents: [], defaultId: null, newAgentWorkspace: null }); });
|
|
85
90
|
return () => { live = false; };
|
|
86
91
|
}, [request.workspaceId, request.agentId]);
|
|
87
|
-
const chosen = picked ?? (targets ? defaultChoice(targets) : null);
|
|
92
|
+
const chosen = picked ?? (targets ? defaultChoice(targets, about) : null);
|
|
88
93
|
const rows = targets ? pickerRows(targets) : { pinned: [], agents: [] };
|
|
89
94
|
const chosenRow = [...rows.pinned, ...rows.agents].find(r => r.id === chosen) ?? null;
|
|
90
95
|
const nowhere = !!targets && !targets.agents.length && !targets.newAgentWorkspace && !targets.newWorkspace;
|
|
@@ -94,7 +99,7 @@ export function ReportSheet({ request, theme, layout, openAgent, onClose }: { re
|
|
|
94
99
|
if (empty || phase.kind === "sending" || !chosen) return;
|
|
95
100
|
setPhase({ kind: "sending" });
|
|
96
101
|
try {
|
|
97
|
-
const r = await send({ kind, text: words, error, ...(chosen === NEW_AGENT ? { newAgentWorkspaceId: targets!.newAgentWorkspace!.id } : chosen === NEW_WORKSPACE ? { newWorkspaceProjectId: targets!.newWorkspace!.projectId } : { agentId: chosen }) });
|
|
102
|
+
const r = await send({ kind, text: words, error, ...(about ? { workspaceId: about } : {}), ...(chosen === NEW_AGENT ? { newAgentWorkspaceId: targets!.newAgentWorkspace!.id } : chosen === NEW_WORKSPACE ? { newWorkspaceProjectId: targets!.newWorkspace!.projectId } : { agentId: chosen }) });
|
|
98
103
|
setPhase({ kind: "sent", ...r });
|
|
99
104
|
} catch (e) { setPhase({ kind: "failed", message: errorText(e) }); }
|
|
100
105
|
};
|
|
@@ -139,6 +144,18 @@ export function ReportSheet({ request, theme, layout, openAgent, onClose }: { re
|
|
|
139
144
|
</View>
|
|
140
145
|
<Pressable accessibilityRole="button" accessibilityLabel="Remove the error" hitSlop={8} onPress={() => setError(null)}><Icon name="X" size={14} color={c.foregroundMuted} /></Pressable>
|
|
141
146
|
</View>}
|
|
147
|
+
{about ? <View style={{ flexDirection: "row", gap: 8, alignItems: "flex-start", backgroundColor: c.surface2, borderRadius: 8, padding: 10 }}>
|
|
148
|
+
<Icon name="Folder" size={14} color={c.foregroundMuted} />
|
|
149
|
+
<View style={{ flex: 1, minWidth: 0 }}>
|
|
150
|
+
<Text numberOfLines={1} style={t.body}>About {aboutName}</Text>
|
|
151
|
+
<Text style={t.meta}>{ABOUT_LINE}</Text>
|
|
152
|
+
</View>
|
|
153
|
+
<Pressable accessibilityRole="button" accessibilityLabel={`Don't include ${aboutName}`} hitSlop={compact ? 14 : 8} onPress={() => setAboutRemoved(true)}
|
|
154
|
+
style={{ minWidth: compact ? 28 : 16, minHeight: compact ? 28 : 16, alignItems: "center", justifyContent: "center" }}><Icon name="X" size={14} color={c.foregroundMuted} /></Pressable>
|
|
155
|
+
</View> : request.about && kind === "bug" && aboutRemoved ? <Pressable accessibilityRole="button" onPress={() => setAboutRemoved(false)} hitSlop={8}
|
|
156
|
+
style={{ flexDirection: "row", alignItems: "center", gap: 6, alignSelf: "flex-start", minHeight: compact ? 44 : 0 }}>
|
|
157
|
+
<Icon name="Plus" size={14} color={c.foregroundMuted} /><Text style={t.meta}>Include {aboutName}</Text>
|
|
158
|
+
</Pressable> : null}
|
|
142
159
|
<Field value={words} onChangeText={setWords} multiline autoFocus={!compact} placeholder={placeholder} placeholderTextColor={c.foregroundMuted} accessibilityLabel="Describe it"
|
|
143
160
|
style={{ minHeight: compact ? 132 : 112, borderWidth: 1, borderColor: c.border, borderRadius: 8, backgroundColor: c.surface0, paddingHorizontal: 12, paddingVertical: 10, color: c.foreground, fontSize: compact ? 14 : 13, lineHeight: compact ? 20 : 18, textAlignVertical: "top" }} />
|
|
144
161
|
{nowhere ? <View style={{ flexDirection: "row", gap: 10, padding: 12, borderRadius: 8, backgroundColor: c.surface2 }}>
|
package/client/reviewers.tsx
CHANGED
|
@@ -30,8 +30,9 @@ export function useReviewerSettings() {
|
|
|
30
30
|
const noReview = query.data.noReview ?? [];
|
|
31
31
|
if (JSON.stringify(query.data.config) === JSON.stringify(reviewerConfig()) && JSON.stringify([...noReview].sort()) === JSON.stringify(noReviewRepoList())) return;
|
|
32
32
|
setReviewerConfig(query.data.config); setNoReviewRepos(noReview);
|
|
33
|
-
// Needs-you rows and counts were computed with the previous lists
|
|
34
|
-
|
|
33
|
+
// Needs-you rows and counts were computed with the previous lists: every open workspace redraws from the copy it
|
|
34
|
+
// already read (useWorkspace follows both lists), never a read of it again (invariant 150).
|
|
35
|
+
void cache.invalidateQueries({ queryKey: ["follow-up", "overview"] });
|
|
35
36
|
}, [query.data]);
|
|
36
37
|
return query;
|
|
37
38
|
}
|
package/client/row-actions.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { rowMenu, type LaterChoice, type RowMenuItem } from "../shared/row-menu"
|
|
|
9
9
|
import type { Workstream } from "../shared/home";
|
|
10
10
|
import { aboutKey } from "./about";
|
|
11
11
|
import { openRename } from "./rename";
|
|
12
|
+
import { openReportSheet } from "./report-issue";
|
|
12
13
|
import { bindToast, runAction } from "./toast-store";
|
|
13
14
|
import type { HomeSources } from "./home-data";
|
|
14
15
|
|
|
@@ -97,6 +98,7 @@ export function useRowMenu(host: RowMenuHost) {
|
|
|
97
98
|
case "unpin": return runAction({ label: "Unpin", run: async () => { await deps().setPinned!(workspaceId, false); }, success: `Unpinned ${s.title}`, failure: `Couldn't unpin ${s.title}` }, `pin:${workspaceId}`);
|
|
98
99
|
case "copy_branch": return runAction({ label: "Copy branch", run: () => copyText(arg), success: "Branch name copied", failure: "Couldn't copy here" });
|
|
99
100
|
case "rewrite_summary": return runAction({ label: "Rewrite summary", run: async () => cache.setQueryData(aboutKey(workspaceId), await about({ workspaceId, open: true, refresh: true })), success: "Summary rewritten" }, `about:${workspaceId}`);
|
|
101
|
+
case "report": return runAction({ label: "Report a bug", run: async () => openReportSheet({ kind: "bug", workspaceId, about: workspaceId, aboutTitle: s.title }), success: null });
|
|
100
102
|
case "rename_ai": return runAction({ label: "Rename title with AI", run: async () => openRename({ workspaceId, title: s.title }), success: null });
|
|
101
103
|
case "make_main": return runAction({ label: "Make main agent", run: async () => { await control({ workspaceId, mainAgentId: arg }); after(); }, success: `${s.agent ?? "That agent"} is now the main agent` }, `main:${workspaceId}`);
|
|
102
104
|
case "stop_following": return runAction({ label: "Stop following", run: async () => { await setFollow({ workspace: { workspaceId, follow: false } }); after(); }, success: `Stopped following ${s.title}` }, `follow:${workspaceId}`);
|