Skip to content

fix(plugin-detail): collapse duplicate record-header overflow menus into one#1247

Merged
xuyushun441-sys merged 1 commit intomainfrom
copilot/fix-more-buttons-issue
Apr 19, 2026
Merged

fix(plugin-detail): collapse duplicate record-header overflow menus into one#1247
xuyushun441-sys merged 1 commit intomainfrom
copilot/fix-more-buttons-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 19, 2026

Record detail header rendered two buttons whenever an object defined more record_header actions than action:bar's maxVisible (e.g. todo_task with 4 header actions). Caused by two independent overflow owners:

  1. action:bar emits a for business-action overflow past maxVisible (3).
  2. DetailView hardcoded a separate <DropdownMenu> for Duplicate / Export / View History / Delete (plus mobile Share / Edit / Inline Edit fallbacks).

Neither knew about the other.

Changes

  • @object-ui/components · action:bar — adds systemActions?: ActionSchema[]. Entries are always routed into the overflow menu (never inline) and share a single trigger with any business-overflow, separator auto-inserted between groups. Schema-only keys (actions, systemActions, location, maxVisible, …) are now stripped before spreading onto the DOM to silence React "unknown attribute" warnings.
  • @object-ui/components · action:menu — short-circuits to action.onClick when present, bypassing ActionEngine. Intended for chrome-level callbacks that depend on React state / DOM APIs (clipboard, navigator.share, inline-edit toggle) and are not part of the server-driven action protocol.
  • @object-ui/types · ActionSchema — optional onClick?: () => void | Promise<void> UI-local escape hatch (documented as non-serializable).
  • @object-ui/plugin-detail · DetailView — removed the hardcoded <DropdownMenu>; Duplicate / Export / View History / Delete and mobile-only Share / Edit / Inline Edit are built as ActionSchema[] and merged into the record-header action:bar via the new systemActions field. If callers already supply an action:bar for record_header, system actions are injected into it; otherwise a bar carrying only system actions is appended.

Invariant

A record-header action:bar renders at most one overflow menu, regardless of how many business actions the object metadata contributes. System actions never appear inline.

Illustration

// todo_task: 4 record_header actions + 4 DetailView system actions
{
  type: 'action:bar',
  location: 'record_header',
  actions: [complete, start, clone, defer],      // maxVisible=3 → 1 overflow
  systemActions: [duplicate, export, history, delete], // always overflow
}
// Renders: [Complete] [Start] [Clone] [⋯]   ← single menu, 5 items + separator

Tests

Four new action:bar tests assert the merged-overflow contract: single even when business overflow + systemActions coexist, system actions never inline, overflow rendered when only systemActions are present.

…ar menu

Agent-Logs-Url: https://github.com/objectstack-ai/objectui/sessions/ee78e2ea-277a-48bc-bba5-386438d3b455

Co-authored-by: xuyushun441-sys <255036401+xuyushun441-sys@users.noreply.github.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
objectui-demo Ready Ready Preview, Comment Apr 19, 2026 10:33am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectui Ignored Ignored Apr 19, 2026 10:33am

Request Review

@xuyushun441-sys xuyushun441-sys marked this pull request as ready for review April 19, 2026 11:55
@xuyushun441-sys xuyushun441-sys merged commit a649dbe into main Apr 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants