Commit Graph
2 Commits
Author SHA1 Message Date
yetone fe4295e1db gui: sidebar-tab-top also holds the page's own strip and page switching still, in every language (#1844)
lainbo's test checked the sidebar rows in English and Chinese. The rule the
change sits beside ("where the reader is", 73af4c28) is that a tab clicked
in the page's own strip leaves the page where it is, and switching pages
keeps each where it was left. The test now checks both, so a later change
that lets the new scroll reach them goes red:

- the sidebar part runs in en, zh, zh-TW, ja and de, and after the tab
  switches goes to Settings and back to the Library: each is where it was
  left;
- a new test per engine, with the sidebar turned off (1100px, navLayout
  top) and in a window narrower than SIDE_AT (900px), scrolls Library ›
  MCP servers to its foot and clicks Skills in the page's strip: the page
  is not taken to its top. Every language.

Run: sidebar-tab-top 34/34 (Chromium, WebKit) with the change. The strip
test passes 22/22 on main's app.js too (unchanged behaviour). Broken by
hand: the strip's segs click scrolling its view to 0 fails the strip test
10/10; Settings' place reset to 0 on a page switch fails "Settings is where
it was left"; the row scrolling with the tab already open fails "the tab
already open leaves the page where it is"; scrollOnPurpose() without the
click's event fails "Allowances opens at its top" (refused, 177/228).
2026-10-13 01:51:04 +08:00
lainbo 7d05a00f5f gui: a tab picked in the sidebar opens at its top, not where the tab before was left (#1844)
Usage, Library, Plugins and Settings list their tabs under the page in the
sidebar (navSubs), and a page's tabs share its one scroll. A row only
clicked the page's own tab, so scrolled to the foot of Settings › General
and Allowances picked, Allowances showed at its foot; Library › MCP
servers and Skills the same. A row that picks another tab now clicks it
and scrolls the page to its top through scrollOnPurpose with the row's own
click. The tab already open, picked again, leaves the page where it is.
The page's own strip (the header's tabs) and switching between pages are
unchanged.

sidebar-tab-top.test.cjs (Chromium, WebKit, en, zh) fails without the
change, 6 of 6: "Allowances opens at its top", 177 (en) and 228 (zh)
instead of 0; with the Settings part left out, "Skills opens at its top",
about 2100 instead of 0. It passes 6 of 6 with it. go test -tags nogui
./internal/gui in a temp HOME passes.
2026-10-13 01:44:40 +08:00