Skip to content

fovea 0.2.6: the evidence page follows magpie's theme, and a neon F icon that shows on a dark sidebar - #934

Open
webkubor wants to merge 2 commits into
magpie-community:mainfrom
webkubor:feat/fovea-0.3.0
Open

webkubor wants to merge 2 commits into
magpie-community:mainfrom
webkubor:feat/fovea-0.3.0

Conversation

@webkubor

Copy link
Copy Markdown
Contributor

fovea 0.3.0: the evidence page and its icon. The middleware is unchanged (fovea.middleware.js, cases.json, the tests are byte-identical to 0.2.5), so nothing about what gets cut changes.

1. The page follows magpie's theme. It loads _magpie/bridge.js and follows magpie.ready / magpie.onTheme (theme.dark), the same contract free-tokens, chat and usage use. Until now it only followed the OS, so a dark magpie on a light OS showed a light page. Opened outside magpie the bridge isn't there, and the CSS falls back to prefers-color-scheme as before.

2. The icon shows on a dark sidebar. page/icon.svg and magpie.icon (the same SVG) were an ink-line eye that disappeared on dark. They are now the neon F on its own tile, which reads on light and dark. The page itself uses icon.svg instead of an inline copy.

3. Palette and wording. The page colours move to the brand palette (recent window violet, old messages dashed). The source badge reads 示例数据 / 实测数据 instead of synthetic.

Version is 0.3.0 rather than 0.2.6 because the theme bridge is new behaviour. package.json, the first ## [x.y.z] in CHANGELOG and the README release badge all say 0.3.0. files is unchanged: page/* covers the new files, and nothing from the standalone repo's brand/ comes along.

Checks, run locally:

  • HOME=$(mktemp -d) bun test packages/fovea: 57 pass, 0 fail (558 expects). That includes "the page is wired and offline", which shows the new page names no network URL.
  • bun scripts/check.mjs fovea: passes. Middleware is skipped by design, and registry.json passes.
  • A root bun test on this machine has timeout failures in agent-office and agy-cli. A pristine origin/main gives the same failures, so this PR doesn't cause them.

@magpie-community/middleware-fovea is still new to npm, so it reaches magpie through the dist branch as before.

…con that shows on a dark sidebar

- page loads _magpie/bridge.js and follows magpie.ready / magpie.onTheme;
  outside magpie it falls back to prefers-color-scheme as before
- page/icon.svg and magpie.icon: the neon F on its own tile, visible on
  light and dark sidebars (the ink-line eye vanished on dark)
- page palette moved to the brand colours; source badge reads 示例数据/实测数据
- CHANGELOG [0.3.0], README release badge; middleware unchanged
@webkubor webkubor changed the title fovea 0.3.0: the evidence page follows magpie's theme, and a neon F icon that shows on a dark sidebar fovea 0.2.6: the evidence page follows magpie's theme, and a neon F icon that shows on a dark sidebar Nov 10, 2026

@yetone yetone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. The theme following works, and the old icon really did vanish on a dark sidebar, so both halves fix real problems. I can't merge it as it stands, though: the icon and the page restyle go against the UI rules magpie holds its window to, and the restyle goes well past what the title says the PR does.

Reviewed head: 7dbb5ce429911974bc18741a5e7cd196966cc9e5 (merge base 5292fc9f, one commit behind main, which doesn't touch fovea).

What was run at that head

  • bun test packages/fovea: 57 pass, 0 fail (558 expects). Run on the Linux box (WSL2 Ubuntu 24.04, Bun 1.4.2).
  • bun scripts/check.mjs: exit 0.
  • Theme, rendered in Playwright 1.62.0 (Chromium and WebKit): the page ran in a sandbox="allow-scripts" frame with magpie's real pagebridge.js (origin/main) served as _magpie/bridge.js, and a parent that answers hello and later sends a theme event. I tried all 4 combinations of OS light/dark × magpie light/dark, and the page always took magpie's theme (body #F4F3FA / #05060B). A live switch in each direction repainted at once, in both engines. Opened outside magpie (bridge 404), it falls back to prefers-color-scheme as the changelog says.
  • What I broke by hand:
    • With main's style.css and the PR's JS, the page stays on the OS theme in every combination and ignores live switches. So the :root[data-theme] CSS is the part that does the work.
    • With the applyTheme block taken out of app.js, the theme still follows in every combination and on live switches. bridge.js already sets document.documentElement.dataset.theme itself (its paint(), on ready and on every theme event). That block is redundant and can go.
  • Icon: page/icon.svg and the magpie.icon data URI decode to the same bytes. The SVG is safe: no <script>, no event handlers, no external href, and only internal url(#…) references. I rendered it at 16px the way magpie's sidebar draws it (img.nav-ic, 3px radius) next to the built-in line icons, on a light (#f3f3f3) and a dark (#232325) sidebar.
  • No .github/, publish script, dependency, network address or credential changes.

What needs to change

  1. The icon. At 16px it is a near-black tile with a cyan-to-violet gradient F and a magenta offset layer. Every other sidebar icon is a single muted line glyph, so on a light sidebar it reads as a black square that is louder than anything else in the list. magpie's UI avoids gradients and colourful accents, so a sidebar icon shouldn't add them. The bug to fix is only that #161616 disappears on dark. A single mid-tone colour that reads on both backgrounds would fix it (e.g. a grey around #8a8a8e, which magpie's own nav icons sit close to), keeping your rows-to-head-and-tail shape or the F made of rows, with no tile, gradient or second colour layer. The same goes for magpie.icon in package.json, which the Plugins listing shows.

  2. The page restyle. These parts aren't needed to follow the theme. Please drop them, or send them as their own PR with a reason:

    • the neon palette (--ink #00F0FF in dark, --violet, --magenta);
    • the gradient on .fill.slim (linear-gradient(90deg, var(--violet), var(--ink)));
    • .note's left border recoloured to magenta. magpie doesn't use coloured left-border stripes at all. Since this line is touched anyway, please remove the stripe rather than recolour it. A plain border or the panel's normal surface is enough;
    • .stat.accent's coloured border, the button hover/press transitions and the new focus ring;
    • the synthetic → 「示例数据」 label change (fine on its own, but it is a separate change);
    • the README release badge (it has to be bumped on every release, or it goes stale).

    Keeping the old palette and only moving it from @media (prefers-color-scheme: dark) to :root[data-theme="dark"] plus @media (prefers-color-scheme: dark) { :root:not([data-theme]) … }, as you did, is all the theme fix needs.

  3. Nit: remove the applyTheme block in app.js (see above).

  4. Suggestion, not blocking: the page keeps its own #05060B dark background, while magpie's window background is lighter. The bridge hands you --magpie-bg, --magpie-fg, --magpie-card, --magpie-line, --magpie-muted and --magpie-accent. Using them, with your current values as fallbacks (var(--magpie-bg, #0f151d)), would make the page sit in the window instead of a black hole inside it.

The PR description still says 0.3.0 everywhere (and its point 3 calls the palette move part of the change), while the head is 0.2.6; please bring the description in line with whatever the next head is. The version bump itself is consistent (package.json 0.2.6, CHANGELOG 0.2.6; registry.json carries no version). Please update the CHANGELOG entry to whatever remains.


简要:主题跟随是对的(Chromium/WebKit,系统深浅色 × magpie 深浅色四种组合,实时切换都验证过),旧图标在深色侧栏不可见的问题也确实存在。需要改的是:图标请改成单一中性色的线条图形,不要深色底块、渐变和品红叠层;页面上的霓虹配色、进度条渐变、.note 的品红左边框(请直接去掉左边框)、按钮动效、README 版本徽章和「示例数据」文案,都超出了这个 PR 的目标,请去掉或另开 PR。app.js 里的 applyTheme 可以删掉,bridge.js 已经替页面设置了 data-theme。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants