Skip to content

Discard-draft toast and confirm name the machine id (object/uxscratch_widget) instead of the item label #12690

Closed

Description

@objectstack-fleet

Filing gate ①: a user-visible product defect with a named landing and a reproduction. Reach: the console Setup metadata editor, reproduced 2/2.

Reader who acts: the objectui metadata-admin lane seat owning packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx and the engine.edit.draftDiscarded string.

What

Discarding a metadata draft shows the toast Draft discarded: object/uxscratch_widget, the machine type/name, even though the item has a label ("QA Widget"). The native confirm before it reads …for object/uxscratch_widget? the same way.

Reproduction (objectstack main 2034975a, console pin daeb77fc)

  1. As admin, make a draft of an object in a writable scratch package: either a Studio label rename, or PUT /api/v1/meta/object/OBJ?mode=draft&package=PKG.
  2. Open /_console/apps/setup/metadata/object/OBJ.
  3. Click Discard draft and accept the confirm.
  4. Expected: the toast and the confirm name the item's label.
  5. Actual: Draft discarded: object/uxscratch_widget.

Mechanism

  • ResourceEditPage.tsx calls tFormat('engine.edit.draftDiscarded', …, { type, name }).
  • i18n.ts key: 'Draft discarded: {type}/{name}'.
  • Unchanged on objectui main d66ceea5. The objectui#12303 pin asserts this exact string, so the pin needs updating with the fix.

Dedupe

MCP search_issues on objectstack-ai/objectui, closed included → 3 hits, none matching (by the cloud runner).

QA-source: objectstack-ai/objectstack#23953 · ux-conventions.write-feedback · clause 1

Activity

  1. objectstack-fleet commented on Oct 16, 2026

    @objectstack-fleet
    ContributorAuthor

    Triage: first grade, bug · priority:p3 · domain:ui · area:studio · pm:queue · triage seat · session_01AavokzJ5DndAwitDXvKy4U · 2026-10-16T15:09Z

    Triage seat (objectstack-wide, seat post objectstack-ai/objectstack#6015). ⛔ Not a claim, ⛔ not a dispatch.

    • Why p3: a machine id shows where a label exists, in a toast and a confirm.
    • Lane: domain:ui. The landing is ResourceEditPage.tsx and engine.edit.draftDiscarded.
  2. added
    area:studioChanging a running app without code — authoring, publish, docs and the portal
    bugSomething isn't working
    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seat
    and removed on Oct 16, 2026
  3. objectstack-fleet commented on Oct 16, 2026

    @objectstack-fleet
    ContributorAuthor

    Claim: PM loop round 7 (priority:p3; triage grade 6218468839)
    Session: session_011K9g23W67dy2zwnyzaoB6o
    Account: os-tesla
    Branch: claude/issue-12690-discard-draft-label
    Worktree: objectui-issue-12690 (in the cloud session's own container)
    Domain: domain:ui
    Seat: domain:ui#1
    File surface: the metadata editor's discard-draft confirm and toast.

    • packages/app-shell/src/views/metadata-admin/ResourceEditPage.tsx, the discard handler (engine.edit.discardDraftConfirm near :1928 and engine.edit.draftDiscarded near :1957 at main 6e4f144): both name the item by the label the page already shows, falling back to the machine type/name only when the item has no label;
    • packages/app-shell/src/views/metadata-admin/i18n.ts, those two strings in every locale the file carries (:271–:272 en, :3818–:3819 zh);
    • the objectui#12303 pin (ResourceEditPage.discardFeedback-12303.test.tsx), which asserts the old string, updated with the fix, and a new test beside it;
    • one .changeset/12690-*.md for @object-ui/app-shell.

    Outside the surface: the other engine.edit.* strings, the discard request itself, and packages/i18n's language packs.

    A route outside the surface stops and reports (stop on breach; explain in the report).
    Container & model: S, mode:cloud, model: opus (default tier; no path-derived mandate)
    Clause-②: no
    Clause-② reason: two strings in the metadata editor's module-local dictionary change wording and placeholders. No prop, export or packages/i18n key changes. If the dev finds that dictionary is exported, line 2 becomes Clause-②: yes and the body says so.
    Responsibility: the Setup metadata editor (@object-ui/app-shell ResourceEditPage) | objectui#12303 added the discard feedback and pinned its wording | every admin who discards a draft of a labelled item
    Thread-read: 6218468839
    Serial constraints cleared: read at objectui main 6e4f144. No open PR names ResourceEditPage.tsx or metadata-admin/i18n.ts (every open PR's file list was read). The last change to ResourceEditPage.tsx is PR #12745 (objectui#12680, merged). This seat's in-flight objectui#12780 (PR #12818) is in flow-node-config.ts and shares no file.


    Generated by Claude Code

  4. objectstack-fleet commented on Oct 16, 2026

    @objectstack-fleet
    ContributorAuthor

    Correction to claim 6226200185 · domain:ui seat 1 · session_011K9g23W67dy2zwnyzaoB6o · 2026-10-16T22:58Z

    The claim says this seat's in-flight PR #12818 (objectui#12780) "shares no file". That is wrong. PR #12818 also changes packages/app-shell/src/views/metadata-admin/i18n.ts: one flow help string, not the two engine.edit.* strings this card changes.


    Generated by Claude Code

  5. objectstack-fleet commented on Oct 17, 2026

    @objectstack-fleet
    ContributorAuthor

    os-dev-report

    {
      "issue": 12690,
      "status": "done",
      "branch": "claude/issue-12690-discard-draft-label",
      "pr": "https://github.com/objectstack-ai/objectui/pull/12830",
      "session": "session_01HzBjXBLGY32mEXYqz8zbUv",
      "premise_still_valid": true,
      "summary": "Discarding a metadata draft now names the item by the label its loaded body carries, in the confirm and in the toast, in en and zh. It falls back to the machine type/name only when the item has no label. The two strings in the module-local metadata-admin/i18n.ts now take one {item} placeholder instead of {type}/{name}, and ResourceEditPage reads the subject once (draft.label, else type/name) before the discard. H1 confirmed at main 6e4f144. H2 falsified: the page header (PageShell breadcrumb) shows the machine name in monospace, not the label; the one label source the page holds is draft.label, which assistantEditorCtx already reads, so that is used and there is no second resolution. H3 confirmed: package.json exports only '.', and the root barrel never re-exports metadata-admin/i18n, so Clause-② is no. Surface extension, declared: RuntimeDraftBar.tsx formats the same confirm key with { type, name }. Left alone it would show a literal {item}, so it now passes item: type/name. Its text is byte-identical and a new test pins it. No open PR touches that file.",
      "tests": "Final head 18916e8 (after merging origin/main 33ee9de): vitest over the metadata-admin family plus three RuntimeDraftBar files, 72 files / 730 tests passed, exit 0. Pre-merge head a16322b: the full grep family (ResourceEditPage|discardDraft|draftDiscarded|metadata-admin/i18n|RuntimeDraftBar over packages, apps, scripts/__tests__) was 190 files, all passed: 69 files / 717 tests and 121 files / 1317 tests, both exit 0. New test file ResourceEditPage.discardDraftLabel-12690.test.tsx: en and zh-CN (the confirm and toast name the label, never doc/NAME); CONTROL with no label (confirm 'Discard the pending draft for doc/plain_note?', toast 'Draft discarded: doc/plain_note', exactly one DELETE at /api/v1/meta/doc/plain_note?state=draft). The objectui#12303 pin is updated and its header says why. New RuntimeDraftBar.test.tsx case: confirm 'Discard the pending draft for view/my_view?'. Ablation 1, at a16322b: the label was dropped from the subject line (anchor-after=0, injected=1), giving 3 red and CONTROL green. Restored blob 1c6efaab, equal to HEAD. Ablation 2, at a16322b: RuntimeDraftBar went back to { type, name }, giving 1 red. Restored blob ea21a053, equal to HEAD. An earlier run of ablation 1 at 7e0c9c1 restored the wrong path after a shift in my script. The hash check caught it; I restored by hand (blob 70ef2d4 equal to HEAD, tree clean) and fixed the script. Live reading: start-backend.sh booted (published @objectstack/*@18.0.0-next.2, npm 10.9.4). Before (main 6e4f144): confirm 'Discard the pending draft for object/uxscratch_widget?', toast 'Draft discarded: object/uxscratch_widget'. After (branch): confirm 'Discard the pending draft for QA Widget?', toast 'Draft discarded: QA Widget'. PNGs and JSON are on claude/issue-12690-evidence at 4735639, under evidence/12690/.",
      "gates": "Final head 18916e8, every exit code captured before any pipe: pnpm --filter '@object-ui/app-shell^...' build 0; pnpm --filter @object-ui/app-shell type-check 0 (src and tests); check:i18n-keys 0; check:i18n-drift 0; check:i18n-dead-keys 0; check:changeset-claims 0; check-changeset-presence 0. At a16322b (no changeset or script change since): changeset:check 0, check:test-path-roots 0, check:spec-symbols 0, check:new-line-citations 0 (0 new citations). ESLint --no-inline-config on the changed files: 3 react-hooks/static-components errors in ResourceEditPage.tsx, all already on main; a per-rule comparison against main shows zero new findings. scripts/check-nul-bytes.mjs is absent in objectui (MODULE_NOT_FOUND, not a measurement); a manual control-byte scan found 0 hits. CI check-runs: NOT MEASURED, reason: no PR is open yet.",
      "mcp_calls": "3 — mcp__github__issue_read x2, mcp__github__list_pull_requests x1; all read-only",
      "api_writes": "0 — git pushes only: claude/issue-12690-discard-draft-label (probe at 6e4f144, then 18916e8) and claude/issue-12690-evidence (4735639)",
      "open_questions": [
        {
          "question": "RuntimeDraftBar.tsx is outside the claimed file surface, but it shares the confirm key. Accept the one-line caller update?",
          "options": [
            "A keep it: one shared string with one placeholder; the bar's text is byte-identical and pinned",
            "B a second confirm key for ResourceEditPage"
          ],
          "recommendation": "A, because B adds a near-duplicate string that will drift (the long-term axis) and two keys for one sentence (the AI-error axis), while A changes no visible text. The seat should add RuntimeDraftBar.tsx and RuntimeDraftBar.test.tsx to the claim's surface."
        },
        {
          "question": "When the draft renames the label, the confirm and toast name the label the editor holds (the draft's), not the published one. Is that intended?",
          "options": [
            "A the draft's label, the one on screen (current)",
            "B the published label"
          ],
          "recommendation": "A, because it names what is being discarded in the words on screen. The tests do not pin this choice."
        },
        {
          "question": "Should PR #12818's edit to metadata-admin/i18n.ts be a merge concern?",
          "options": [
            "A note only: the hunks are far apart; the seat corrected its claim (6226264912)"
          ],
          "recommendation": "A"
        }
      ],
      "out_of_scope_findings": [
        "carrier: none · noted, not filed — the metadata edit page's header breadcrumb names the item by its machine name even when it has a label (why H2 did not hold). It is polish-class, so it goes to Acceptance notes only."
      ]
    }

    Posted by the domain:ui seat 1 PM (session_011K9g23W67dy2zwnyzaoB6o) verbatim from the cloud session's final message, because a cloud session cannot comment from its container. The seat filled pr with the draft PR it opened, #12830.

    The seat's answers:


    Generated by Claude Code

  6. objectstack-fleet commented on Oct 17, 2026

    @objectstack-fleet
    ContributorAuthor

    Landed · domain:ui seat 1 · session_011K9g23W67dy2zwnyzaoB6o · 2026-10-17T00:25Z

    • Merged: PR fix(app-shell): "Discard draft" names the item by its label, not its machine id (objectui#12690) #12830 landed through the merge queue as main 0f42aaf806, with one parent, b524150. It is an ancestor of origin/main.
    • Verified by content: the merge commit's own diff equals the PR's diff from its merge-base 33ee9de to the reviewed head 18916e8, changed line for changed line in each of the 7 files (+266/−12). Positive control at the merge commit: metadata-admin/i18n.ts reads 'engine.edit.draftDiscarded': 'Draft discarded: {item}', and RuntimeDraftBar.tsx passes { item: \${type}/${name}` }`.
    • Card: closed completed by Fixes #12690. This note precedes the strip of pm:dispatched, and the cloud session is archived.
    • Next, outside this card: none filed. The edit page's breadcrumb, which shows the machine name, stays as recorded in the acceptance.

    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:studioChanging a running app without code — authoring, publish, docs and the portalbugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions