Skip to content

设计模式里「上移 / 下移」保存后应用里的菜单顺序不变:只调了数组先后,没改菜单项自带的排序号,而侧栏按排序号排 #36591

Closed

Description

@objectstack-fleet

coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

立卡门类别:④ 协调节点的子单,承父单 #36359(运行界面的设计模式专题)。⛔ 不是认领。优先级 p1(协调席定的,维护者未指定:已上线功能在 AI 搭建的应用上保存后没有效果,而且不报错)。维护者 2026-11-23:「立卡通知 2号」,本卡通知席位 repo:objectstack#2。

维护者说过的(2026-11-23)

  • 「更新最新代码,验收新完成的开发」
  • 协调席汇报验收发现的两个缺陷后:「立卡」「立卡通知 2号」

现状(主干 84853fd18e,本机环境浏览器实测,1440 宽,系统管理员,自建应用「CRM客户管理」)

  • 这个应用的菜单是四项:客户、联系人、销售商机、跟进记录。它是 AI 搭建的,每个菜单项带一个排序号:[{objectName: nb57_customer, order: 0}, {nb57_contact, order: 1}, {nb57_opportunity, order: 2}, {nb57_follow_up, order: 3}]。
  • 进入设计模式,对「联系人」点「…→ 上移」:设计模式里的顺序变成 联系人、客户、…。点「保存」。
  • 保存发了两个请求,都成功:PUT /api/v1/meta/app/customer_crm?mode=draft&package=app.nb57,然后 POST /api/v1/meta/app/customer_crm/publish?package=app.nb57。
  • 退出设计模式后,侧栏仍是 客户、联系人、…;整页刷新后也一样。没有任何报错。
  • 读回保存的应用定义:[{nb57_contact, order: 1}, {nb57_customer, order: 0}, …]。数组里联系人排到了前面,但排序号没动。
  • 所以:设计模式按数组位置显示,应用里的侧栏按排序号显示,两边对不上。再进设计模式看到的是 联系人、客户(和侧栏相反)。
  • HotCRM 的菜单项不带排序号(读 src/sales/apps/crm.app.ts,0 处),推测不受影响;协调席没有在 HotCRM 上保存过。
  • 协调席已把测试应用的菜单改回原样并核对。

要做的

  1. 保存菜单时,让应用里的侧栏和设计模式显示同一个顺序。两种做法选一种并在 PR 里说明:
    • 保存时按新的先后重写每一项的排序号;或者
    • 保存时去掉排序号,统一按数组位置排。
  2. 设计模式里显示的顺序和侧栏用同一套排序规则,进模式之前和之后看到的顺序一致。
  3. 「移到分组」「在前面加一项」「在后面加一项」「添加菜单项」同样检查:新加或移动的项在带排序号的应用里落在正确的位置。
  4. 分组(带子项的菜单组)自身和组内各项的排序号同样处理。

不做的

  • 不改菜单项操作菜单里的项目。

验收

  • 自建应用「CRM客户管理」(菜单项带排序号):把「联系人」上移并保存,退出后侧栏是 联系人、客户、…;刷新后还在;再进设计模式顺序相同。
  • 同一应用:「在后面加一项」加一个对象、把一项「移到分组」并保存,侧栏里位置和设计模式里相同。
  • HotCRM(菜单项不带排序号):上移一项并保存,侧栏顺序变了。
  • 一个菜单里既有带排序号的项、又有不带的项的应用:保存一次后顺序和设计模式一致。
  • PR 正文写明选了哪种做法,以及为什么原来的测试没拦住(设计模式(二)菜单编辑:添加已有的菜单项,上移下移、移到分组、移除、改名和图标 #36363 的验收第二条就是「上移并保存:顺序变了;刷新后还在」)。

协调席自己加的

  • 「要做的」第 1 条的两种做法、第 3、4 条。
  • 验收里「混合」那一条。
  • 侧栏按排序号排是协调席从现象推断的(数据里只有排序号和数组位置两个线索),没有读到排序的那段代码。

Activity

  1. added
    bug
    priority:p1
    domain:ui
    on Nov 23, 2026
  2. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    coordinator#1 · hotlong · session_85eb0287cb754f0f9c2bed54cab9abff

    通知记录 · 2026-11-23T01:15Z

    维护者 2026-11-23:「立卡通知 2号」。本卡按此通知席位 repo:objectstack#2,随后在它的信箱 #34479 里发一条。

  3. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in domain:ui (design-mode menu Move up/down) · pm:queue; rationale: area:ux · Bug · Move up/down saves, but the sidebar keeps the old order because the items keep their order numbers, so the admin's reorder appears not to take. A defect of #36363 the coordinator filed on the maintainer's 「立卡通知 2号」 → p1 as set · size S. Topic #36359.

  4. added
    pm:queue
    on Nov 23, 2026
  5. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm

    Claim: PM loop · area s2-B · 2026-11-23T02:52Z · routed to s2-B by the seat 2026-11-23T01:17Z ahead of the area queue (p1; maintainer 「立卡通知 2号」 on the card); first free slot goes to this card (seat 2026-11-23T02:39Z)
    Session: session_01ADHkmRB34k9WUWeGpRnVNm
    Account: os-steve
    Branch: claude/issue-36591-design-menu-order
    Worktree: objectstack-issue-36591
    Domain: domain:ui
    Seat: repo:objectstack#2
    Area: s2-B
    File surface: the design-mode menu under ui/packages/app-shell/src/layout/ (designModeMenuModel.ts — the helper renamed by PR #36604 —, designModeMenuSave.ts, DesignModeMenu.tsx), card-named tests beside them, a changeset. Read-only: ui/packages/layout/src/navOrder.ts (the sidebar's rule) and AppNavCanvas.tsx inMenuOrder (app-shell's stated copy of that rule, already imported by the save). ⛔ No new published export from @object-ui/layout (stop on breach; explain in the report)
    Container & model: S, mode:subagent, model: default tier (dispatch-gates --tier: no path-derived mandate), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: #36363's merge (PR #36437) in objectstack ui/** — design mode reorders the array, the sidebar sorts by order (byNavOrder: order ascending, absent as 0, ties in array order) | none — the save writes no order | every admin who reorders a menu whose entries carry order (AI-built apps do)
    Thread-read: 7089038648
    Premise: holds — read at origin/main: ui/packages/layout/src/navOrder.ts byNavOrder sorts a level by order (the coordinator's inference on the card is confirmed by the code); the design-mode menu displays array position. The live repro is the coordinator's measurement.
    Pre-claim lane: repo:objectstack whole-repo lane, area s2-B (seat 2 area order 2026-11-22); paths ui/** (domain:ui).
    Pre-claim deps: #36589 (PR #36604, the helper rename) is in the merge queue; this branch starts after it or merges its branch. No Blocked-by: line.
    Prior rulings read: the card's own thread: none; the order rule is objectui#11395's byNavOrder (stated in navOrder.ts) and #26979's inMenuOrder.
    Fold-or-serial: serial after #36589 (same directory).
    Serial constraints cleared: open-PR file read at 2026-11-23T02:52Z: #36604 (this area, landing) and #36606 (s2-C card thread for #36364, design-mode menu create/save) touch DesignModeMenu.tsx / designModeMenuSave.ts; the seat sequences this card first and #36364 rebases on it (seat 2026-11-23T01:17Z).
    Route (the card leaves the choice to the PR): rewrite order on save, not drop it. Design mode shows each level in the sidebar's order (inMenuOrder), and on save each level whose entries carry order is renumbered in its new position. A level where no entry carries order is left without it, so apps like HotCRM gain no new keys. Dropping order would delete authored keys from AI-built apps.

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm
    os-dev-report

    {
      "issue": 36591,
      "status": "done",
      "branch": "claude/issue-36591-design-menu-order",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36622",
      "session": "session_01ADHkmRB34k9WUWeGpRnVNm",
      "premise_still_valid": true,
      "summary": "Route taken: rewrite `order` on save, never drop it. Design mode now seeds its menu with every level in the sidebar's order (`inShownOrder`, sorting each level through app-shell's `inMenuOrder`, no new comparator). The save sorts the stored menu the same way before `rebaseMenuEdits` replays the edits, then `withOrderRewritten` numbers every entry 0..n-1 in each level where any entry carries `order` (groups and group children per level); a level with no `order` keeps array order and gains no key. `rebaseMenuEdits` never sees `order` as an edit (the editor never writes it), so nothing is dropped or treated as a conflict. Why #36363's tests missed it: every fixture had no `order` (array order = sidebar order) and the save pins read array positions, never the sidebar. Tests were added as top-level describes in the three existing #36363 harness files (AGENTS.md shared-harness rule), not as new files. Started from origin/main + merge of the #36589 branch; #36604 has since landed and origin/main is merged in (conflict on two import lines, branch side kept). Browser check NOT MEASURED: no built runtime/Console in the worktree, and a full build plus a seeded backend on the shared 4-core box was not attempted.",
      "tests": "head f4425f440e: `pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/layout/` -> Test Files 155 passed (155), Tests 1247 passed (1247), lock VERDICT command-exit 0. The three touched files -> 3 passed, 75 passed. `pnpm --filter @object-ui/app-shell type-check` (tsconfig + tsconfig.test) -> VERDICT command-exit 0 after rebuilding the closure the main merge moved (the first run read pre-merge dist: RecordDetailView TS2322 from main's change, gone after rebuild). Ablation (ablation-replace.mjs, anchor `const nextNav = withOrderRewritten(navPayloadOf(rebased as unknown[]) as Menu);` replaced by the un-rewritten payload): mutation landed anchor 1->0, blob b319aa8229c4->fd40d9929ee0; Tests 6 failed | 69 passed (75): 3 save pins + Move up / Add after + Move to group / mixed level render pins red, both no-order CONTROL pins and the display pin green; restored blob == HEAD b319aa8229c4, git diff HEAD empty. The full app-shell package suite is left to CI (Test UI); narrowed locally to the layout directory.",
      "gates": "dispatch-gates --commands --repo objectstack-ai/objectstack at f4425f440e derived 38 commands; all 38 run with `< /dev/null`, exit captured before any pipe, every one exit 0; `--ran` -> 38 derived, 38 run, 0 NOT-MEASURED, 0 UNRUN. Record: /mnt/project-files/objectstack-seat2/36591-gates-ran.txt. Deviation: the `pnpm --dir ui exec vitest run scripts/` family ran under os-verify-lock with `--maxWorkers=2` added (dispatch order); its line records the derived spelling. overlap-check.mjs exit 1: #36606 shares DesignModeMenu.tsx, designModeMenuSave.ts, conflicts in DesignModeMenu-36363.test.tsx (expected; seat sequences this card first). PR check-runs at f4425f440e when the report was written: Check Changeset, Check PR Size, Governed Surface Queue Guard, Lint (ESLint, PM dispatch-gates, docs & code guards, repo & tooling gates, CI release & engine gates, three scoped lanes), PR-body guards, Type Check (consumer, debt ledger, source, workspace) all in_progress; opt-in lanes and queue verdicts skipped. UI lanes not yet listed.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 — relay pr_create: POST /repos/objectstack-ai/objectstack/pulls (draft) + POST /repos/objectstack-ai/objectstack/issues/36622/assignees (os-steve); post-stamped: POST /repos/objectstack-ai/objectstack/issues/36591/comments (this report). git push is not counted.",
      "open_questions": [
        { "question": "Numbering rule for a level that carries `order`: always 0..n-1, or keep authored values where they already sort right?", "options": ["A 0..n-1 on every entry of the level (shipped): one rule, idempotent, no ties, covers the mixed level; an authored 10,20,30 becomes 0,1,2 even on a rename-only save", "B keep the authored values when they already increase in shown order and renumber only otherwise: fewer changed keys, but two code paths and a mixed level still needs every entry written"], "recommendation": "A, because the ruling asks for every entry of the level to be rewritten and A is the smallest rule byNavOrder reads exactly" }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — another package's entries (navigationContributions) are not in the stored menu and are not renumbered; one carrying its own `order` can land elsewhere relative to the renumbered entries than design mode showed. No live producer found; in PR Acceptance notes.",
        "carrier: none · noted, not filed — Studio's nav canvas (AppNavCanvas moveItem) writes `order` on the moved entry only while design mode now renumbers the level: two save rules for one key, both drawing the order their editor showed. Observation; in PR Acceptance notes."
      ]
    }
  8. objectstack-fleet commented on Nov 23, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRB34k9WUWeGpRnVNm

    Waiting on #36619 (the flaky DataPillar.panelHold-27629 test), since 2026-11-23T05:17Z · 2026-11-23T05:17Z. Source: the maintainer chose on a decision card, relayed by seat repo:objectstack#2, that the fleet seat fixes #36619 and this area does not. PR #36622 keeps its current head and its ACCEPT; it is not re-run or re-queued meanwhile. When #36619 closes, the area merges main into the PR, reads the delta if the head moves, and queues it again.

  9. removed
    pm:dispatched
    on Nov 23, 2026
  10. added 2 commits that reference this issue on Nov 23, 2026
    93d8921
    dad9b55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxbugdomain:uipriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions