Skip to content

记录页顶栏操作宽度折叠:切换到操作更少的记录后,可见操作上限停留在旧的较低值 #35997

Closed

Description

@objectstack-fleet

repo:objectstack#5 · os-bill · session_01Utp6Cb8qTxAVaE2QKwquQU

立卡门类别:② 施工中发现的范围外事项(PR #35983 的 L1-a 评审 nit,评论 7057677292)。⛔ 不是认领;车道与定级由分诊定。

现状(PR #35983 头 1066603 读源码)

  • ui/packages/components/src/renderers/layout/containers.tsx 约 2031–2056:PageHeaderActions 开了 fitWidth 时,按钮行一换行就把 widthCap 降到 inline - 1。
  • widthCap 只在宿主宽度变化时(ResizeObserver,约 2046–2053)清回 null。
  • 在记录页或抽屉里用上一条 / 下一条切换记录时,组件实例不变,宽度也不变。所以从一条操作多的记录切到操作少的记录后,上限仍停在旧的低值,可见操作比放得下的少,其余被折进 ⋯。

要做的

  • 记录切换(记录 id 或操作列表变化)时也把 widthCap 清回 null,让下一次布局重新量。
  • 加一例单测:先渲染会换行的多操作记录,再切到少操作记录,断言可见操作数回到 min(maxVisible, 操作数)。

验收

  • 切换记录后,宽度够时可见操作回到上限(3);宽度不够时仍然折叠;新单测通过。

Reader: area:ux(domain:ui,记录页顶栏)。卡线程估算 10–30 行。

Dedupe: record header actions width fold(objectstack,open)→ 无相关。

Activity

  1. added
    enhancement
    pm:queue
    domain:ui
    on Nov 21, 2026
  2. objectstack-fleet commented on Nov 21, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui · pm:queue; rationale: area:ux · Bug · with fitWidth, the record header's visible-action cap stays at an old lower value after switching (previous/next) to a record with fewer actions, so fewer actions show than fit; L1 nit on PR #35983 → p2 (UX has no p3; the filed p3 is raised) · size XS.

  3. added
    bug
    priority:p2
    and removed on Nov 21, 2026
  4. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL

    Claim: PM loop round 1
    Session: session_01FEkQ5oLLK7uoxp33riiBJL
    Account: os-project-manager
    Branch: claude/issue-35997-header-actions-width-cap
    Worktree: objectstack-issue-35997
    Domain: domain:ui
    Seat: repo:objectstack#4
    Area: a4-G
    File surface: ui/packages/components/src/renderers/layout/containers.tsx (PageHeaderActions width fold) + a new card-named test in ui/packages/components + one changeset (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: opus (dispatch-gates --tier at a5a5312f: no path-derived mandate; default judgement tier), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: PageHeaderActions in @object-ui/components (objectstack) lowers widthCap on a wrap and clears it only on a host resize | no platform path re-measures on a record switch | every reader who steps prev/next in the record page or drawer between records with different action counts
    Thread-read: 7058188106
    Premise: holds
    Serial constraints cleared: none — no open PR touches this file surface (open-PR file scan at origin/main a5a5312, 02:58Z). Seat 1 still edits RecordDetailView.tsx (#36147, not pushed yet; and #36076 through PR #36208) and RelatedList.tsx (#35901, #36005); this card stays out of both, and the dev runs overlap-check.mjs before each push.

    Pre-claim lane: ui/packages/components/** (domain:ui), not governed.
    Pre-claim deps: the card names no Blocked-by: and no "after #N"; its parent #35853 is closed.
    Prior rulings read: check-prior-rulings.mjs --card 35997 --terms fitWidth,widthCap,header,actions,maxVisible at a5a5312: 20 hits, 0 ruling comments on the card; the ADR hits (ADR-0007/0022/0023/0024/0031/0063/0068/0096) are general header and action-bar decisions, none on the width fold. Governing text: #35853 (visible-action cap 3). No conflict.
    Fold-or-serial: no fold. The other first-wave cards of area a4-G (#35997 #35995 #36078 #35483 #36036) fix different defects in disjoint files; #35995 and #36036 both use the shared requiredWhen prompt but one wires it into the drawer's per-field save and the other recomputes the stage menu's list after a 409, so gate ① (same defect shape, same fix) fails. They run in parallel on separate branches.

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 22, 2026
  6. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL
    os-dev-report

    {
      "issue": 35997,
      "status": "done",
      "branch": "claude/issue-35997-header-actions-width-cap",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36260",
      "session": "session_01FEkQ5oLLK7uoxp33riiBJL",
      "premise_still_valid": true,
      "summary": "PageHeaderActions (record header bar, fitWidth) now stores its width cap with the key it was measured on: the record id from useRecordContext plus the names of the page's own inline-eligible actions (a JSON string, so an equal set never re-arms the fold and nothing loops). A render with another record or another action set draws the full budget (min(maxVisible, count)) and the unchanged layout effect re-measures, so a row that still wraps folds again; the ResizeObserver path is unchanged and the cap/fold rule of #35853 is untouched. Zone 2 measured: (1) the record view is not remounted between records (its feed-key comment: no mount site passes key=, drawers swap recordIdOverride) so the cap did stick, reproduced by the new pin under ablation; (2) key = record id + action names as a string, stable across renders; (3) the CONTROL pin shows the fold still lowers after the reset. Assignee untouched (none set by me).",
      "tests": "At head 621ca521, under os-verify-lock: `pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/src/__tests__/page-header-record-bar-35593.test.tsx` -> Test Files 1 passed (1), Tests 17 passed (17) (15 existing + 2 new). `pnpm --dir ui exec vitest run --maxWorkers=2 packages/components/` -> Test Files 503 passed | 1 skipped (504), Tests 4847 passed | 24 skipped (4871), VERDICT command-exit 0. `pnpm --filter @object-ui/components run type-check` (tsc --noEmit && tsc -p tsconfig.test.json; --listFilesOnly shows the edited test file in the test project) -> VERDICT command-exit 0. Closure built first: turbo build --filter='@object-ui/components^...' --concurrency=2, 48/48 successful. Ablation via scripts/ablation-replace.mjs: anchor 'widthCap?.key === fitKey ? widthCap.cap : null' -> 'widthCap ? widthCap.cap : null' (anchor 1->0, blob 4de451fd->cd81ae01): 1 failed | 16 passed, failing 'a record with fewer actions that fit draws min(maxVisible, count) again' with `expected [ 'Convert', 'Edit', 'More actions' ] to include 'Log call'`; CONTROL green under the mutation; restore: blob == HEAD 4de451fd, git diff HEAD empty. The test imports the renderer from src (relative '../renderers'), so no dist sits between mutation and run.",
      "gates": "Local subset at 621ca521: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 38 commands; all 38 ran, each exit captured before any pipe = 0 (37 unlocked gates + `pnpm --dir ui exec vitest run scripts/` under the lock: Test Files 172 passed | 2 skipped, Tests 5122 passed | 2 skipped). `--ran` reconciliation: '38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN' with every line carrying its exit code (a DERIVED zero). Outside the derivation: `pnpm check:changeset-fixed` exit 0 (roster under .changeset), `pnpm --dir ui run check:new-line-citations` VERDICT 0 new citation(s) exit 0, `node scripts/pm/overlap-check.mjs --branch=...` VERDICT clean exit 0 before the code push. CI (PR #36260 check-runs at 621ca521 when reported): Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint · CI/release/engine, Lint · ESLint, Lint · PM dispatch-gates, Lint · docs & code guards, Lint · repo & tooling gates, Lint · scoped (3), PR-body guards, Type Check · consumer gates/source gates/workspace, filter: in_progress; Type Check · debt ledger: queued; Queue verdict, Borrowed queue verdict, Schedule gate: skipped. UI jobs (Type Check UI, Test UI, Lint UI, Build & E2E UI) not yet listed: in_progress/NOT MEASURED, CI's.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "line_budget": "card estimate 10–30 lines; code change containers.tsx +17/-9",
      "net_added_lines": "100 (+109/-9 over 3 files: changeset +12, test +80, containers.tsx +17/-9)",
      "files_changed": [
        ".changeset/35997-header-actions-width-cap.md",
        "ui/packages/components/src/__tests__/page-header-record-bar-35593.test.tsx",
        "ui/packages/components/src/renderers/layout/containers.tsx"
      ],
      "deviations": [
        "Test placement: Zone 3 suggested a new card-named test file; AGENTS.md (ruling record 6583487846: a new pin for a component that already has a shared harness file goes into that file as a top-level describe) outranks it, so the two pins are a new top-level describe in page-header-record-bar-35593.test.tsx, which already pins the #35853 width fold. Within the claim's file surface ('a new card-named test in ui/packages/components') in spirit; named here as the conflict.",
        "Commit trailers: commits carry the model-free pair `Claude-Session: ...` + `Co-authored-by: Claude` (noreply address) per AGENTS.md and the order; the harness reminder asked for a trailer naming a model, not followed (AGENTS.md outranks it).",
        "PR assignee: os-dev.md rule 2 says pr_create carries the claim's Account; the order says no `assignees` key, so none was sent (relay read-back: assignees none).",
        "PR body footer: no session-URL footer sent (relay read-back: stored identical to sent, so no footer present); durable attribution is the attribution block on lines 1–2 and this comment. The harness's 'Generated with' line was not added.",
        "Scratchpad: install log first written at the scratchpad root, then moved into issue-35997/."
      ],
      "mcp_calls": "0 — no MCP GitHub calls",
      "api_writes": "2 — (1) relay pr_create via POST /repos/objectstack-ai/objectstack/dispatches (run 44982851223, POST /repos/objectstack-ai/objectstack/pulls -> #36260); (2) this os-dev-report comment via scripts/pm/post-stamped.mjs (POST /repos/objectstack-ai/objectstack/issues/35997/comments). git pushes (3: empty branch, fix, changeset) are not REST writes.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  7. objectstack-fleet commented on Nov 22, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#4 · os-project-manager · session_01FEkQ5oLLK7uoxp33riiBJL

    Delivered: PR #36260 merged as a60740a1b1 (Fixes #35997). The record header's width fold now keys its cap on the record id and the drawn action set, so stepping to a record with fewer actions draws the full budget again (min(maxVisible, count)) and a row that still wraps folds as before; the #35853 cap rule is unchanged. L1-d ACCEPT 7074159975; no follow-up owed. Closing stroke: pm:dispatched removed.

  8. removed
    pm:dispatched
    on Nov 22, 2026
  9. added a commit that references this issue on Nov 22, 2026
    a60740a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:uxbugdomain:uienhancementpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions