experiments in a post-browser web
10
fork

Configure Feed

Select the types of activity you want to include in your feed.

refactor(features): drop unnecessary resident tiles; manifest is the only truth

Removes resident: true from features whose home tiles do not need a
persistent background renderer at startup, and deletes the
EAGER_TILE_IDS plumbing that hard-coded entities as eager from
main.ts.

Why:
- Several feature manifests declared resident: true purely so a UI
tile would be ready on first open, not because they had any
startup side-effects or background work. Each one cost a
BrowserWindow at boot and showed up as "hidden" in the Windows
feature, confusing the user.
- EAGER_TILE_IDS was a side-channel that could mark a tile eager
even when its manifest said otherwise. The manifest should be the
only declaration of resident vs lazy.

Changes:
- Drop resident: true from hello-world, lex, lists, widget-demo
manifests. Their commands or home tiles open on demand and have
no startup pubsub work.
- Kept resident on entities (page:content-ready listener),
websearch (page:loaded for OpenSearch discovery), tag-actions
(RPC handler for tag-actions:get-all published by groups,
search, tags, pagestream).
- Remove EAGER_TILE_IDS constant and its pass-through from
main.ts -> feature-startup -> tile-loader -> tile-compat.
shouldLazyLoad is now just !residentEntry.

+6 -25
-3
backend/electron/feature-startup.ts
··· 29 29 builtinFeaturesDir: string; 30 30 /** Path to the tile preload script */ 31 31 tilePreloadPath: string; 32 - /** Feature IDs that should load eagerly */ 33 - eagerIds?: Set<string>; 34 32 /** Current Peek app version (for minPeekVersion checks on installs) */ 35 33 peekVersion?: string; 36 34 } ··· 210 208 // 3. Load features 211 209 const loaderConfig: TileLoaderConfig = { 212 210 tilePreloadPath: config.tilePreloadPath, 213 - eagerIds: config.eagerIds, 214 211 }; 215 212 216 213 const loadResults = loadFeaturesFromRegistry(registry, loaderConfig);
+1 -7
backend/electron/main.ts
··· 74 74 const _sessionRestoreDonePromise = new Promise<void>(resolve => { _sessionRestoreDoneResolve = resolve; }); 75 75 let _sessionRestoreDone = false; 76 76 77 - // Tiles that must load eagerly (not lazy) — needed at startup. 78 - // Passed to the tile-compat path via `eagerIds`; tile-compat checks 79 - // this set in addition to the manifest `resident: true` flag. 80 - const EAGER_TILE_IDS = new Set(['entities']); 81 - 82 77 // Dev tiles loaded via --load-extension CLI flag 83 78 // These are transient (not persisted) and always have devtools open 84 79 const devTiles = new Map<string, { path: string }>(); ··· 761 756 * Load all enabled features. Each feature is a tile. 762 757 * - Builtin features (cmd/hud/page core renderers) launch via core-glue. 763 758 * - Feature tiles in `features/` launch via the tile launcher (eager 764 - * if any tile entry has `resident: true` or in `EAGER_TILE_IDS`, otherwise lazy stubs). 759 + * if any tile entry has `resident: true`, otherwise lazy stubs). 765 760 */ 766 761 export async function loadFeatures(): Promise<number> { 767 762 const featStart = Date.now(); ··· 800 795 appDataDir: config.userDataPath, 801 796 builtinFeaturesDir: featuresDir, 802 797 tilePreloadPath, 803 - eagerIds: EAGER_TILE_IDS, 804 798 }); 805 799 for (const r of featureResult.loadResults) { 806 800 if (r.loaded) loadedTileIds.add(r.id);
+2 -5
backend/electron/tile-compat.ts
··· 51 51 export interface TileCompatConfig { 52 52 /** Path to the tile preload script */ 53 53 tilePreloadPath: string; 54 - /** Set of tile IDs that should load eagerly (not lazy) */ 55 - eagerIds?: Set<string>; 56 54 } 57 55 58 56 /** ··· 75 73 registerTilePath(tile.id, tile.path); 76 74 77 75 const manifest = tile.manifest; 78 - const isEager = config.eagerIds?.has(tile.id) ?? false; 79 76 80 77 // A tile is resident if any entry declares `resident: true`. 81 78 const residentEntry = manifest.tiles.find(t => t.resident === true); 82 79 const hasLazyEvents = manifest.tiles.some(t => Array.isArray(t.lazyEvents) && t.lazyEvents.length > 0); 83 - // Non-eager tiles with no resident entry are lazy-loaded on first use. 84 - const shouldLazyLoad = !isEager && !residentEntry; 80 + // Tiles with no resident entry are lazy-loaded on first use. 81 + const shouldLazyLoad = !residentEntry; 85 82 const hasCommands = !!(manifest.commands && manifest.commands.length > 0); 86 83 87 84 if (shouldLazyLoad && (hasCommands || hasLazyEvents)) {
-3
backend/electron/tile-loader.ts
··· 42 42 export interface TileLoaderConfig { 43 43 /** Path to the tile preload script */ 44 44 tilePreloadPath: string; 45 - /** Set of feature IDs that should load eagerly */ 46 - eagerIds?: Set<string>; 47 45 } 48 46 49 47 // ─── Loader ───────────────────────────────────────────────────────── ··· 177 175 178 176 const compatConfig: TileCompatConfig = { 179 177 tilePreloadPath: config.tilePreloadPath, 180 - eagerIds: config.eagerIds, 181 178 }; 182 179 183 180 try {
+1 -2
features/hello-world/manifest.json
··· 12 12 "url": "home.html", 13 13 "width": 700, 14 14 "height": 900, 15 - "title": "Hello World", 16 - "resident": true 15 + "title": "Hello World" 17 16 } 18 17 ], 19 18 "capabilities": {
+1 -2
features/lex/manifest.json
··· 14 14 "height": 620, 15 15 "title": "Lexicon Studio", 16 16 "role": "workspace", 17 - "key": "lex-home", 18 - "resident": true 17 + "key": "lex-home" 19 18 }, 20 19 { 21 20 "id": "chain-form",
-1
features/lists/manifest.json
··· 15 15 "width": 700, 16 16 "height": 768, 17 17 "title": "Lists", 18 - "resident": true, 19 18 "keepLive": true 20 19 } 21 20 ],
+1 -2
features/widget-demo/manifest.json
··· 11 11 "id": "sheet", 12 12 "url": "sheet.html", 13 13 "key": "peek://widget-demo/sheet.html", 14 - "title": "Widget Demo", 15 - "resident": true 14 + "title": "Widget Demo" 16 15 } 17 16 ], 18 17 "capabilities": {