fix(sheet): follow-up fixes for live presence (#311)#313
Conversation
Delivers the fixes that landed after #311 was auto-merged: - vite: skip @rollup/plugin-commonjs for the sheet entry — it deadlocks the rolldown (vite 8) transform while bundling HyperFormula, so the sheet bundle never builds locally. - view: render the presence name tag via a CSS ::after pseudo-element (data-label) instead of a text node, so a peer's name no longer leaks into a cell's textContent (was e.g. "=A1*3anon"). - read-only: honor data.readonly on the client (non-editable cells), so no live-edit/commit frames originate from a viewer. - tests: two-session Playwright E2E for live presence/calculation, and a direct unit test for effectiveCells overlay-wins-on-collision. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
PR Summary by QodoFix sheet presence follow-ups: sheet build hang, tag pollution, readonly UI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo
1. Readonly blocks cursor presence
|
CI Feedback 🧐A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
ui/build.js (the esbuild build used by CI's Playwright job and release builds) bundled pad/welcome/timeslider but never the sheet entry, so assets/js/sheet/ was empty and /s/:pad served no sheet.js — the spreadsheet grid never rendered outside a local vite build. Add the sheet esbuild entry (object form so the output is sheet.js, matching the path served by sheetFrontend.go). esbuild handles HyperFormula's CommonJS natively (no rolldown deadlock). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to #311 (live presence & live calculation), which auto-merged at an earlier state. This PR delivers the fixes that landed afterward.
Fixes
ui/vite.config.ts) — skip@rollup/plugin-commonjsfor thesheetentry. vite 8 is rolldown-based and handles CommonJS natively; the legacy plugin deadlocks the rolldown transform while bundling HyperFormula, sovite build --mode sheethangs and the sheet bundle never builds locally. Other entries are unchanged.sheetView.ts) — the presence name tag was a child text node of the cell, so a peer's name leaked into the cell'stextContent(e.g.=A1*3anon). Now rendered via a CSS::after/data-labelpseudo-element, leaving the cell content clean.sheetView.ts/sheetEditor.ts) — honordata.readonly: read-only viewers get non-editable cells, so no live-edit/commit frames originate from a viewer (the server already strips/rejects them). Closes the design's "enforced on both client and server" gap and the type-then-revert UX.Tests
playwright/specs/sheet_presence.spec.ts) — two sessions: remote cursor tag, live formula text, dependentC2 = 31before Enter,B2 = 30after commit, cursor cleanup on disconnect. ✅effectiveCellsproperty (a remote live raw replaces a committed cell at the same coordinate). Suite 30/30.Verified locally: sheet
tscclean, vitest 30/30, E2E passing on top of currentmain.🤖 Generated with Claude Code