Skip to content

Commit 46d375b

Browse files
committed
@ begone
1 parent 964448f commit 46d375b

6 files changed

Lines changed: 27 additions & 8 deletions

File tree

AGENTS.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,31 @@
3434
## UI Name Formatting
3535

3636
- For chat author display, hide a leading `@` in UI text while keeping underlying identity data unchanged.
37-
- Use `src/ts/author-name.ts` (`formatAuthorName`) for this transformation and apply it at render points.
37+
- Use `src/ts/component-utils.ts` (`formatAuthorName`) for this transformation and apply it at render points.
3838

3939
## Testbed URL
4040

4141
- Headless validation should open the same `startUrl` used by `vite.config.ts`.
4242
- `scripts/codex-dev.sh go-test` now does this automatically (defaulting by detected mode), and `TEST_URL` can override when needed.
4343

44+
## Cross-Browser Headless Validation Notes
45+
46+
- Always rebuild for the target browser before runtime validation:
47+
- `yarn build:chrome`
48+
- `yarn build:firefox`
49+
- Chromium extension validation is most reliable in CI/headless shells with:
50+
- Playwright Chromium persistent context
51+
- `headless=false` plus `--ozone-platform=headless`
52+
- extension args: `--disable-extensions-except=<build>` and `--load-extension=<build>`
53+
- Firefox validation in this environment must set `HOME=/root` before launching browser automation as root, or Firefox exits early with a root/session ownership error.
54+
- For Firefox runtime checks, prefer `https://www.youtube.com/live_chat?v=jfKfPfyJRdk&is_popout=1` for deterministic chat-frame loading in headless mode.
55+
56+
## Embed 404 Notes (MV3)
57+
58+
- The MV3 embed fallback page (`/embed/hyperchat_embed`) can render a centered YouTube logo/error artifact if page elements are not fully removed.
59+
- In `src/scripts/chat-mounter.ts`, treat the HyperChat mount root as the only allowed direct `body` child and aggressively remove fallback embed artifacts.
60+
- If the logo reappears in browser tests, prioritize checking `chat-mounter.ts` cleanup selectors and page timing behavior before touching parser/UI code.
61+
4462
## Operational Commands
4563

4664
- `scripts/codex-dev.sh status` shows watcher/MCP/browser states.

src/components/MembershipItem.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script lang="ts">
22
import Message from './Message.svelte';
33
import MessageRun from './MessageRuns.svelte';
4-
import { formatAuthorName } from '../ts/author-name';
4+
import { formatAuthorName } from '../ts/component-utils';
55
import { showProfileIcons } from '../ts/storage';
66
import { membershipBackground, milestoneChatBackground } from '../ts/chat-constants';
77

src/components/Message.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
} from '../ts/storage';
1414
import { chatUserActionsItems, Theme } from '../ts/chat-constants';
1515
import { useBanHammer } from '../ts/chat-actions';
16-
import { formatAuthorName } from '../ts/author-name';
16+
import { formatAuthorName } from '../ts/component-utils';
1717
import { mdiGift } from '@mdi/js';
1818
1919
export let message: Ytc.ParsedMessage;

src/components/PaidMessage.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import Message from './Message.svelte';
33
import isDarkColor from 'is-dark-color';
44
import { Theme } from '../ts/chat-constants';
5-
import { formatAuthorName } from '../ts/author-name';
5+
import { formatAuthorName } from '../ts/component-utils';
66
import { showProfileIcons } from '../ts/storage';
77
88
export let message: Ytc.ParsedMessage;

src/ts/author-name.ts

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/ts/component-utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ export const getDropdownOffsetY = async (div: HTMLElement, boundingDiv: HTMLElem
3030
return 'top-12';
3131
}
3232
};
33+
34+
export const formatAuthorName = (name: string): string => {
35+
if (!name.startsWith('@')) return name;
36+
return name.slice(1);
37+
};

0 commit comments

Comments
 (0)