Repository navigation
feat(briefing): read the daily briefing in the browser (/report/work_briefing); Qt window keeps only the notes/Slack tabs (ADR 0018) - #85
Merged
Conversation
…「简报」页(ADR 0018) - pet/panorama/reports.py:报告页的数据(work_briefing provider:最近一份 → 标题 / 概要 / 用量 / 全文 HTML / 忙 / 错 / 按钮 / 有没有这项功能)、generate_work_briefing;markdown.py:零依赖的 Markdown → HTML(★ / bug 记号变类名、链接只认 http(s)) - service:reports 登记表、每份报告一个 Feed、report / publish_report(没人看过不白做)/ report_watched / open_report(起服务 不采集);_page_target 拆出 _server_url - routes:GET /report/<名字>(公开外壳)、GET /api/report/<名字>(要令牌,认 ?after=);actions.generate_report - 页面:report.html / report.css / report.js;client.js 抽出取令牌与带令牌的 fetch,boot.js 改用它 - WorkBriefingController:open_report / report_watched 两条路——「查看」开浏览器、打开即读过、页面开着不冒提醒; WorkBriefingWindow(briefing_page=False) 只给笔记 / Slack 当壳 - app:_panorama() 懒建服务并登记 reports 与 generate_report;简报 started / finished → publish_report - 菜单:「生成时间」子菜单拿掉,加「简报设置…」翻到配置全景(facade.open_work_briefing_settings) - ADR 0018;路线图新增 M4b;docs/config-panorama「报告页」一节;docs/work-assistant「窗口」改写;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 daily work briefing is now read in the browser instead of a Qt window. The island's document button, the morning alert's "View" and the right-click "View the latest" all open
/report/work_briefingon the config-panorama local service: summary, usage chips (model / effort / time / tokens / cost), the full text (★ priority colours, 🐞 rows tinted, status chips, links in new tabs) and a "Regenerate" button. While a briefing is generating the page redraws itself (busy → new content) over the same long-poll the panorama uses. The QtWorkBriefingWindowstays only as a shell for the notes / Slack tabs (it no longer carries a briefing tab); the personal assistant keeps its own window until its turn. The right-click menu loses the "Generation time" sub-menu (the value is edited on the panorama) and gains "Briefing settings…". ADR 0018 records the direction and the order of the remaining moves; roadmap section M4b added.What changed and why
pet/panorama/markdown.py(new): zero-dependency Markdown → HTML for the subset briefings use (headings, nested-/1.lists, paragraphs, bold, inline code →<code class="chip">,[text](http(s)://…)and bare URLs →target=_blank rel=noopenerlinks; other schemes stay text). Leading ★ on a list item →<span class="star s1|s2|s3">, items starting withwork_briefing.BUG_MARK→<li class="bug">(their indented scene lines are the nested list inside). This replaces the Qt window's_decoratefragment walk; everything else is escaped.pet/panorama/reports.py(new): report providers.work_briefing(service_of, config)turnsWorkBriefingService.latest() / busy / last_error()into the page's fixed-field dict (title, theme, summary, generated, usage[], html, busy, busy_text, empty_text, error, action, available);generate_work_briefing→started / busy / failed / unavailable;theme()followscontext_menu_appearance.theme(no toggle on the page: one place to edit a preference).pet/panorama/service.py:reports=ctor kwarg, oneFeedper report;has_report,report(name, after, wait)(first ask builds the payload on the GUI thread viaon_gui),publish_report(name, force=False)(does nothing until someone has looked, so the started/finished signals never run the provider for nobody),report_watched(a page is long-polling = the user is reading),open_report(name)(starts the server without a panorama collection round, opens/report/<name>#token)._page_targetsplit into_server_url(path)+ the focus suffix;stop()closes report feeds.pet/panorama/routes.py:GET /report/{name}(public shell, 404 for unregistered names) andGET /api/report/{name}(token,?after=long-poll like/api/graph); module docstring lists them.pet/panorama/actions.py:generate_report(generators)(400bad_reportfor unknown names).pet/panorama/render.py:REPORT_SHELL / REPORT_STYLES / REPORT_MODULES / REPORT_KEYS,report_shell(),report_payload();ASSETSserves the new files;client.jsjoinsMODULES(beforeboot.js),report.jsdeliberately does not (it is an entry that runs itself and must not be bundled into the offline snapshot).pet/panorama/page/client.js(new):takeToken(storageKey)+makeApi(token)extracted fromboot.jsso both pages share the token handling and theapi / api.patch / api.posthelpers;boot.jsnow imports them (no behaviour change, its tests still pass).report.html / report.css / report.js(new): the report page; CSS uses the shared--m-*tokens plus the same extra colours as the Qt shell's_EXTRA_TOKENS, no border radius.pet/work_briefing_ui.py:WorkBriefingWindow(briefing_page=False)builds the shell without the briefing tab;WorkBriefingController(open_report=, report_watched=)— "view" opens the browser (and counts as read), a failed open shows a bubble, a page being watched suppresses the new-briefing alert,open_window(tab=…)still opens the Qt shell for notes / Slack. Without the two callbacks the old Qt path is unchanged (tests, other callers).pet/app.py:_panorama()builds the service lazily and registersreports={"work_briefing": …}plus thegenerate_reportaction;_open_report / _report_watched / _publish_report; the briefing service'sstarted/finishedpublish the report.pet/context_menus/shared.py,pet/sprite_menu_facade.py: "Generation time" sub-menu removed (set_work_briefing_timegone), "Briefing settings…" →open_config_panorama(focus="work_briefing").pet/locale/zh.json,en.json:menu.shared.briefing_settings,briefing.bubble.page_failed,panorama.ui.report_*;menu.shared.generation_timedropped.docs/adr/0018-content-pages-move-to-the-browser.md(new, registered in the ADR index),docs/roadmap.md(M4b),docs/config-panorama.md(module table, "报告页" section),docs/work-assistant.md(module table, "窗口" section rewritten),CHANGELOG.md.tests/test_panorama_markdown.py(9),tests/test_panorama_reports.py(8),tests/test_panorama_report_page.py(17: service, real local server routes incl. long-poll and action, render, report.js under QJSEngine),tests/test_work_briefing_page.py(7: controller browser path, Qt shell without the tab, menu, facade); updatedtest_work_briefing(menu),test_panorama_entry(registrations),test_panorama_page/test_panorama_settings_panel(bundleclient.jswithboot.js),test_panorama_service(fake serverpage_url(path)).Performance
Measured with
PYTHONPATH=. python perf_c.pyon this machine (Windows 11, venv Python, real latest briefing: 8592 chars / 64 lines):markdown.renderof the real briefing, 200 runsreport_payload(full page data), 100 runsclient.jsis now included)publish_reportwithoutforceis a no-op otherwise).127.0.0.1.Feedper registered report holding the latest payload (~17 KB).Real-machine run
serve_c.pybuilt the real provider over the real data directory and served it with a realPanoramaServer; openedhttp://127.0.0.1:9546/report/work_briefing#<token>in the built-in browser. Checked from the page: hash cleared,data-theme=light(follows the user's appearance preference), title "工作简报 · 大肥鱼", sixh3sections (Jira / PR / Slack / 日程 / 邮件 / 建议先做), 37 star spans (5 × ★★★), 1 status chip, 54target=_blanklinks, usage chipsclaude-opus-5-5 · high · 118 秒 · 407k · 12k · 1.25, "重新生成" enabled, no console errors. Content is company material and is not attached.配置全景服务已启动:http://127.0.0.1:8271(空闲 900 秒后自停)with no panorama collection lines (no "Windows 一侧已发布" / WSL probe:open_reportstarts the server without a collection round), and the user confirmed the briefing page opened in the browser ("开出来了"). No ERROR / Traceback afterwards.Tests
Red first: the new test files failed before the product change (
ImportError: pet.panorama.markdown / reports, missing routes,WorkBriefingControllerrejectingopen_report=). Then the affected families (panorama, work briefing, briefing window, notes / Slack UI, personal UI, context menus, i18n, architecture, PR discipline, retired features, settings table, desktop pet features, agent link, island): 1372 passed, after which the four remaining failures were fixed (two tests still bundlingboot.jsalone, the menu test expecting "Generation time", two known baselinescompact_semantic_groups/three_column_masonry).ruff checkandgit diff --checkclean. Full suite not run: no config schema or migration change, no packaging / platform dispatch change; the lifecycle change is one lazily built service plus two signal connections, covered bytest_work_briefing_page.pyandtest_panorama_report_page.py.Docs
config-panorama.md,work-assistant.md, roadmap M4b)🤖 Generated with Claude Code