[FIX] localize and canonicalize content#8275
Conversation
8481808 to
a848d61
Compare
hokolomopo
left a comment
There was a problem hiding this comment.
Commit format is wrong, otherwise LGTM :)
1a8c8bf to
569930d
Compare
| protected getCurrentCanonicalContent(): string { | ||
| return canonicalizeNumberContent(this._currentContent, this.getters.getLocale()); |
There was a problem hiding this comment.
why remove it from here and copy the exact same code in the children ?
There was a problem hiding this comment.
One children use "canonicalizeContent" and the other "canonicalizeNumberContent"
There was a problem hiding this comment.
it's very weird and it's impossible to understand and know why by reading the code.
I found out it's because of dates which are not canonical on UPDATE_CELL (and then core detects the format).
If we want to be consistent and to always use canonical content on the wire, shouldn't we change that ?
At the very least, it deserves a comment.
canonicalizeNumberContent and canonicalizeContent should not both exist, only one them. It's very confusing, and you don't know which one should be used. But that's a refactoring for master.
4a5f361 to
d791e53
Compare
| } | ||
|
|
||
| protected getCurrentCanonicalContent(): string { | ||
| return canonicalizeNumberContent(this._currentContent, this.getters.getLocale()); |
There was a problem hiding this comment.
Maybe add a comment to explain why you used two different canonicalize method (here and in standalone_composer_store)
d791e53 to
b49fb7e
Compare
eb413e9 to
684f127
Compare
e74da37 to
ef2dd7a
Compare
| const canonicalizedValue = canonicalizeContent(value, locale); | ||
| this.composer.setCurrentContent(canonicalizedValue); |
There was a problem hiding this comment.
composer.setCurrentContent is supposed to take localized content, since it later takes this._currentContent and run canonicalizeNumberContent on it
There was a problem hiding this comment.
Think it's what it does ^^
There was a problem hiding this comment.
I change it to localizedValue, Lucas is right :)
(and on top of that, value was already canonical)
There was a problem hiding this comment.
I read the sentence backwards, I think ><
9176607 to
300be91
Compare
|
testing Claude review skill: Commits
Findingssrc/registries/data_validation_registry.ts:747 — nit
src/registries/data_validation_registry.ts:147 — nit
src/registries/data_validation_registry.ts:109,131,153 — nit
src/registries/data_validation_registry.ts:685,696 — warning
src/components/side_panel/data_validation/dv_criterion_form/dv_input/dv_input.ts:63,70 — nit
src/components/side_panel/data_validation/dv_criterion_form/dv_input/dv_input.ts:60-65 — warning
tests — coverage gap (warning)No test exercises the CF editor color-scale/icon-set localized input path added in |
Before this commit: - Set the locale to french - Open the data validation side panel and create a rule with "Date is" 1/3/2026 - Press Enter In the composer : the date is canonicalized to the default format 03/01/2026 In the preview (after saving): the date is correctly displayed in the localized format 01/03/2026 The displayed date should always follow the locale format and the value stored in the model should always be in the default format. We decided to immediately canonicalize the input and to only use the locale for display Task: 6089166
Task: 6089166
300be91 to
3a79bc6
Compare
Before this commit : Issue in the input of a "value in list" DV 1/2 was automaticcaly transformed into 1/2/2026 and no change was possible After this commit: The input is stocked in a state and is only transformed when the user confirms his input Task: 6089166
3a79bc6 to
e3c06b5
Compare

Task: 6089166
review checklist