Skip to content

MAINT Extract message view model from MessageList - #3198

Merged
Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
1cbyc:1cbyc/2654-message-view-model
Oct 15, 2026
Merged

Roman Lutz (romanlutz) merged 3 commits into
microsoft:mainfrom
1cbyc:1cbyc/2654-message-view-model

Conversation

@1cbyc

Copy link
Copy Markdown
Contributor

Description

Refs #2654.

MessageList currently owns pure message-shaping rules alongside its React rendering. This extracts the first requested boundary into a typed messageViewModel module:

  • preserve explicit display-piece ordering, identities, score ownership, and test IDs
  • map legacy content and attachments without coupling those rules to the component
  • isolate structured JSON formatting from presentation

MessageList remains responsible for list rendering, loading/empty states, and scrolling. This is intentionally a focused first slice of the issue; it does not change user-visible behavior or attempt the separate media, score, and action component boundaries.

Tests and Documentation

  • npm test -- --runInBand src/components/Chat/messageViewModel.test.ts src/components/Chat/MessageList.test.tsx (67 passed)
  • npm run type-check
  • npx eslint src/components/Chat/MessageList.tsx src/components/Chat/messageViewModel.ts src/components/Chat/messageViewModel.test.ts --max-warnings 0

Added focused tests for structured-content formatting, explicit display-piece identity/order, and legacy content/attachment score separation. No documentation changes are needed because this is an internal refactor with unchanged behavior.

@romanlutz

Copy link
Copy Markdown
Contributor

Thanks for the contribution Isaac Emmanuel (@1cbyc) ! We've had a lot of cases recently where the CLA wasn't accepted and authors never responded after the initial PR push. If I don't hear back by 10/17 I'll close this PR because we need the CLA. See posts by @microsoft-github-policy-service above.

@1cbyc

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@1cbyc

Copy link
Copy Markdown
Contributor Author

Roman Lutz (@romanlutz) kindly check again.

@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 14, 2026
@romanlutz
Roman Lutz (romanlutz) added this pull request to the merge queue Oct 14, 2026
Merged via the queue into microsoft:main with commit 0e1ca43 Oct 15, 2026
51 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