paseo-follow-up 2.4.0 → 2.4.1
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/CHANGELOG.md +19 -0
- package/client/home-chrome.tsx +3 -2
- package/client/search-focus.ts +38 -4
- package/package.json +1 -1
- package/shared/changelog.ts +2 -1
- package/shared/search-focus.ts +31 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
What changed in each version of Follow-up, newest first. Follow-up shows "What's new" after an update that brings new release notes: the curated part of each stable release since you last looked (betas install quietly; Settings → General can turn it off), and every version's notes from Home's version line.
|
|
4
4
|
|
|
5
|
+
## 2.4.1 (2026-11-26)
|
|
6
|
+
|
|
7
|
+
Two fixes for 2.4.0.
|
|
8
|
+
|
|
9
|
+
- **The search key always lands in the search.** Holding it a moment or typing before Home has drawn no longer leaves the cursor outside Home's search, and what you type goes into it.
|
|
10
|
+
- **What's new shows its bold.** The bold leads in release notes now reach the app, on desktop and on the phone.
|
|
11
|
+
|
|
12
|
+
<details><summary>Full changelog since 2.4.0</summary>
|
|
13
|
+
|
|
14
|
+
### Home and Needs you
|
|
15
|
+
|
|
16
|
+
- The search key now always puts the cursor in Home's search, even when you hold it a moment or start typing before Home has drawn. What you type goes into the search.
|
|
17
|
+
|
|
18
|
+
### Setup, Settings and updates
|
|
19
|
+
|
|
20
|
+
- What's new shows the bold in release notes. 2.4.0's fix dropped it on the way to the app.
|
|
21
|
+
|
|
22
|
+
</details>
|
|
23
|
+
|
|
5
24
|
## 2.4.0 (2026-11-26)
|
|
6
25
|
|
|
7
26
|
Start new work in one step, rank it by what the people you follow ask for, and use Follow-up with any agent provider, GitHub or not.
|
package/client/home-chrome.tsx
CHANGED
|
@@ -82,8 +82,9 @@ export function useOmnibox(model: HomeModel, sources: HomeSources, extraProvider
|
|
|
82
82
|
const current = active ?? fallback;
|
|
83
83
|
const move = useCallback((delta: number) => setActive(a => Math.max(0, Math.min((results?.length ?? 1) - 1, (a ?? fallback) + delta))), [results, fallback]);
|
|
84
84
|
// every-search-request-lands-in-the-visible-search: this field takes a search request (the key, ⌘K, `/`) while it is
|
|
85
|
-
// the one on screen, on mount, on layout, or when focus moves without the developer (client/search-focus.ts)
|
|
86
|
-
|
|
85
|
+
// the one on screen, on mount, on layout, or when focus moves without the developer (client/search-focus.ts); what
|
|
86
|
+
// the developer typed before it landed becomes the query.
|
|
87
|
+
const onSearchLayout = useSearchFocusField(sources.extras.searchFocus, inputRef, setQuery);
|
|
87
88
|
const focusSearch = useCallback(() => { const f = sources.extras.searchFocus; if (!f.shown()) return false; f.request(); return true; }, [sources.extras.searchFocus]);
|
|
88
89
|
const hint = layoutHint((results ?? []).flatMap(r => r.hit ? [r.hit] : []));
|
|
89
90
|
return { query, setQuery, setPhysical, layoutHint: hint, results, active: Math.min(current, Math.max(0, (results?.length ?? 1) - 1)), move, inputRef, onSearchLayout, focusSearch, askOn, images };
|
package/client/search-focus.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
2
|
import { Platform } from "react-native";
|
|
3
3
|
import { overlayOver, surfaceVisible } from "../shared/list-keys";
|
|
4
4
|
import { OVERLAYS } from "./list-keys";
|
|
@@ -11,16 +11,40 @@ import { createSearchFocus, type SearchFocus } from "../shared/search-focus";
|
|
|
11
11
|
* handler (that key makes the request after this runs). While it holds, focus moving without the developer tries again
|
|
12
12
|
* (`focusMoved`), except on a touch screen, where a focus() nobody tapped for would pop the keyboard up unasked. Native
|
|
13
13
|
* hears none of those events, so there the request ends with the first field that mounts or lays out after it.
|
|
14
|
+
*
|
|
15
|
+
* A key is the developer acting only when it is a new press of a key that does something (`keyActs`): the request's own
|
|
16
|
+
* chord held past the key-repeat delay (a Mac repeats ⌘⇧K while held) and a modifier pressed alone are not. A plain
|
|
17
|
+
* character typed before the caret lands is the query, not an act: it is kept (`typeAhead`) and lands in the field;
|
|
18
|
+
* Enter then is held back, never sent to the screen being left. Only for `TYPE_AHEAD_MS` after the request: past
|
|
19
|
+
* that, with no search on screen, a key is the developer's again (no timer: the key's own time decides).
|
|
14
20
|
*/
|
|
15
21
|
type Listen = (type: string, listener: (e: { target?: unknown }) => void, capture?: boolean) => void;
|
|
16
22
|
type Doc = { activeElement?: unknown; visibilityState?: string; querySelectorAll?(selector: string): Iterable<unknown> };
|
|
17
23
|
type Win = { addEventListener?: Listen; removeEventListener?: Listen; document?: Doc; matchMedia?(q: string): { matches: boolean } };
|
|
18
24
|
type El = { closest?(selector: string): unknown };
|
|
25
|
+
export type KeyLike = { key?: string; repeat?: boolean; isComposing?: boolean; ctrlKey?: boolean; metaKey?: boolean; altKey?: boolean; getModifierState?(key: string): boolean; target?: unknown; preventDefault?(): void; stopPropagation?(): void };
|
|
26
|
+
|
|
27
|
+
/** Keys that only modify another: pressing one alone (or again, around the request's chord) is not an act. */
|
|
28
|
+
const MODIFIERS = new Set(["Shift", "Control", "Meta", "Alt", "AltGraph", "CapsLock", "Fn", "FnLock", "OS", "Super", "Hyper", "Symbol", "SymbolLock", "NumLock", "ScrollLock"]);
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* What a keydown means to a held request: nothing (a chord held down repeating, as a Mac repeats ⌘⇧K; a lone
|
|
32
|
+
* modifier), a key for the search (a character, Backspace, or Enter, held back so it never sends the draft on the
|
|
33
|
+
* screen being left), or an act. AltGr's characters (reported as Ctrl+Alt on Windows) are typing.
|
|
34
|
+
*/
|
|
35
|
+
export function keyActs(e: KeyLike, inDialog: boolean): "ignore" | "type" | "act" {
|
|
36
|
+
const altGr = !!e.getModifierState?.("AltGraph");
|
|
37
|
+
const chord = !altGr && (e.ctrlKey || e.metaKey || e.altKey);
|
|
38
|
+
if (MODIFIERS.has(e.key ?? "") || e.repeat && chord) return "ignore";
|
|
39
|
+
if (e.isComposing || chord || inDialog) return "act";
|
|
40
|
+
const key = e.key ?? "";
|
|
41
|
+
return key === "Backspace" || key === "Enter" || [...key].length === 1 ? "type" : "act";
|
|
42
|
+
}
|
|
19
43
|
|
|
20
44
|
/** Where focus went: into a dialog or menu (the request waits for it), or onto a Home search. */
|
|
21
45
|
const DIALOG = '[role="dialog"],[role="alertdialog"],[aria-modal="true"],[role="menu"]';
|
|
22
46
|
export const SEARCH_FIELD_ATTR = "data-follow-up-search";
|
|
23
|
-
const CANCEL_EVENTS = ["
|
|
47
|
+
const CANCEL_EVENTS = ["pointerdown", "click", "wheel", "touchstart", "input"] as const;
|
|
24
48
|
|
|
25
49
|
export function createWebSearchFocus(): SearchFocus & { install(): () => void } {
|
|
26
50
|
const focus = createSearchFocus();
|
|
@@ -36,6 +60,13 @@ export function createWebSearchFocus(): SearchFocus & { install(): () => void }
|
|
|
36
60
|
install() {
|
|
37
61
|
if (!web) return () => undefined;
|
|
38
62
|
const cancel = () => focus.cancel();
|
|
63
|
+
const onKey = (e: KeyLike) => {
|
|
64
|
+
if (!focus.wanted()) return;
|
|
65
|
+
const what = keyActs(e, !!(e.target as El | null)?.closest?.(DIALOG));
|
|
66
|
+
if (what === "ignore") return;
|
|
67
|
+
if (what === "type" && focus.typeAhead(e.key ?? "")) { e.preventDefault?.(); e.stopPropagation?.(); return; }
|
|
68
|
+
focus.cancel();
|
|
69
|
+
};
|
|
39
70
|
const coarse = !!win.matchMedia?.("(pointer: coarse)").matches;
|
|
40
71
|
const moved = (e: { target?: unknown }) => {
|
|
41
72
|
if (!focus.wanted()) return;
|
|
@@ -44,8 +75,9 @@ export function createWebSearchFocus(): SearchFocus & { install(): () => void }
|
|
|
44
75
|
focus.focusMoved({ dialog: !!el?.closest?.(DIALOG), search: !!el?.closest?.(`[${SEARCH_FIELD_ATTR}]`) });
|
|
45
76
|
};
|
|
46
77
|
for (const t of CANCEL_EVENTS) win.addEventListener!(t, cancel, true);
|
|
78
|
+
win.addEventListener!("keydown", onKey as never, true);
|
|
47
79
|
win.addEventListener!("focusin", moved, true);
|
|
48
|
-
return () => { for (const t of CANCEL_EVENTS) win.removeEventListener?.(t, cancel, true); win.removeEventListener?.("focusin", moved, true); };
|
|
80
|
+
return () => { for (const t of CANCEL_EVENTS) win.removeEventListener?.(t, cancel, true); win.removeEventListener?.("keydown", onKey as never, true); win.removeEventListener?.("focusin", moved, true); };
|
|
49
81
|
},
|
|
50
82
|
};
|
|
51
83
|
}
|
|
@@ -59,7 +91,8 @@ type Input = { focus(): void; select?(): void; checkVisibility?(): boolean; getC
|
|
|
59
91
|
* selects the query, so typing replaces it, as in a command palette. Returns the field's onLayout, which tries a
|
|
60
92
|
* waiting request again when the field comes on screen. The field carries SEARCH_FIELD_ATTR (QueryField's `dataSet`).
|
|
61
93
|
*/
|
|
62
|
-
export function useSearchFocusField(owner: SearchFocus, ref: { current: unknown }): () => void {
|
|
94
|
+
export function useSearchFocusField(owner: SearchFocus, ref: { current: unknown }, setQuery?: (q: string) => void): () => void {
|
|
95
|
+
const typeRef = useRef(setQuery); typeRef.current = setQuery;
|
|
63
96
|
useEffect(() => {
|
|
64
97
|
const doc = (globalThis as Win).document;
|
|
65
98
|
const web = Platform.OS === "web" && !!doc;
|
|
@@ -68,6 +101,7 @@ export function useSearchFocusField(owner: SearchFocus, ref: { current: unknown
|
|
|
68
101
|
covered: () => web && overlayOver((doc!.querySelectorAll?.(OVERLAYS) ?? []) as never, ref.current),
|
|
69
102
|
focused: () => web ? !!ref.current && doc!.activeElement === ref.current : !!(ref.current as { isFocused?(): boolean } | null)?.isFocused?.(),
|
|
70
103
|
focus: () => { const el = ref.current as Input | null; el?.focus(); if (web) el?.select?.(); },
|
|
104
|
+
type: text => typeRef.current?.(text),
|
|
71
105
|
});
|
|
72
106
|
}, [owner, ref]);
|
|
73
107
|
return () => { if (owner.wanted()) owner.changed(); };
|
package/package.json
CHANGED
package/shared/changelog.ts
CHANGED
|
@@ -212,7 +212,8 @@ export type InstallKind = typeof INSTALL_KINDS[number];
|
|
|
212
212
|
|
|
213
213
|
export const releaseNoteSchema = z.object({ version: z.string(), date: z.string().nullable(), items: z.array(z.string()),
|
|
214
214
|
blocks: z.array(z.union([
|
|
215
|
-
z.object({ kind: z.enum(["heading", "text", "bullet", "rule"]), text: z.string()
|
|
215
|
+
z.object({ kind: z.enum(["heading", "text", "bullet", "rule"]), text: z.string(),
|
|
216
|
+
runs: z.array(z.object({ text: z.string(), bold: z.literal(true).optional() })).optional() }),
|
|
216
217
|
z.object({ kind: z.literal("image"), text: z.string(), url: z.string(), aspect: z.number().nullable(), width: z.number().nullable() }),
|
|
217
218
|
])).optional() });
|
|
218
219
|
/** `follow.release-notes`: this host's version record and every shipped note. Read once per app session; never polled. */
|
package/shared/search-focus.ts
CHANGED
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
* once the caret has landed a focus move elsewhere is taken back at most once (enough for ⌘K handing focus back as it
|
|
13
13
|
* closes); the next one is the developer's.
|
|
14
14
|
*
|
|
15
|
+
* Only the developer's own act ends a request, never the request's own key: a held chord's auto-repeat and a modifier
|
|
16
|
+
* pressed or re-pressed around it are not acts (the adapter drops them), and characters typed before the caret lands
|
|
17
|
+
* are typed into the search (`typeAhead`), handed to the field the moment it takes the caret. 2026-11-26, the
|
|
18
|
+
* developer on 2.4.0-rc.0: the key opened Home but the caret never reached the search; a Mac repeats a held ⌘⇧K
|
|
19
|
+
* within its key-repeat delay, and a query typed while a large Home mounted ended the request on its first letter.
|
|
20
|
+
*
|
|
15
21
|
* A field is shown only when it is on screen. Paseo keeps earlier screens mounted behind the current one, so more
|
|
16
22
|
* than one Home search can be mounted; only the newest one the developer can see takes the caret. Pure, so tests run
|
|
17
23
|
* it without a DOM (client/search-focus.ts is the adapter).
|
|
@@ -24,9 +30,14 @@ export type FocusField = {
|
|
|
24
30
|
focus(): void;
|
|
25
31
|
/** A menu or modal dialog is drawn over it: the request waits (never fights the dialog for focus). */
|
|
26
32
|
covered?(): boolean;
|
|
33
|
+
/** Puts text typed ahead of the caret into the field (replacing the query the landing selected). */
|
|
34
|
+
type?(text: string): void;
|
|
27
35
|
};
|
|
28
36
|
|
|
29
|
-
|
|
37
|
+
/** How long after a request typed keys are kept for the search; a key later than this, with no caret yet, is an act. */
|
|
38
|
+
export const TYPE_AHEAD_MS = 2000;
|
|
39
|
+
|
|
40
|
+
export function createSearchFocus(now: () => number = Date.now) {
|
|
30
41
|
const fields: FocusField[] = [];
|
|
31
42
|
let want = false;
|
|
32
43
|
/** The caret landed for this request (so a later focus move away may be taken back once). */
|
|
@@ -34,6 +45,9 @@ export function createSearchFocus() {
|
|
|
34
45
|
let retaken = false;
|
|
35
46
|
/** A focus() inside a delivery fires focusin, which must not deliver again. */
|
|
36
47
|
let delivering = false;
|
|
48
|
+
/** Characters typed after the request and before the caret landed: they belong in the search. */
|
|
49
|
+
let ahead = "";
|
|
50
|
+
let askedAt = 0;
|
|
37
51
|
/** The newest shown field: a screen pushed later sits in front. */
|
|
38
52
|
const target = () => { for (let i = fields.length - 1; i >= 0; i--) if (fields[i].shown()) return fields[i]; return null; };
|
|
39
53
|
const deliver = (): boolean => {
|
|
@@ -43,12 +57,12 @@ export function createSearchFocus() {
|
|
|
43
57
|
delivering = true;
|
|
44
58
|
try { if (!field.focused()) field.focus(); } finally { delivering = false; }
|
|
45
59
|
const took = field.focused();
|
|
46
|
-
if (took) landed = true;
|
|
60
|
+
if (took) { landed = true; if (ahead) { field.type?.(ahead); ahead = ""; } }
|
|
47
61
|
return took;
|
|
48
62
|
};
|
|
49
63
|
return {
|
|
50
64
|
/** Asks for the caret in the shown search field; true when it is there now. It keeps asking until `cancel()`. */
|
|
51
|
-
request(): boolean { want = true; landed = false; retaken = false; return deliver(); },
|
|
65
|
+
request(): boolean { want = true; landed = false; retaken = false; ahead = ""; askedAt = now(); return deliver(); },
|
|
52
66
|
/** A Home search field is on screen (so a request needs no navigation). */
|
|
53
67
|
shown: () => target() !== null,
|
|
54
68
|
/** A request is waiting for the developer to act. */
|
|
@@ -69,8 +83,21 @@ export function createSearchFocus() {
|
|
|
69
83
|
if (landed) { if (retaken) { want = false; return; } retaken = true; }
|
|
70
84
|
deliver();
|
|
71
85
|
},
|
|
86
|
+
/**
|
|
87
|
+
* A plain character, Backspace or Enter typed while the request waits for its field: kept for the search (Enter
|
|
88
|
+
* only held back), and true when taken (the caller stops the key going anywhere else). Once the caret has landed,
|
|
89
|
+
* with no request, or `TYPE_AHEAD_MS` after it (nothing came on screen: the keys are the developer's again), false.
|
|
90
|
+
*/
|
|
91
|
+
typeAhead(key: string): boolean {
|
|
92
|
+
if (!want || landed || now() - askedAt > TYPE_AHEAD_MS) return false;
|
|
93
|
+
if (key === "Enter") return true;
|
|
94
|
+
if (key === "Backspace") { if (!ahead) return false; ahead = ahead.slice(0, -1); return true; }
|
|
95
|
+
if ([...key].length !== 1) return false;
|
|
96
|
+
ahead += key;
|
|
97
|
+
return true;
|
|
98
|
+
},
|
|
72
99
|
/** The developer acted: the request is theirs to keep or drop, so stop holding it. */
|
|
73
|
-
cancel(): void { want = false; },
|
|
100
|
+
cancel(): void { want = false; ahead = ""; },
|
|
74
101
|
};
|
|
75
102
|
}
|
|
76
103
|
export type SearchFocus = ReturnType<typeof createSearchFocus>;
|