Skip to content

入口专题 C5:记录焦点状态机重写,标签进输入框行首,去掉钉住与「改为问」,从会话 metadata 读回 #37861

Done

Description

@objectstack-fleet

epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf

Filing gate: ④ topic child. Source: topic #37853 (Jack: 「"页面里加按钮"的需求 作废」 06:28Z; card 「撤掉 ask_ai」 06:30Z; 「问 AI」 06:33Z; 「同意,立专题卡,非 cloud 的任务,让 objectstack #3 座位接手」 07:12Z, all 2026-11-27). Business reason: carried by the parent.
Parent: #37853 (rulings, target experience, card table, topic acceptance). Evidence: an independent Fable review of objectstack and cloud main (2026-11-27) checked every file:line below.
Owner: repo:objectstack#3 (Jack 07:12Z 「非 cloud 的任务,让 objectstack #3 座位接手」). Reserved under topic #37853 (pm:epic), not pm:queue: other seats leave it.

Grading: area:ux · Task · p1 · size M–L · target: before 19.0 GA (the pin control and 「改为问」 have only shipped in prereleases).
Blocked-by: C0a (#37854); C1 (#37856) (removes setChatFocus and the ask_ai focus handler); #37799 and #37803 (splits of ChatbotEnhanced / AiChatPage, >3000 lines each, wait for the maintainer's merge). Ships in the same release as C4 (#37860).
Dedupe: searched chatFocus, record chip: #36999 and #37276 (closed) built today's version.

维护者速读

Background (verified)

  • Today: unpinned shows a page chip (also on lists and dashboards) with a pin button when the page has one record; pinned shows 「正在问:X」 with remove; switching records asks 「改为问《X》?」. State is only focus, declined, kept in sessionStorage only, so a new tab or reopening from history loses it (console/ai/ChatFocusRow.tsx:91-168; layout/chatFocus.ts:10-16,37-41,234-253).
  • The composer area of ChatbotEnhanced has only promptHeaderSlot (AiChatPage.tsx:2023); the chip needs an in-composer slot.

What to do

  1. State { focus, dismissed }; drop declined, follow and the host registry.
    • Unsent conversation: effective focus = current page record (surfaceRecord()) unless dismissed.
    • First send fixes focus and carries dismissed.
    • After that, focus persists across navigation (ADR-0160 D6).
  2. Display:
    • With focus: a chip inside the composer at the line start: object icon + record name + ×. × visible on focus-within and always on touch, hit area ≥24px; unknown name → object · id; RTL (ar) puts it on the right automatically.
    • Without focus: today's page chip 「正在看:X」 (no ×), lists and dashboards included.
    • Agents without capabilities.focus: UI and request exactly as today.
  3. Remove the pin button, the 「改为问《X》?」 prompt, keys console.ai.focus.pin/switchPrompt/switchAccept/switchDecline (update the de-quote-pairing-3876 test), and the pin-only exports left after C1 (入口专题 C1:撤掉 ask_ai 动作类型(enumWithRetiredValues、ADR-0087 三项、只为它存在的导出),19.0 正式版前 #37856) (gen:api-surface).
  4. Read back: when a conversation loads, restore focus from its metadata (written by cloud C6 (objectstack-ai/cloud#5113)). The request body stays authoritative.
  5. Rewrite chatFocus-36999.test.tsx.

Acceptance

  • Unsent new conversation follows record changes; after the first send it does not.
  • × → page chip, never re-added in that conversation, kept after the first send.
  • Reopening from history in a new tab restores the chip; follow-ups send context.focus.
  • Lists / dashboards keep the page chip; agents without capabilities.focus unchanged.
  • × keyboard-reachable, visible on touch, ≥24px; chip at line start in Arabic.

Activity

  1. added
    enhancement
    priority:p1
    pm:blocked
    pm:epic
    domain:ui
    on Nov 27, 2026
  2. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim: PM loop round 1
    Session: session_01L9qibyUSf2nKJWW6qBemSU
    Thread session: session_01L9qibwivzADop4jGmFZ81y
    Account: os-tesla
    Branch: claude/project-thread-qgv6xl
    Worktree: objectstack-issue-37861
    Domain: ui
    Area: o3-askai (topic #37853, C5)
    Seat: repo:objectstack#3
    File surface:

    • ui/packages/app-shell/src/layout/{chatFocus.ts,ChatDockConversation.tsx} and layout/__tests__/**
    • ui/packages/app-shell/src/console/ai/{ChatFocusRow.tsx,ChatPane.tsx,AiChatPage.tsx}
    • ui/packages/app-shell/src/hooks/{useChatConversation.ts,surfaceAgent.ts}
    • ui/packages/app-shell/src/index.ts and its api-surface baseline
    • ui/packages/plugin-chatbot/src/{ChatbotEnhanced.tsx,chat/types.ts} (a new in-composer slot)
    • ui/packages/i18n/src/locales/** (11 packs drop 4 keys) and de-quote-pairing-3876.test.ts
    • packages/spec/src/contracts/ai-service.ts: the docblock only, rewording "pinned" at :1266-1271, which ADR-0160 D6 assigns to this card
    • .changeset/**

    Stop on breach; explain in the report.
    Container & model: L, mode:thread, model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate", effort: high
    Clause-②: no (the ai-service.ts change is a docblock only)
    Metadata-protocol: none
    Responsibility: as the card says. The record focus state machine is rewritten, the chip moves into the start of the input row, pinning and 「改为问」 are removed, and focus is read back from the conversation metadata (cloud C6, cloud#5113). It follows ADR-0057 A5 as merged (bc17334) and ADR-0160 D6.
    Thread-read: none
    Premise: holds on origin/main 4de4e3e, with locations corrected. The slot is passed at ChatPane.tsx:773 (promptHeaderSlot) and drawn above PromptInput (ChatbotEnhanced :954). The only in-frame row is the text-only page chip (~:997), so a new in-composer slot is needed. ChatFocusRow :91-168 and chatFocus {focus, declined}/sessionStorage hold. ServerConversation.metadata is typed (useChatConversation.ts:482) but not returned to callers. Jack's ruling 7221127130 (「这些现在都启动开发」) starts it now.
    Serial constraints cleared: C1 PR #37924 rewrites chatFocus.ts, its test, ChatDockConversation.tsx, index.ts and surfaceAgent.ts; C4 PR #37970 touches ChatPane.tsx, ChatDockConversation.tsx and the 11 locale packs; Q2b #37874 adds ChatPane.tsx (one prop). The thread merges main after each one lands and runs overlap-check against #37924 and #37970 before its first push. Open question to epic:#5027#1: the shape stored under metadata.focus (an array or one {object,id}); until it is answered, the reader accepts and pins both shapes.

  3. added
    pm:dispatched
    and removed
    pm:blocked
    on Nov 27, 2026
  4. objectstack-fleet commented on Nov 27, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

    Claim amendment 1 to 7221210743.
    Clause-②: yes (widening). The diff adds two optional public surfaces on published ui packages: @object-ui/plugin-chatbot ChatbotEnhanced promptInputHeaderSlot?: ReactNode, and @object-ui/app-shell UseChatConversationReturn.conversationMetadata. The precedent is .changeset/34171-managed-password-refusal-copy.md. The thread also removes four @object-ui/i18n keys (console.ai.focus.pin, switchPrompt, switchAccept, switchDecline) that shipped only in 19 prereleases. The contract review rules on whether that removal is a narrowing; if it is, the PR follows the narrowing path (BREAKING section and hand-off).
    Premise adds: epic:#5027#1 answered (mailbox 7221293049, cloud main d8912a0). metadata.focus is always an array [{ object, id, label? }] with one entry, and the key is absent after the user's ×. The reader takes raw[0] under string object/id guards. The single-object branch is dropped.
    Everything else in the claim is unchanged (Metadata-protocol none, patch).

  5. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibwivzADop4jGmFZ81y
    os-dev-report

    {
     "issue": 37861,
     "status": "done",
     "branch": "claude/project-thread-qgv6xl",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/38230",
     "session": "session_01L9qibwivzADop4jGmFZ81y",
     "premise_still_valid": true,
     "summary": "Conversation focus is { focus, dismissed } (ui/packages/app-shell/src/layout/chatFocus.ts rewritten): before the first send it is the page's surfaceRecord() unless dismissed and follows the page with no prompt; the first send fixes it onto the id it mints in the same render; x removes it for good; a conversation opened again restores it from this tab's sessionStorage, else its row's metadata.focus (cloud#5113 array shape, raw[0]). The chip sits inside the composer frame at line start via the new ChatbotEnhanced promptInputHeaderSlot (icon, name or object · id, x with 24px hit area, shown on hover/focus-within/coarse pointer, logical margins for RTL); useChatConversation returns conversationMetadata. The pin, the switch offer, declined and the four keys console.ai.focus.pin/switchPrompt/switchAccept/switchDecline are removed from all 11 packs; spec docblock and capabilities.focus description reworded. Head c7e32f01 = main 9609c137 (C1 #37924 and C4 #37970 in) merged at f6b2ea4e, conflicts in chatFocus.ts, its test and ChatDockConversation.tsx taken from this branch, protocol.mdx regenerated; file surface unchanged from the claim.",
     "tests": "chatFocus-36999.test.tsx rewritten (21 cases), ChatbotEnhanced.promptInputHeaderSlot-37861.test.tsx new (3), de-quote-pairing-3876 count 129 to 128. Merged head, under the verify lock: vitest over app-shell layout, console/ai and hooks plus plugin-chatbot and i18n: Test Files 1 failed | 501 passed (502), Tests 2 failed | 5392 passed | 13 skipped; the 2 were designModeMenuSave-36363 (no shared file), which alone then passed Tests 47 passed (47). Before the merge (bd1e582d): layout + console/ai Test Files 206 passed (206), Tests 1741 passed (1741), including ChatDock.requestContext-30043 7/7 (a state-held first-send mark had dropped its record-page send; reverted to a ref). Ablations on disk, restored from the commit: metadata restore + unsent rule removed -> 10 red; carry + origin removed -> 5 red; markSending a no-op -> 5 red. type-check in @object-ui/app-shell, @object-ui/plugin-chatbot, @object-ui/i18n: exit 0 each.",
     "gates": "dispatch-gates --commands on c7e32f01: 116 families, each recorded with its exit; --ran: 116 accounted, 113 run, 3 NOT-MEASURED (exit 3, built-output prerequisite: check-plugin-teardown-shape --self-test, spec check:skill-examples, check:dual-build-cjs-loads); one run red outside the diff: pnpm --dir ui exec vitest run scripts/ SIGKILLed while its closure-budget case read a partial local build (no ui-components chunk). overlap-check: VERDICT clean exit 0 (main, #38201, #38168). PR check-runs at c7e32f01: 70 completed, 61 success, 9 skipped, 0 failure (incl. Test UI 16/16 shards, Test Core 10/10, Type Check UI, Type Check workspace, Lint UI, Lint & Repo Gates, Build & E2E UI, Live E2E UI, Check Changeset, PR-body guards, Spec property liveness).",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "reads only — mcp__github__pull_request_read (get #37924, get #37970, get_check_runs #38230) and mcp__github__issue_read (card #37861); no write tool",
     "api_writes": "2 relay — fleet-write pr_create #38230 (assignee os-tesla), post-stamped comment on #37861 (this report); plus git push",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": ["designModeMenuSave-36363 failed 2 cases once under a shared box (47/47 alone) · noted, not filed"]
    }

    Generated by Claude Code

  6. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
    2026-11-28T13:16Z · 收口:PR #38230 经合并队列合入,本卡随 Fixes 关闭;去掉 pm:dispatched。

  7. removed
    pm:dispatched
    on Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxdomain:uienhancementpm:epicpriority:p1size/l

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions