You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0189004
Browse filesBrowse the repository at this point in the historyBrowse files
fix(app-shell): the chart view's view bar starts its icon on the list page's 16px edge (#35826)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgEV9LRY8FfTWS7J6T3MwsSL)_Fixes#35729
repo:objectstack#5 · os-bill · session_01Utp6Cb8qTxAVaE2QKwquQU
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:宽屏下图表视图的视图栏图标和列表视图一样离左边 16,在列表和图表之间切换时视图切换器不再左右跳;手机宽度不变。
- 为什么做:#35663 把列表视图栏对齐到 16 后,图表视图自己那份视图栏还留在 22,是 #35663 的 L1 记录里留下的后续项。
- 出错会怎样:只改图表视图栏的内边距,并删掉一个已经没人读的内部参数,不动数据和权限;有问题可以直接撤回。
- 要你做什么:无
## What changes
- **The chart view's view bar takes the list view bar's padding**
(`objectViewListRenderer.tsx`, `chartPage`): `sm:px-4` becomes
`sm:pl-2.5 sm:pr-2`, the same values as `TOOLBAR_ROW` in `plugin-list`'s
`listToolbarRow.ts` (not imported: `plugin-list`'s index does not export
the constant, and exporting it was outside the claim). From `sm` up the
switcher's 6px-padded icon lands on 16, where the list's does. Below
`sm` both bars keep `px-2`, so 375 is unchanged.
- **The idle `inSetup` input goes end to end** (claim amendment 2,
7036258221). Since #35663 removed the Setup app's row-number line,
`useObjectViewListRenderer` read it only in the `renderListView` memo's
dependency list. Removed: that dependency, the destructured prop and its
type, the type-only `isSetupAppSegment` import (renderer); the
derivation, its stale objectui#12606 comment, its pass and the
`isSetupAppSegment` import (`ObjectView.tsx`). Remaining readers: none
in either file. Other `inSetup` / `isSetupAppSegment` readers in
app-shell (`ResourceListPage`, `RecordDetailView`) are their own and
untouched.
## Tests
- `ui/e2e/list-left-edge-35663.spec.ts` (#35663's geometry spec) gains a
chart view bar: its class is read out of `objectViewListRenderer.tsx` at
run time (the `chartPage` bar), and a second bar with that class,
holding the real switcher class, sits under the list's view bar. At 1280
(wide and narrow cases) its icon is on the 16 edge and on the list
view's icon (±1), and its right padding equals the list bar's; at 375
its icon equals the list's (and ≥12).
- Ablation: with the bar's class put back to `sm:px-4`, the two 1280
cases go red (`chart view-bar icon starts at 22, not 16`); 375 and the
scroll case stay green, as they should.
- No unit test added: no vitest reads the chart bar's class or `inSetup`
(grep over `ui/packages/*/src` for `inSetup`, `isSetupAppSegment` and
`sm:px-4 sm:py-0` beside `ObjectView` / `objectViewListRenderer`: 0
hits), and jsdom has no layout for the padding.
## Acceptance notes
Readings (the e2e harness, main area 1024 wide beside a 256 sidebar at
1280; x from the main area's left):
| | list view icon | chart view icon | list bar right padding | chart
bar right padding |
|---|---|---|---|---|
| main 65fddc8, 1280 | 16 | 22 | 8 | 16 |
| this PR, 1280 (wide and narrow) | 16 | 16 | 8 | 8 |
| main, 375 | 14 | 14 | — | — |
| this PR, 375 | 14 | 14 | — | — |
- The chart bar draws only the switcher, so "right edge 16" reads as the
bar's right padding equal to the list bar's 8 (the list's last trigger
adds its own 8 to reach 16).
- Platform checklist: not edited. `records-forms.list-view-capabilities`
steps[11] (from #35663) states the list page's left edge; a chart-view
sentence there would be outside the claim's surface. carrier: none.
Screenshots (1280 narrow, 1280 wide, 375; the fixture's icons are blank
16px boxes): `objectstack-seat5/area-ux/ux-4/chart/card-35729/` in the
project files.
## Verification
Read first:
`ui/packages/app-shell/src/views/objectViewListRenderer.tsx`, the
`chartPage` bar class; then the `inSetup` removal in the same file and
`ObjectView.tsx`.
Two-minute check: open an object with a chart view at 1280, switch
between a list view and the chart view; the view switcher's icon stays
put.
<details><summary>Local readings</summary>
- Geometry spec: 4 passed at this head; ablated, 2 of 4 red as above.
- `pnpm --filter @object-ui/app-shell type-check`: exit 0 (after `pnpm
--filter '@object-ui/app-shell^...' build`).
- `vitest run packages/app-shell/src/views/ObjectView.`: 93 files, 826
tests passed.
- `node scripts/pm/dispatch-gates.mjs --commands`: 38 commands derived,
all exit 0 (log `gates-ran.log` beside the screenshots)
- `node scripts/pm/overlap-check.mjs --branch=HEAD`: clean (origin/main
merges cleanly; #35747 shares `objectViewListRenderer.tsx`, merges
cleanly).
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CasQ2sQyph6xUMdArZ
<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6Cb8qTxAVaE2QKwquQU -->
Co-authored-by: Claude <noreply@anthropic.com>
fix: a chart view's view bar starts its view icon on the list page's 16px left edge, as the list view's bar does
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
A chart view draws its own copy of the view bar, and that copy kept `sm:px-4` after the list view's bar moved to `sm:pl-2.5 sm:pr-2` in #35663. From `sm` up the chart's view icon sat 22px from the main area's left edge while the list's sat at 16, so switching between a list view and a chart view moved the switcher. The chart bar now carries the list bar's padding: at 1280 its icon starts at 16 and its right padding is the list bar's 8. Below `sm` both bars keep `px-2`, so a phone is unchanged.
11
+
12
+
The list renderer's `inSetup` input is gone. Since #35663 removed the Setup app's row-number line it was read only in a memo's dependency list, so `ObjectView` no longer derives it from the route.
// The chart view's view bar is the list's (objectstack#35729): its icon
493
+
// is on the list's view icon (also in `expectOnEdge`), its right end the list bar's.
494
+
expect(Math.abs(r.left.chartViewIcon-r.left.viewIcon),`chart view icon ${r.left.chartViewIcon} vs list view icon ${r.left.viewIcon}`).toBeLessThanOrEqual(1);
495
+
expect(r.barPaddingRight.chart,'the chart view bar ends where the list view bar does').toBe(r.barPaddingRight.list);
465
496
});
466
497
}
467
498
@@ -494,13 +525,16 @@ test.describe('the list page draws one left edge (objectstack#35663)', () => {
0 commit comments