Repository navigation
feat(panorama): resizable side panel, compact item lists with per-item fold and filter, relative ages on timestamps - #92
Merged
Merged
Conversation
- shell.html / app.css:两列之间加把手 #gutter,右栏宽度走 --aside-w(300–720,默认 380);窄屏单栏时把手藏起 - interact.js:拖把手改宽度、松手存 localStorage、双击复原,地图跟着 fit();列表每条一个 .item(行 + 折着的 dl.more), ▸ / ▾ 逐条展开,展开状态按「磁贴 + 条目」记在模块里(重画不丢);工具条:条数、筛选框(> 5 条)、全部展开 / 收起(存 localStorage); 筛选只改 hidden、不重画;事实和 more 里长得像时间的值后面补「· N 分钟 / 小时 / 天前」 - util.js:ago / rowMatches / clampAside 三个纯函数;render.PAGE_KEYS + 字表;docs/config-panorama;CHANGELOG Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
Four things the user asked for after reading a 32-connector list in the panorama's side panel: the panel can now be resized (a drag handle between the map and the panel, double-click resets), every tile's item list is compact by default with a per-item ▸ to expand its details plus "expand all / collapse all", lists longer than five items get a filter box, and timestamps such as "上次探测" are followed by a relative age ("· 3 小时前"). Everything is generic over "a tile with items" (ADR 0014: the page still knows no feature); the connector tiles are just the longest lists. The width and the expand-all preference live in the browser's
localStorageonly. Design memo:.scratch/config-panorama/detail-pane-design.md(local).What changed and why
pet/panorama/page/shell.html,app.css:#gutterbetween.stageand<aside>; the grid's third column isvar(--aside-w, 380px); the handle lights up on hover/drag and is hidden in the single-column layout (≤ 1280 px). List rows are.item→.row+dl.more[hidden];.ltools(count, filter, expand button),.foldchevron,.ago.pet/panorama/page/interact.js:detail()renders the compact list (fold button per item withmore,aria-expanded,hiddenon the details), the tools row, andwhen()which appends the relative age to fact and detail values. Expanded keys (tile id + item name), per-tile filter text and the expand-all flag live in module scope so a redraw keeps them; filtering only toggleshidden(no redraw, focus stays). The handle: pointer drag sets--aside-w(clamped), release persists it, double-click resets to 380,fit()rescales the map.pet/panorama/page/util.js: pureago(value, strings, now),rowMatches(row, query),clampAside(px).pet/panorama/render.py: nine new page strings inPAGE_KEYS;pet/locale/zh.json,en.json.docs/config-panorama.md("连接器详情" gains "详情栏的列表怎么摆"),CHANGELOG.md.tests/test_panorama_page.py(+4: compact list / fold / count / filter box only when long / placeholder for items without details; relative age on a fact; the three helpers; shell and CSS carry the handle), and the storage-tile test now expects the details folded.Performance
innerHTMLas before plus one regex per fact/detail value (ago); 19 items with details: unmeasurable against the existing draw. Filtering touches only the.itemelements'hidden.setProperty+fit()per pointermove (the samefit()the window resize already runs). No timers, no requests; twolocalStoragekeys.Real-machine run
Standalone
PanoramaServicefrom this branch over the real config (real probes), page opened in the built-in browser at 1500 × 900:1052.8px 8px 380px, handle present with its tooltip.conn_w_rest, 19 items): 19.item, 19 details hidden, 19 fold buttons, "19 条", filter box present, button "全部展开"; "上次探测" showed "2026-11-20 00:16:47 · 刚刚" (the round had just run). Clicking the first ▸ → "▾" and its details visible, their timestamp values also carry the age. Typing "atlassian" in the filter → 1 visible item (Atlassian), 18 hidden.localStorage["panorama-aside"] = "606", map rescaled; double-click → 380 and stored.mainafter the merge.Tests
Red first: the four new tests failed on main (no
.item/data-toggle/.lcount, noagoexport, no handle in the shell); the storage-tile test flipped its expectation.tests/test_panorama*.py,test_i18n.py,test_architecture.py: all passed (see the family run);ruff check pet testsandgit diff --checkclean. Full suite not run: page-only change, no config, lifecycle or threading change.Docs
config-panorama.md)🤖 Generated with Claude Code