Repository navigation
feat(react): pick a column's decimal mark in the import preview - #949
Merged
Merged
Conversation
retype(table, types, { decimal }) takes the decimal mark of number
columns by name or position. Their text reads in that mark alone; a
value that does not fit it is blank, with a note. The note DECIMAL_MARK
stays with the mark picked and gives the example's number with each
mark (params point and comma), so a preview can offer both.
Refs #787
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under a number column with the note DECIMAL_MARK, the preview offers both marks as what the note's example is with each, such as "1,234" = 1234 (decimal point) and "1,234" = 1.234 (decimal comma), in English and German. The note points there instead of to the file. The column head is a component of its own, so ImportDialog shrinks. Refs #787 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A narrow column cut "“1,234” = 1234 (decimal point)" before the part that differs. The options now read "1234 (“1,234” in the file)" from one text, markReads. The note and the hint about columns past the first 60 say what holds for those too: they keep the mark found, and the file can be changed. A note without the example's two numbers (a plugin's own) offers no choice. Refs #787 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The closed select had no visible label and clipped its option text in
German and on a phone. A small label above it now asks the question with
the example from the file ("“1,234” means"), the options are just the
value as it reads with each mark, and the select has a title with the
full text. The choice shows only for a note with finite values for both
marks. Column heads start at the top so the type selects align.
Refs #787
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merge the decimal paragraph into the retype paragraph under a section of its own, say when the note DECIMAL_MARK stays and that a mark forced on another column blanks values that do not fit, and point the 0.10 upgrade row to the new choice. The type consumer exercises retype's decimal by name and by position. Refs #787 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/pivotkit-core/CHANGELOG.md # packages/pivotkit-element/CHANGELOG.md # packages/pivotkit-element/build.js
The question above the select is now its label, so the accessible name holds the visible text (the column follows for a screen reader) and a click on the question focuses the select. The options say whether the example's separator is the decimal mark or groups thousands, and the select widens to show them whole on a phone. The note says how to change the choice in the words the control uses. markTexts builds the texts and offers no choice for a note without both numbers or a mark, now tested. Refs #787 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The type consumer now also checks that a wrong mark or a single mark instead of a list or record is rejected. Refs #787 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Next to the question „1,234“ bedeutet, the option "1,234 (Dezimal)" read as "1,234 means 1,234". In German the decimal option now spells the reading out from the example's digits as written, „1 Komma 234“, with its sign and trailing zeros; the thousands option and English stay. Refs #787 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
English labels showed the decimal reading in the locale's notation, so under de-DE, fr-FR or sv-SE the question "“1,234” means" offered "1,234 (decimal)", the circular text the German fix removed. The English option now reads "1 point 234" from the example's digits as written, as German reads "1 Komma 234". markTexts offers no choice when the texts lack markQuestion or the two markOption texts. The localisation reference names the keys, their placeholders and why the decimal text must not show the separator. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The thousands option came from toLocaleString, so one select mixed the file's ASCII digits with the locale's: "١٢٣٤ (thousands)" next to "1 point 234" under ar-EG, a U+2212 minus under sv-SE, direction marks under fa-IR and ar-EG. Both options now take the example's characters, the thousands reading its digits joined without the separator, and markTexts no longer takes a locale. markTexts offers no choice without a markOf text either. The localisation reference says how markOf joins the question, that a missing text hides the choice, and why the decimal text spells the mark out. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/pivotkit-core/CHANGELOG.md # packages/pivotkit-element/build.js # scripts/growth-baseline.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
In the import preview, a person can now pick how a number column with one separator is read. Before, a file that reads
1.500as 1.5 instead of 1500 could only be fixed by editing the file.Fixes #787
pivotkit-core
retype(table, types, { decimal })forces a column's decimal mark, by name or by position. Entries that are not valid are ignored. TheDECIMAL_MARKnote carries the example's two readings,pointandcomma.retypehas its own section in docs/reference/import.md, with types.pivotkit-react
DECIMAL_MARKnote, the preview shows a question under the column's type: "“1,234” means". Below it is a list with two readings:markOf,markQuestionandmarkOptionare documented in docs/reference/localisation.md. If one of them is missing, the choice is not shown.pivotkit-element
Neutral review
I ran five rounds of independent review on the local branch before pushing. Fixed because of them:
The last round found nothing blocking.
Left as is: the terse "(thousands)" wording and the list's
title.Checklist (PRODUCT.md)
CHANGELOG.md(core, react, element) describe the new stateTest plan
npm run lint,npm run types,npm run growth,npm run pack:check: exit 0npm test: exit 0 on the last run. Two earlier runs failed in pivotkit-cli and pivotkit-mcp timing tests, which this branch does not touch; each passed alone.npm run test:browser: 2800 passed on the state before the last round. After it,import.spec.jsin chromium, firefox and webkit: 114 passed.🤖 Generated with Claude Code