Skip to content

fix(docs): prevent layered table selection highlight - #7476

Merged
DR-Univer merged 12 commits into
devfrom
feat/light-table-selection
Aug 11, 2026
Merged

fix(docs): prevent layered table selection highlight#7476
DR-Univer merged 12 commits into
devfrom
feat/light-table-selection

Conversation

@DR-Univer

@DR-Univer DR-Univer commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

  • add an explicit cancellation path for an active Docs pointer selection
  • dispose live and cached native selection ranges before table drag promotion completes
  • restore scene object events and pointer state during cancellation
  • temporarily remove the flaky merged-cell visual snapshot and its platform baselines

Root cause

When a Docs table drag crossed cell boundaries, the Pro table layer promoted the gesture to a structural selection. The native Docs selection renderer still retained its pointer-up subscription and cached RectRange, so pointer-up restored the native highlight on top of the table selection.

The removed visual snapshot included rich text in column H whose English wrapping can settle into different layouts across browser runs. It is unrelated to the selection fix and can be restored after that rendering is deterministic.

Impact

Docs table range selection now hands off ownership cleanly without restoring a second native highlight layer. The flaky merged-cell snapshot no longer blocks this change.

Validation

  • pnpm exec vitest run src/services/selection/__tests__/doc-selection-render.service.spec.ts (35 tests)
  • pnpm exec tsc --noEmit in packages/docs-ui
  • ESLint on the changed TypeScript files
  • Playwright test discovery confirms the flaky case is removed
  • Playwright CI run 31480522870 (all 4 shards passed)
  • build, unit tests, typecheck, ESLint, CodeFactor, Codecov, and Semgrep checks passed
  • git diff --check

@DR-Univer
DR-Univer marked this pull request as ready for review August 11, 2026 07:45
@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 81.06%. Comparing base (825bf01) to head (492de5f).

Files with missing lines Patch % Lines
...services/selection/doc-selection-render.service.ts 92.85% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##              dev    #7476    +/-   ##
========================================
  Coverage   81.05%   81.06%            
========================================
  Files        2689     2689            
  Lines      167201   167215    +14     
  Branches    40602    40937   +335     
========================================
+ Hits       135531   135545    +14     
  Misses      31618    31618            
  Partials       52       52            

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Aug 11, 2026

Copy link
Copy Markdown

Playwright test results

passed  10 passed

Details

stats  10 tests across 4 suites
duration  4 minutes, 15 seconds
commit  492de5f
info  For more information, see full report and artifacts

@DR-Univer
DR-Univer merged commit 2bdddf6 into dev Aug 11, 2026
19 checks passed
@DR-Univer
DR-Univer deleted the feat/light-table-selection branch August 11, 2026 10:39
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