Repository navigation
Conversation
…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
…con that shows on a dark sidebar
yetone
left a comment
There was a problem hiding this comment.
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 realpagebridge.js(origin/main) served as_magpie/bridge.js, and a parent that answershelloand later sends athemeevent. 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 toprefers-color-schemeas the changelog says. - What I broke by hand:
- With main's
style.cssand 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
applyThemeblock taken out ofapp.js, the theme still follows in every combination and on live switches.bridge.jsalready setsdocument.documentElement.dataset.themeitself (itspaint(), onreadyand on everythemeevent). That block is redundant and can go.
- With main's
- Icon:
page/icon.svgand themagpie.icondata URI decode to the same bytes. The SVG is safe: no<script>, no event handlers, no externalhref, and only internalurl(#…)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
-
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
#161616disappears 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 formagpie.iconin package.json, which the Plugins listing shows. -
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#00F0FFin 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. - the neon palette (
-
Nit: remove the
applyThemeblock inapp.js(see above). -
Suggestion, not blocking: the page keeps its own
#05060Bdark background, while magpie's window background is lighter. The bridge hands you--magpie-bg,--magpie-fg,--magpie-card,--magpie-line,--magpie-mutedand--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。
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.jsand followsmagpie.ready/magpie.onTheme(theme.dark), the same contractfree-tokens,chatandusageuse. 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 toprefers-color-schemeas before.2. The icon shows on a dark sidebar.
page/icon.svgandmagpie.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 usesicon.svginstead 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.filesis unchanged:page/*covers the new files, and nothing from the standalone repo'sbrand/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, andregistry.jsonpasses.bun teston this machine has timeout failures inagent-officeandagy-cli. A pristineorigin/maingives the same failures, so this PR doesn't cause them.@magpie-community/middleware-foveais still new to npm, so it reaches magpie through thedistbranch as before.