-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[lexical-table] Support first column freeze #7134
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work well! I think a number is a bit more future-proof than a boolean (the accessor could be a boolean for now, mostly just thinking about the JSON). I did notice a typo but otherwise this looks good. I only tested in Chrome though, Safari and Firefox might have CSS quirks with this sort of thing?
@@ -48,6 +48,7 @@ export type SerializedTableNode = Spread< | |||
{ | |||
colWidths?: readonly number[]; | |||
rowStriping?: boolean; | |||
frozenFirstColumn?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, the Google Sheets API uses a frozenRowCount and frozenColumnCount. Freezing the first n rows or columns is probably not much harder than freezing one? Even if we only support 1 right now we could still future-proof the JSON by using a number.
https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets/sheets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a fantastic suggestion. I'll do it this way.
@etrepum this one is good to go |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it's missing the exportJSON
for frozenColumns (and it doesn't have any tests that exercise serialization). Could be fixed as a follow-up, can easily repro in the editor by copying and pasting a table that has a frozen column
Oh, my oversight. I'll add the export JSON and add an extra test. |
Part one of freeze support in tables.
Have done the easier part, freezing a column
Screen.Recording.2025-02-09.at.17.28.34.mov