waybetter-for-x/apps/desktop/src/areas/chat/index.ts
CRT 6d1798038c Chat+ link previews: a link in a chat shows its page's title, text and picture, YouTube playable in place
X's web chat shows a link as a bare card. An X tab on a chat page may now ask native code
(link_preview, x-capture only, chat pages only) for one link's preview. Native code fetches it:
https and public hosts only (addresses checked and pinned), never X's hosts, no cookies or
referrer, redirects re-checked, page head <= 512 KB, images <= 1.5 MB by magic bytes as data:,
30 fetches a minute, memory-only cache. Only the link leaves the page. On by default (owner,
2026-10-10).
2026-10-10 21:47:31 +08:00

27 lines
1.3 KiB
TypeScript

// Chat+: its feature modules (docs/AREA-PLUGINS.md; Navigation+ in ../navigation is the reference).
// One module per `backing: 'module'` row of ./features.ts; the registry starts each only while its
// flag is on, the area is on and the page is on one of its surfaces.
//
// X's chat is the one place the rest of the app stays out of (a heavy page). These modules run
// there on purpose and keep it cheap: one shared watch each (child list only, one frame), looking
// only at X's message list or its conversation list. ./x.ts is what they know about X's chat.
// None of them writes or sends a message, reacts, deletes or marks anything read. The one request is
// Link previews' (owner-approved, 2026-10-10): the link alone, to native code, which fetches its preview.
import type { FeatureModule } from '../../../../../waybetter/packages/runtime/src/featureModules.ts';
import type { PluginApi } from '../../inject/pluginApi.ts';
import { bookmarks } from './bookmarks.ts';
import { keywords } from './keywords.ts';
import { linkPreviews } from './linkPreviews.ts';
import { personFilter } from './personFilter.ts';
import { pins } from './pins.ts';
import { searchLoaded } from './searchLoaded.ts';
export const MODULES: ReadonlyArray<FeatureModule<PluginApi>> = [
bookmarks,
searchLoaded,
pins,
personFilter,
keywords,
linkPreviews,
];