Skip to content

perf: clipboard and move cells #3072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 55 commits into from
Jul 23, 2025
Merged

perf: clipboard and move cells #3072

merged 55 commits into from
Jul 23, 2025

Conversation

AyushAgrawal-A2
Copy link
Collaborator

@AyushAgrawal-A2 AyushAgrawal-A2 commented Jun 12, 2025

Relevant issue(s)

closes #2894

Testing

Try Cut, Copy, Past, Select Move

  • Flat data
  • Tables
  • With / without formatting
  • With / without code cells
  • from table / into table
  • copy/paste from/into table having hidden columns, sorted rows, different show ui states

@AyushAgrawal-A2 AyushAgrawal-A2 self-assigned this Jun 12, 2025
@cla-bot cla-bot bot added the cla-signed label Jun 12, 2025
Copy link

qa-wolf bot commented Jun 12, 2025

QA Wolf here! As you write new code it's important that your test coverage is keeping up.
Click here to request test coverage for this PR!

Copy link
Contributor

github-actions bot commented Jun 12, 2025

Preview - Build, Deploy & Tests-E2E

✅ Build images
✅ Deploy images - Jul 23, 2025 at 10:08 AM UTC - Preview
✅ Tests-E2E - Report

@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 12, 2025 23:30 Destroyed
Copy link

codecov bot commented Jun 12, 2025

Codecov Report

Attention: Patch coverage is 91.21827% with 173 lines in your changes missing coverage. Please review.

Project coverage is 89.48%. Comparing base (68390c4) to head (b1c9b2f).
Report is 56 commits behind head on qa.

Files with missing lines Patch % Lines
quadratic-core/src/grid/sheet/data_tables/cache.rs 30.35% 39 Missing ⚠️
...ler/execution/execute_operation/execute_offsets.rs 15.00% 34 Missing ⚠️
...dratic-core/src/controller/operations/clipboard.rs 93.79% 26 Missing ⚠️
quadratic-core/src/grid/data_table/formats.rs 81.88% 25 Missing ⚠️
...ratic-core/src/controller/operations/cell_value.rs 87.62% 12 Missing ⚠️
...atic-core/src/controller/user_actions/clipboard.rs 93.18% 6 Missing ⚠️
quadratic-core/src/grid/data_table/send_render.rs 96.12% 6 Missing ⚠️
quadratic-core/src/grid/sheet/format_summary.rs 91.04% 6 Missing ⚠️
...atic-core/src/grid/formats/sheet_format_updates.rs 97.88% 5 Missing ⚠️
.../execution/execute_operation/execute_data_table.rs 97.65% 3 Missing ⚠️
... and 7 more
Additional details and impacted files
@@            Coverage Diff             @@
##               qa    #3072      +/-   ##
==========================================
- Coverage   89.51%   89.48%   -0.04%     
==========================================
  Files         429      429              
  Lines       86670    86950     +280     
==========================================
+ Hits        77583    77805     +222     
- Misses       9087     9145      +58     

☔ View full report in Codecov by Sentry.
📢 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 temporarily deployed to preview-pr-3072 June 13, 2025 00:32 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 13, 2025 01:28 Destroyed
Base automatically changed from ayush/2947 to tables-perf June 13, 2025 13:23
@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 13, 2025 16:18 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 14, 2025 00:30 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 14, 2025 03:02 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 14, 2025 03:30 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 14, 2025 05:34 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 14, 2025 05:36 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 June 14, 2025 06:05 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 July 18, 2025 05:36 Destroyed
@github-actions github-actions bot temporarily deployed to preview-pr-3072 July 18, 2025 07:55 Destroyed
Copy link
Contributor

@luke-quadratic luke-quadratic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I did a thorough job reviewing here. Approving.

Leaving on user test tag. Would like @jimniels to spend a few minutes in it as well.

@luke-quadratic
Copy link
Contributor

@davidkircos final set of eyes that aren't mine before merging would be good

);
SetTopLeftCoordinate(xyToA1(topLeftCoordinate.column, topLeftCoordinate.row));
}, WAIT_TO_SNAP_TIME);
const topLeft = pixiApp.viewport.getVisibleBounds();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@github-actions github-actions bot temporarily deployed to preview-pr-3072 July 22, 2025 07:41 Destroyed

let old_size = sheet.offsets.set_default_width(size);

if (cfg!(target_family = "wasm") || cfg!(test)) && !transaction.is_server() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving to the wasm dir

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is more of this in the same file, needs a comprehensive refactor to isolate wasm calls

let old_size = sheet.offsets.set_default_width(size);

if (cfg!(target_family = "wasm") || cfg!(test)) && !transaction.is_server() {
if let Some(sheet) = self.try_sheet(sheet_id) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we have sheet already from link 287?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rust complains if I use the previous one

cannot borrow `self.a1_context` as immutable because it is also borrowed as mutable
immutable borrow occurs here

) {
unwrap_op!(let DefaultRowSize { sheet_id, size } = op);

let Some(sheet) = self.try_sheet_mut(sheet_id) else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like an anti-pattern (I know, it's everywhere). Consider returning a result here since we have some mechanism for capturing the result in other exec files.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want this to fail silently, this is being done differently in different fns, needs a comprehensive refactor to make it uniform

@@ -205,6 +205,11 @@ impl GridController {
Operation::MoveRows { .. } => self.execute_move_rows(transaction, op),
}
}
#[cfg(feature = "show-operations")]
if cfg!(target_family = "wasm") {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider moving to the was dir

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Copy link
Collaborator

@ddimaria ddimaria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust code looks good, just left some questions/nits

@github-actions github-actions bot temporarily deployed to preview-pr-3072 July 23, 2025 09:44 Destroyed
@AyushAgrawal-A2 AyushAgrawal-A2 merged commit b430cc9 into qa Jul 23, 2025
189 checks passed
@AyushAgrawal-A2 AyushAgrawal-A2 deleted the ayush/2894 branch July 23, 2025 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: performance degradation when moving a large table Copy cell takes a long time
5 participants