Skip to content

feat(briefing): redesign the briefing page — wide two-column layout, source tiles and cards, priority / bug / updated filters, tick-off; bracketed link text renders - #88

Merged
LiminCode merged 1 commit into
mainfrom
briefing-page-ui
Nov 20, 2026
Merged

LiminCode merged 1 commit into
mainfrom
briefing-page-ui

Conversation

@LiminCode

Copy link
Copy Markdown
Owner

Summary

The briefing page was one 860 px card from top to bottom. It is now a wide two-column page in the project's Metro language: a sticky top bar (title · generated · usage chips · status · Regenerate), the summary as a headline, a left rail with one solid tile per source (click → scroll there) plus filter chips (★★★ / ★★ / ★ / 🐞 bug / updated, multi-select union) and a "hide ticked-off" switch, and on the right one card per section with a solid tile head (title, item count, ★★★ / bug / updated badges, fold button). Every top-level item gets a priority block, a bug row gets a red left bar and tint, "updated" becomes a badge, and a checkbox lets the user tick an item off (kept in this browser's localStorage under the briefing's generated time, so a new briefing starts clean; nothing reaches the fish or the config). Below 980 px it is a single column with the tiles in a scrollable row. Content without <h3> sections (old briefings, empty) falls back to the previous single article. Also fixed: link text with square brackets (calendar events "[Daily] …") did not render as a link. Design memo: .scratch/config-panorama/briefing-page-ui-design.md (local).

What changed and why

  • pet/panorama/reports.py: split_sections(rendered) splits the rendered HTML at <h3> and counts top-level items per section (count / p3 / p2 / p1 / bugs / updated, by the renderer's own markers: class="star sN", li.bug, <strong>), source_of(title) guesses the source from keywords (colour only; the prompt template is user-editable, so no fixed order); the provider adds sections, html stays.
  • pet/panorama/markdown.py: _LINK allows one level of [...] inside the link text.
  • pet/panorama/page/items.js (new): pure functions classify, passes, navTiles, filterChips, card — no DOM, tested under QJSEngine. report.js: draws rail and cards from sections, enhances top-level <li> with data-p / data-bug / data-upd, a checkbox and a .body wrapper, applies filters, keeps fold state in memory and ticks in localStorage (guarded; absent storage just means ticks do not persist). report.html: sticky bar, grid, rail, cards container, article fallback. report.css: source colours (soft blue / purple / rose / teal / amber / green / grey, light and dark), tile heads, badges, priority blocks, bug rows, glass shadows, no radius, ≤ 979 px single column.
  • pet/panorama/render.py: items.js joins REPORT_MODULES (before report.js); REPORT_KEYS gains the rail / filter strings.
  • pet/locale/zh.json, en.json: panorama.ui.report_sections / report_filters / report_filter_* / report_hide_done / report_items / report_untitled / report_fold / report_trace / report_done.
  • Docs: docs/config-panorama.md (report page: sections, filters, ticks, items.js), CHANGELOG.md.
  • Tests: test_panorama_reports.py (+1: splitting and counts incl. nested items not counted, preface section, source guesses; provider sections), test_panorama_markdown.py (+1: bracketed link text), test_panorama_report_page.py (+2: rail / chips / cards HTML and the article fallback; classify / passes pure functions), DOM capture extended.

Performance

Venv Python on this machine, real latest briefing (11,863 chars Markdown → 19,414 chars HTML, 6 sections, 57 top-level items):

Path Result
markdown.render, 200 runs median 0.52 ms, max 0.88 ms
split_sections, 200 runs median 0.18 ms, max 0.50 ms
Payload growth sections JSON 24,392 B next to the unchanged html 22,946 B (the page uses one of the two)
Assets report.js 9,634 B (was 4,927), items.js 3,115 B (new), report.css 10,247 B (was 4,553), report.html 1,312 B; report bundle 18,580 B
  • Steady state: zero. Splitting runs when a page asks for the report (same trigger as rendering); classification runs once per draw in the browser over 57 items.
  • No new requests, threads, disk or network; ticks are browser-local storage only.

Real-machine run

Served the real latest briefing and its run record with a standalone read-only PanoramaServer from this branch and opened /report/work_briefing#<token> in the built-in browser.

  • 1440 × 900: theme light, rail visible with six tiles (Jira 22 · PR 15 · Slack 7 · 日程 4 · 邮件 6 · 建议先做 3), six chips with 全部 on, six cards with badges (Jira: ★★★ 2 · 🐞 8 · 有更新 13; 建议先做: ★★★ 2 · 🐞 2), 57 enhanced items with 57 checkboxes, 4 × ★★★ / 10 bug / 13 updated by data-*, 79 links opening in new tabs, the "[Daily] …" calendar event now a link, five run-record sections, no console errors.
  • Interactions from the DOM: ★★★ chip → 53 of 57 hidden; adding 🐞 → 45 hidden (union); ticking the first item → is-done, localStorage["report-done:work_briefing:<generated>"] = {"s1:0":1}; "hide ticked-off" → that one hidden; fold on PR → data-collapsed=1, ▸.
  • 820 × 900: one column, tiles in a row (flex-direction: row), rail position: static, no horizontal overflow (scrollWidth 805 < 820).
  • Screenshots were inspected only; the content is company material and is not attached. The pet is restarted from main after the merge.

Tests

Red first: the new tests failed on AttributeError: split_sections / source_of, the bracket-link assertion and the empty nav / cards HTML before the product change. Affected families (panorama, work briefing, i18n, architecture, docs discipline): 643 passed, 1 skipped; ruff check pet tests and git diff --check clean. Full suite not run: pure page / provider change, no config, lifecycle, threading or platform dispatch change.

Docs

  • CHANGELOG.md: one line (user-visible change)
  • Topic doc under docs/ updated (config-panorama.md)
  • ADR: not needed (presentation of an existing page; ADR 0018 already covers content pages in the browser)

🤖 Generated with Claude Code

…文字里的方括号能渲染了

- reports.split_sections:渲染好的全文按 <h3> 切区,数顶层条目的总数 / 三档优先级 / bug / 有更新,按标题猜来源(只用来配色);
  provider 多给 sections[],html 照旧
- 页面:items.js(纯函数:classify / passes / navTiles / filterChips / card),report.js 画左栏磁贴 + 筛选片、右栏每区一张卡,
  进页面后给顶层每条打 data-p / bug / upd 并插勾选框(勾掉存 localStorage,键带生成时间);折叠只在内存;没有分区退回整段文章;
  report.html 顶栏 sticky + 两栏;report.css 来源色、磁贴头、徽章、星色块、bug 左红条、窄屏单栏
- markdown._LINK:链接文字里允许一层方括号(日历事件「[Daily] …」)
- render:REPORT_MODULES 加 items.js,REPORT_KEYS 加筛选 / 分区字串;字表 zh / en;docs/config-panorama 报告页一节;CHANGELOG

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.

1 participant