Repository navigation
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
Conversation
…文字里的方括号能渲染了 - 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>
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
localStorageunder 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 addssections,htmlstays.pet/panorama/markdown.py:_LINKallows one level of[...]inside the link text.pet/panorama/page/items.js(new): pure functionsclassify,passes,navTiles,filterChips,card— no DOM, tested under QJSEngine.report.js: draws rail and cards fromsections, enhances top-level<li>withdata-p / data-bug / data-upd, a checkbox and a.bodywrapper, applies filters, keeps fold state in memory and ticks inlocalStorage(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.jsjoinsREPORT_MODULES(beforereport.js);REPORT_KEYSgains 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/config-panorama.md(report page: sections, filters, ticks,items.js),CHANGELOG.md.test_panorama_reports.py(+1: splitting and counts incl. nested items not counted, preface section, source guesses; providersections),test_panorama_markdown.py(+1: bracketed link text),test_panorama_report_page.py(+2: rail / chips / cards HTML and the article fallback;classify/passespure 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):
markdown.render, 200 runssplit_sections, 200 runssectionsJSON 24,392 B next to the unchangedhtml22,946 B (the page uses one of the two)Real-machine run
Served the real latest briefing and its run record with a standalone read-only
PanoramaServerfrom this branch and opened/report/work_briefing#<token>in the built-in browser.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 bydata-*, 79 links opening in new tabs, the "[Daily] …" calendar event now a link, five run-record sections, no console errors.is-done,localStorage["report-done:work_briefing:<generated>"] = {"s1:0":1}; "hide ticked-off" → that one hidden; fold on PR →data-collapsed=1, ▸.flex-direction: row), railposition: static, no horizontal overflow (scrollWidth 805 < 820).mainafter the merge.Tests
Red first: the new tests failed on
AttributeError: split_sections / source_of, the bracket-link assertion and the emptynav/cardsHTML before the product change. Affected families (panorama, work briefing, i18n, architecture, docs discipline): 643 passed, 1 skipped;ruff check pet testsandgit diff --checkclean. Full suite not run: pure page / provider change, no config, lifecycle, threading or platform dispatch change.Docs
config-panorama.md)🤖 Generated with Claude Code