-
Notifications
You must be signed in to change notification settings - Fork 1
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
UI cell style #118
base: main
Are you sure you want to change the base?
UI cell style #118
Conversation
# Conflicts: # src/main.ts # src/main.types.ts
# Conflicts: # src/main.ts
# Conflicts: # index.js # src/core/event/events.types.ts # src/core/structure/cell/cell.ts # src/core/structure/sheet.ts # src/main.ts # src/main.types.ts # src/ui/render.ts # src/utils/helpers.ts
it("should create an empty cell with styling", () => { | ||
const b2 = sheet.getCellInfoAt(1, 1)!; | ||
sheet.setCellStyle( | ||
b2.position!.columnKey!, | ||
b2.position!.rowKey!, | ||
new CellStyle(new Map([["width", "50px"]])), | ||
); | ||
sheet.setCellCss(1, 1, new Map<string, string>([["width", "50px;"]])); | ||
|
||
sheet.setCellAt(1, 1, ""); | ||
|
||
// Clearing the style should result in the cell being deleted. | ||
sheet.setCellStyle(b2!.position.columnKey!, b2!.position.rowKey!, null); | ||
sheet.setCellCss(1, 1, new Map<string, string>()); | ||
expect(sheet.getCellInfoAt(1, 1)).toBeNull(); | ||
}); |
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 test is failing. maybe I did something wrong something. I am a bit tired as well, It would be nice if someone can get me insights on why this maybe happening.
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.
deleteCellIfUnused
only checks for the existence of a style. SetCellCss
calls CellStyle::clearCss
, but never cleans up empty CellStyle
objects assigned to cells. I'd suggest using the existing clearCellStyle
method, maybe along with a method similar to deleteCellIfUnused
that checks if a cell-specific style is still relevant after a change. The code should make sure that no unused or irrelevant (i.e., empty or not differing from group/sheet default style) styling objects are stored.
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.
Didn't have time to look at the tests yet.
export enum GroupTypes { | ||
Column = 1, | ||
Row, | ||
} | ||
export type GroupType = GroupTypes; |
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.
These should not exist
# Conflicts: # src/core/evaluation/expressionHandler.ts # src/main.ts # src/utils/helpers.ts # src/view/view.ts # tests/core/structure/cellStyle.test.ts # tests/core/structure/formatter.test.ts
Main features
Additional work
Didnt do