Skip to content

fix(app-shell): AI inquiry page review follow-ups — a failed ?c= check, one history read, a no-package notice, previews for listed rows only - #38201

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-o6rug1
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-o6rug1

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #37908
Fixes #37959

Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:应用里的 AI 提问页,网络抖动时不再把用户打开的对话悄悄丢掉回到首页,而是提示「无法打开这个对话」并可重试;打开一个对话只下载一次历史;没有所属软件包的应用会直接说明为什么不能在这里提问;首页「最近对话」最多只为列出的 5 条补读摘要,不再最多补读 20 条。
  • 为什么做:上一轮 AI 提问页评审留下的两张跟进卡(会话校验与请求数)。
  • 出错会怎样:只影响提问页自己的显示与请求次数,不改数据、不改权限;可直接撤回。
  • 要你做什么:无。

What changes

All in @object-ui/app-shell (the AI inquiry page, AppAskPage.tsx, and the two hooks it mounts) plus five new console.ai.askPage keys in @object-ui/i18n.

  • review follow-ups of PR #37889 (AI inquiry page, AppAskPage.tsx) #37908 item 1, a failed ?c= check is not "foreign". The check now has a fourth verdict, failed, for an answer that is neither the conversation nor a definite 403/404 (a 5xx, a network error). It keeps ?c= in the address and draws "Couldn't open this conversation" with Try again (re-runs the check) and New conversation. Only a definite answer (403/404, or another app's conversation) still opens the home state and drops ?c=.
  • review follow-ups of PR #37889 (AI inquiry page, AppAskPage.tsx) #37908 item 2, as corrected on the card (Premise corrected 7234948699): the history is read once. There is no metadata-only read to call (see Acceptance notes). When the checked conversation is this app's, the check's own read now hydrates the thread: useChatConversation takes activeRecord, the host's read of activeId, which the first resolve of that id uses instead of fetching it again; any later resolve of that id reads afresh, and a record of another id is ignored.
  • review follow-ups of PR #37889 (AI inquiry page, AppAskPage.tsx) #37908 item 3, an app with no _packageId. The page draws "This app can't keep conversations here" with one sentence of why, instead of a question box that cannot start a conversation.
  • review follow-ups of PR #37889 (AI inquiry page, AppAskPage.tsx) #37908 item 4, duplicate suggestions. EmptyConversation keys suggestions by position and text, so an entry that declares the same question twice draws both, with no React key warning.
  • review follow-ups of PR #37940 (AI inquiry page recent conversations) #37959, previews only for listed rows. useConversationList takes selectBackfillRows: the rows the caller shows, the only ones whose missing title or preview is read from the detail route (still at most MAX_PREVIEW_BACKFILL, 20). The page's recent conversations pass recentAskPageConversations, so the home state reads at most the five rows it lists. The selector is read when the list answers, never as an effect dependency (ui AGENTS.md chore: version packages #10); the page passes refreshKey: packageId so a package change re-reads.

Tests

New top-level describes in the existing harness files (see Acceptance notes for why not a new file):

  • AppAskPage-37788.test.tsx › "AppAskPage review follow-ups (objectstack#37908)": a 503 check keeps ?c= and Try again opens the conversation; a dropped network read is failed, not foreign; opening this app's ?c= issues exactly one GET of that conversation; an app with no package draws the notice, no question box and makes no request; a twice-declared suggestion draws twice with no key warning.
  • same file › "AppAskPage recent conversations read previews for listed rows only (objectstack#37959)": 16 untitled rows (7 of this app, 6 of another, 3 drawer threads); the detail GETs are exactly the five listed ids.
  • useConversationList.test.tsx › "useConversationList selectBackfillRows (objectstack#37959)": details are read only for the selected rows, and only those get previews.
Readings at 3b44663
  • pnpm --dir ui exec vitest run packages/i18n/src/__tests__/zh-hant-generated.test.ts packages/app-shell/src/console/ai/__tests__/AppAskPage-37788.test.tsx packages/app-shell/src/hooks/__tests__/useConversationList.test.tsx: Test Files 3 passed (3), Tests 33 passed (33).
  • Reverse verification at da0ee60 (tests committed; the four source files restored from the merge base, tests kept): Tests 7 failed | 16 passed (23), the 7 being exactly the new tests; source restored from HEAD, git status clean.
  • pnpm --dir ui exec vitest run packages/app-shell/src/console/ai/ packages/app-shell/src/hooks/ packages/i18n/ at the head before the zh-Hant regeneration: 3070 passed, 1 failed (zh-hant-generated: the zh-Hant catalogue must be the generator's output); fixed by pnpm --filter @object-ui/i18n gen:zh-hant, and that test passes in the run above.
  • pnpm exec turbo run type-check --filter=@object-ui/app-shell --filter=@object-ui/i18n: 74 successful, 74 total.
  • dispatch-gates --commands derived list: 41 derived, all exit 0; dispatch-gates --ran reconciliation: 41 run, 0 NOT-MEASURED (a derived zero, every line with its exit code).

Acceptance notes

  • Item 2's other half waits for the server. GET /api/v1/ai/conversations/:id answers AiConversationSchema, whose messages is required, and the spec declares no metadata-only query or route; the route is served by service-ai, outside this repository. So a ?c= naming another app's conversation of the same caller is still read once (history included) and dropped. Not filed, per the seat's correction on the card.
  • Tests live in the shared harness file. The card asks for a new test file named for it; AGENTS.md puts a new pin for a component that already has a shared harness file into that file as a top-level describe (ruling record 6583487846), and AGENTS.md wins.
  • A fixture made stale by item 3 (35c1e39). AppContent.aiChatEntryGate-37833.test.tsx lands a member on the ai:chat page of an app fixture with no _packageId; its two CONTROL cases asserted the home state and now see the no-package notice (Test UI 5/16 red on 3b44663). They ask whether the member landed on the page, so they now assert the page root (app-ask-page); the route assertion beside each is unchanged. Giving the fixture a package stamp instead moves the app's route segment and reds eight cases, so that was not taken. That file: 13 passed (13) at 35c1e39.
  • A conversation of this app whose hydration read later fails is handled by useChatConversation as before; this PR changes only the page's own check.
  • Not measured: an app row that reaches the console carrying the sys_metadata rehydration sentinel as _packageId would bind the page to that value as if it were a package. Read from package-scoped-resolution.ts only; no console reading was taken.

Verification

Two minutes: pnpm --dir ui exec vitest run packages/app-shell/src/console/ai/__tests__/AppAskPage-37788.test.tsx, expect every test to pass, including the five under "review follow-ups (objectstack#37908)".

Read first: AppAskPage.tsx (the check effect's failed verdict and the activeRecord hand-off), then useChatConversation.ts (the activeId branch that spends activeRecord once), then useConversationList.ts (selectBackfillRows).

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm lint passes. (CI's Lint UI is the reading)
  • 4. One issue, one branch off an up-to-date main, one pull request. (a fold of two cards, per the claim)
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUPnmZSYRP4AXm2rzr


Generated by Claude Code

@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 28, 2026
…me state

The #37833 landing fixture's app carries no package stamp, and the inquiry
page now draws its no-package notice there instead of the home state. The
two CONTROL cases ask whether the member landed on the page, so they assert
the page root.

Claude-Session: https://claude.ai/code/session_01L6bhgUPnmZSYRP4AXm2rzr
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 35c1e39 · cards #37908 #37959 · area s2-ai · 2026-11-28T07:13Z

L1 checklist (no review face on this file list: this record is the review of record)

  • Shape and checks. Every check on the head is green apart from expected skips; mergeable clean. The PR touches AppAskPage.tsx, EmptyConversation.tsx, useChatConversation.ts, useConversationList.ts, three tests, one string row group in all 11 locale packs, and a changeset. Not governed.
  • ?c= check (review follow-ups of PR #37889 (AI inquiry page, AppAskPage.tsx) #37908). fetchConversation returns null only on 403 or 404 and throws on any other failure, so the page now reads null or another app's conversation as foreign and a throw as the new failed state. failed keeps ?c= and offers Try again (back to checking) and New conversation. Only a definite answer drops ?c=.
  • One history read (Premise corrected on review follow-ups of PR #37889 (AI inquiry page, AppAskPage.tsx) #37908). An ours verdict carries the check's record; useChatConversation takes it as activeRecord and spends it on the first resolve of that id only (a ref marks it spent; a record of another id is ignored), so opening ?c= reads the history once. Another app's conversation is still read once and dropped; the PR's Acceptance notes say so.
  • No package. An app without _packageId now shows a notice instead of a question box that could not start a conversation. Two CONTROL cases in AppContent.aiChatEntryGate-37833.test.tsx, whose fixture app has no _packageId, now assert the page itself; their route assertions are unchanged. Giving the fixture a package would move the app's route segment, so the thread did not, and said so in the PR body. Accepted.
  • Previews (review follow-ups of PR #37940 (AI inquiry page recent conversations) #37959). useConversationList takes selectBackfillRows; the page passes the rows it lists (at most five), so the home state reads at most five details, not up to twenty. Suggestions are keyed by position, so a repeated question draws twice without a key warning.
  • Tests. Seven new tests sit in the existing shared test files (the AGENTS.md shared-harness rule, a deviation from the card's "new file" sentence that the PR notes). Reverting the source turns all seven red.
  • Declarations. Clause-②: no, Metadata-protocol: none, @object-ui/app-shell and @object-ui/i18n patch, Fixes #37908 and Fixes #37959 are right.

Tier: S. Landing: ready and auto-merge in this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 07:15
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit d528ebc Nov 28, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-o6rug1 branch November 28, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review follow-ups of PR #37940 (AI inquiry page recent conversations) review follow-ups of PR #37889 (AI inquiry page, AppAskPage.tsx)

2 participants