quadratic
quadratic copied to clipboard
Fit numbers
Change how numbers render. In Excel and Sheets, the numbers never overflow the cell. They either reduce their precision, change to scientific, or show up as ####. Fixes #1468.
Note, this is based on https://github.com/quadratichq/quadratic/pull/1406 (Ayush's branch, so we can't yet diff off it), which should merge before this one. The diffs will be extreme until that branch is merged.
- [x] redo how CellValue::Number.to_display() works (removing formatting)
- [x] keep some formatting within Rust (but outside the to_display function) so we can still search against what will likely be the displayed number
- [x] move all number formatting from Rust to TS :( - this is necessary b/c we don't know how to stringify the number until we are actually rendering and can compare glyph sizes to the cell width
- [x] move tests from Rust to TS for number rendering
- [x] show #### when number overflows content
- [ ] figure out when to change the display from number to scientific to show larger numbers in a smaller space
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated (UTC) |
|---|---|---|---|
| quadratic | ✅ Ready (Inspect) | Visit Preview | Jul 30, 2024 6:11pm |
Codecov Report
Attention: Patch coverage is 94.84634% with 109 lines in your changes missing coverage. Please review.
Project coverage is 90.00%. Comparing base (
0cbf5c2) to head (4c8fdd2).
Additional details and impacted files
@@ Coverage Diff @@
## qa #1526 +/- ##
==========================================
+ Coverage 89.82% 90.00% +0.18%
==========================================
Files 185 188 +3
Lines 35092 36254 +1162
==========================================
+ Hits 31520 32629 +1109
- Misses 3572 3625 +53
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@AyushAgrawal-A2 I noticed that when vertically centered, the text alignment is a bit off when shrunk to its minimum. See image below. The vertically centered one should look like the normal one at that size. (The "hello" is the one with the vertical settings.)
@davidfig
This branch is missing some of the commit, where I restructured code and added tests
Last commit from me here is cleanup css a08a23f
Following commits are missing, which should fix code coverage as well
Good catch. I'll cherry pick the changes.
I cherry picked the changes. There are a few failing tests. @AyushAgrawal-A2 can you take a look? The failures are probably my fault, but I don't understand the code well enough to fix it.
Not sure if you can make changes to this PR. If not, create a new one and I'll merge it into this one.
Retrospectively, it would have been easier to keep these separate :)
@AyushAgrawal-A2 I noticed that when vertically centered, the text alignment is a bit off when shrunk to its minimum. See image below. The vertically centered one should look like the normal one at that size. (The "hello" is the one with the vertical settings.)
![]()
@davidfig
this happens because there is extra space to account for textureHeight of different characters
if textureHeight of all characters in string is less than cell height, then vertical align has room to slight move it
I cherry picked the changes. There are a few failing tests. @AyushAgrawal-A2 can you take a look? The failures are probably my fault, but I don't understand the code well enough to fix it.
Not sure if you can make changes to this PR. If not, create a new one and I'll merge it into this one.
@davidfig I have raised a pr to fix bugs #1574 Please generate code coverage report also after merging it.
Code coverage looks good!
@jimniels I have raised a PR #1581 having both these changes for floating context menu.
@davidfig
Precision is displayed as 0s for a number larger than the default column with (see image)
can you please take a look at this part
Large numbers have better precision:
Noticing
- For some reason, the Python cell reference here is not updating the other cells.
- There is a flashy glitchy looking re render when updating array outputs Both are shown in this video
https://github.com/user-attachments/assets/242a1d40-4c96-4ba6-9e85-7012ea306f79
@davidkircos Fixed above bugs.
Multiple async operations were not able to run in a single transaction as the same boolean flag has_async was used to flag a async operation in transaction. First async call that finishes would remove that flag and end the transaction.
Now has_async is a counter.
Can you add tests for the multiple async. Any problems with the counter?
Can you add tests for the multiple async. Any problems with the counter?
@davidfig done
Bolding text and reloading is not preserved
@davidkircos fixed another bug due to change in async transaction. I was updating the transaction clone but not saving it back in aync transactions.