Skip to content

fix(wework): top-align short conversations - #2173

Merged
qdaxb merged 1 commit into
mainfrom
fix/wework-short-conversation-whitespace
Jul 24, 2026
Merged

qdaxb merged 1 commit into
mainfrom
fix/wework-short-conversation-whitespace

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • keep short Wework conversations in normal document flow while retaining virtualization for conversations with at least 20 visible messages
  • add a real Tauri desktop regression to the existing e2e:desktop fresh-chat flow
  • capture ready, prompt-filled, and reopened-conversation screenshots plus layout metrics
  • document the desktop E2E coverage and focused diagnosis flag in Chinese and English

Root cause

Tauri message virtualization was enabled even for short conversations. After a short two-turn conversation was switched away from and reopened, estimated virtual row heights could leave a large blank area above the first rendered message.

Impact

Short conversations now reopen with their first message near the top of the message viewport. Long conversations keep the existing virtualized rendering and memory behavior.

Validation

  • regression proof with the same real Tauri E2E: old condition failed with a 194px top offset; fixed condition passed with a 32px top offset
  • screenshot chain reviewed: ready state, filled composer, completed conversation after switching away and reopening
  • pnpm --filter wework lint
  • pnpm --filter wework typecheck
  • pnpm --filter wework test — 206 files, 2032 tests passed
  • real Tauri focused desktop E2E passed
  • pre-push ESLint, TypeScript, and unit-test gates passed

Summary by CodeRabbit

  • Bug Fixes

    • Improved display of short conversations by preventing unnecessary virtualization, reducing excess blank space above messages.
    • Added layout checks to ensure the first message appears within 160px of the message viewport’s top edge.
  • Testing

    • Added automated short-conversation regression coverage, screenshots, and layout metrics.
    • Enhanced desktop diagnostics with more complete element position measurements.
  • Documentation

    • Updated English and Chinese desktop E2E automation guides with the new short-conversation checks and local test instructions.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1528a5ac-6ff3-47e2-bb02-d928c431be49

📥 Commits

Reviewing files that changed from the base of the PR and between 49abe87 and 37e078d.

📒 Files selected for processing (6)
  • docs/en/wework/developer-guide/wework-e2e-automation.md
  • docs/zh/wework/developer-guide/wework-e2e-automation.md
  • wework/e2e/desktop/task-flow.e2e.mjs
  • wework/src/components/chat/MessageList.tsx
  • wework/src/components/chat/MessageList.virtualization.test.tsx
  • wework/src/e2e/automation.ts

📝 Walkthrough

Walkthrough

Changes

The change gates message virtualization behind a 20-message minimum and adds a desktop E2E regression flow that reopens short conversations, records layout metrics, captures screenshots, and enforces a 160px top-offset limit. English and Chinese guides document the workflow and artifacts.

Short-conversation layout verification

Layer / File(s) Summary
Virtualization threshold and coverage
wework/src/components/chat/MessageList.tsx, wework/src/components/chat/MessageList.virtualization.test.tsx
Virtualization now requires at least 20 visible messages; tests verify short conversations remain in normal document flow and long-conversation geometry restoration remains covered.
Desktop E2E measurement flow
wework/e2e/desktop/task-flow.e2e.mjs, wework/src/e2e/automation.ts
The shared E2E helper submits a short conversation, reopens it, captures screenshots and metrics, asserts the top-offset threshold, and supports focused execution. Element metrics now include bounding-rectangle coordinates.
Developer-guide workflow
docs/en/wework/developer-guide/wework-e2e-automation.md, docs/zh/wework/developer-guide/wework-e2e-automation.md
Both guides describe the regression step, generated artifacts, 160px gate, and --short-conversation-only command.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DesktopE2ERunner
  participant fresh_chat
  participant MessageList
  participant desktopControlElementMetrics
  DesktopE2ERunner->>fresh_chat: Submit prompt and follow-up
  fresh_chat-->>DesktopE2ERunner: Complete expected scenario requests
  DesktopE2ERunner->>MessageList: Reopen selected conversation
  DesktopE2ERunner->>desktopControlElementMetrics: Collect message bounds
  desktopControlElementMetrics-->>DesktopE2ERunner: Return layout metrics
Loading

Possibly related PRs

  • wecode-ai/Wegent#1884: Introduced the desktop task-flow runner and desktop control metrics used by this E2E extension.
  • wecode-ai/Wegent#1888: Extends the same scenario-driven desktop E2E flow with follow-up and retry behavior.
  • wecode-ai/Wegent#2165: Modifies adjacent chat message-list virtualization behavior and tests.

Suggested reviewers: ficohu

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wework-short-conversation-whitespace

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qdaxb
qdaxb marked this pull request as ready for review July 24, 2026 06:36
@qdaxb
qdaxb merged commit a9828ab into main Jul 24, 2026
30 of 34 checks passed
@qdaxb
qdaxb deleted the fix/wework-short-conversation-whitespace branch July 24, 2026 06:37
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.

1 participant