Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
b9cea3b
feat(core): pick a number column's decimal mark in retype
eizedev Nov 25, 2026
5f5c8aa
feat(react): pick a column's decimal mark in the import preview
eizedev Nov 25, 2026
0dc9366
fix(react): lead the decimal mark options with the value they read as
eizedev Nov 25, 2026
51a473b
perf(element): raise the import budget for the decimal mark choice
eizedev Nov 25, 2026
c256cae
fix(react): ask what the example means above the decimal mark choice
eizedev Nov 25, 2026
625fbe3
docs(core): give retype its own section with types and decimal marks
eizedev Nov 25, 2026
88acd5a
Merge remote-tracking branch 'origin/main' into feat/import-decimal-mark
eizedev Nov 25, 2026
2eb5f88
fix(react): name the decimal mark choice by its visible question
eizedev Nov 25, 2026
0658b88
docs(core): say that retype ignores marks other than "." and ","
eizedev Nov 25, 2026
9398272
fix(react): spell the German decimal reading out with "Komma"
eizedev Nov 25, 2026
8d58f01
style(core): indent the retype type checks in the consumer test
eizedev Nov 25, 2026
2f73634
fix(react): spell the English decimal reading out with "point"
eizedev Nov 25, 2026
935317c
docs(element): give the import group's measured size, 23.8 KiB
eizedev Nov 25, 2026
a227966
fix(react): build both decimal mark options from the example as written
eizedev Nov 25, 2026
91f6874
docs: name the decimal mark lists among the preview's keyboard stops
eizedev Nov 25, 2026
2e508e9
chore: lower the growth baseline of ImportDialog to 262 lines
eizedev Nov 25, 2026
d86a71e
docs(element): give the import group's measured size, 23.7 KiB
eizedev Nov 25, 2026
cc8ed3d
Merge remote-tracking branch 'origin/main' into feat/import-decimal-mark
eizedev Nov 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/getting-started/upgrading.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ layout, and new options.
| **Breaking:** the view schema refuses a blank label | you validate stored view files against `view-2.json` or `view-file-2.json`, and a value's `label` or a name in `fieldLabels` is blank | give it a character or remove it; `normalize()` dropped such a label already |
| **Breaking:** header values refuse the control characters U+0080 to U+009F | a header value in your configuration or secret holds one of them | remove the character. The start or the log names the header |
| **Breaking:** reports are written with mode 0600 | another user reads the output directory without `output.baseUrl`, such as a backup job | run that reader as the server's user, or set `output.baseUrl`; `chmod 600` older reports to match |
| Numbers in loaded files read by their decimal mark | people load CSV or Excel files with text numbers such as `1,234` or `1.500` | check the column the note `DECIMAL_MARK` names. A comma-separated file reads `"1,234"` as 1234, where it read as 1.234; an Excel text cell `"1.500"` reads as 1500 in a German locale, where it read as 1.5 |
| Numbers in loaded files read by their decimal mark | people load CSV or Excel files with text numbers such as `1,234` or `1.500` | check the column the note `DECIMAL_MARK` names; pick its mark in the preview, or with `retype`'s `decimal` ([Changing types and decimal marks](../reference/import.md#retype)). A comma-separated file reads `"1,234"` as 1234, where it read as 1.234; an Excel text cell `"1.500"` reads as 1500 in a German locale, where it read as 1.5 |
| pivotkit-server answers a little differently | a client keeps `list_sources` file names, relies on the order of `files.list`, or calls `/openapi.json` or the REST metadata with a method other than GET or HEAD | read file names of the second and later `files.allowDirs` without their path; sort `files.list` yourself if you need another order; use GET (other methods get 405 with `Allow: GET, HEAD`). The [pivotkit-server changelog](https://github.com/eizedev/pivotkit/blob/main/packages/pivotkit-server/CHANGELOG.md) has the details |
| [Versions move together](#update) | you list pivotkit-core, pivotkit-report or pivotkit-xlsx yourself | update them to the release of pivotkit-react 0.10: core 0.10.0, report 0.6.0, xlsx 0.7.0 |

Expand Down
27 changes: 21 additions & 6 deletions docs/reference/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const table = await readFile(file, { // a File from <input type
table.notes; // what was read how, and what was changed
const data = encode(table); // { columns, types, data } is encode's input
const asText = retype(table, { Zip: "string" }); // another type, without reading the file again
const comma = retype(table, {}, { decimal: { Sales: "," } }); // "1,234" in Sales is 1.234
```

In Node, make a `File` from the file's bytes and its name. The name picks the reader:
Expand Down Expand Up @@ -198,10 +199,24 @@ A JSON number keeps only what a number holds:

Write long IDs as JSON strings.

`retype(table, types)` gives the table with other types. It works from the values as the reader
first read them, which the table keeps in `table.raw`. So a preview can let a person change a column's type without reading
the file again. Text read as a number goes back to the text the file holds (`1.234,5`). A value that
does not convert is blank, with a note that counts them.
### Changing types and decimal marks { #retype }

`retype(table, types, { decimal })` gives the table with other types, and number columns with
another decimal mark, without reading the file again. It works from the values as the reader first
read them, which the table keeps in `table.raw`, so a preview can let a person change both.
`types` and `decimal` name columns by name or by position. A missing entry keeps the column as it
is, and so does an entry that is not a type, or not `"."` or `","`.

- **Types.** Text read as a number goes back to the text the file holds (`1.234,5`). A value that
does not convert is blank, with a note that counts them.
- **Decimal marks.** `decimal` is `"."` or `","` for a number column. Its text then reads in that
mark alone: with `","`, `1,234` is 1.234 and `1.500` is 1500. It is meant for a column with the
note `DECIMAL_MARK`. That note stays, with the mark picked, as long as every value fits both marks.
On any other number column a mark is applied too: a value that does not fit it, such as `5,5`
with `"."`, is blank, with a note that counts them.
- A column keeps its mark while its type stays. When its type changes, it reads in its values'
notation again unless `decimal` names a mark for it. The mark applies to text only: a number
cell of a workbook stays as it is.

## The table

Expand Down Expand Up @@ -244,7 +259,7 @@ file had it. A field that is given must be right. This holds for `hints` too: `d
| `TEXT_CUT` | Text longer than `limits.textLength` | `count`, `max` |
| `CHARACTERS_REMOVED` | Control or direction characters | `count` |
| `DATE_ORDER` | Dates with slashes that fit both orders | `column`, `order` |
| `DECIMAL_MARK` | A number column with values the two notations read as different numbers: `1,234`, `1.500` | `column`, `decimal`, `example` |
| `DECIMAL_MARK` | A number column with values the two notations read as different numbers: `1,234`, `1.500` | `column`, `decimal`, `example`, and `point` and `comma`: the example's number with each mark |
| `VALUES_NOT_CONVERTED` | Values that are not of the column's type | `column`, `type`, `count` |
| `NUMBERS_TOO_LARGE` | Numbers too large to hold, such as JSON's `1e999`, left empty | `column`, `count` |
| `NUMBERS_ROUNDED` | Whole numbers over 2^53 and under 1e21 from JSON or a workbook, which may have lost digits | `column`, `count` |
Expand Down Expand Up @@ -350,7 +365,7 @@ runs the readers in its own worker needs `worker-src 'self'`, or the worker's or
| Name | What |
| --- | --- |
| `readFile(file, options)` | Reads a `File` or `Blob` with the reader that accepts it. Options: `plugins` (the host's reader plugins), `reader` (one plugin, skipping the choice), `sheet` (a workbook's sheet, by name or 0-based index), `types`, `locale`, `limits`, `signal`, `onProgress`, `name` (the file name for messages, for a `Blob`).<br><small>Returns `Promise<ImportTable>`</small> |
| `retype(table, types)` | The table with other column types, from `table.raw`.<br><small>Returns `ImportTable`</small> |
| `retype(table, types, options)` | The table with other column types, from `table.raw`. Options: `decimal` (the decimal mark of number columns, by name or position).<br><small>Returns `ImportTable`</small> |
| `readerFor(file, plugins)` | The plugin that accepts a `{ name, type }`, or `undefined`. |
| `loadReader(plugin)` | The plugin's reader module, loaded once and checked (`read`, optional `sheets`). |
| `validatePlugin(plugin)` | Checks a plugin against the [contract](write-a-plugin.md#the-contract); throws `INVALID_ARGUMENT` that says what is wrong. |
Expand Down
9 changes: 9 additions & 0 deletions docs/reference/localisation.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@ The texts of [loading data](../use/load-data.md) are `labels.dataImport`. They c
- the readers' notes per note code, in `labels.dataImport.notes`
- a file over a limit, in `overLimit`, with the limit's words in `limitWhat`
- `workbookCells`, for when a workbook's texts and formats reach `importCells`
- the decimal mark choice of a column whose numbers fit both marks, such as `1,234`:
- `markQuestion` is the question above the choice, with the note's value as written in `{example}`.
- `markOf` names the column, in `{column}`. A screen reader reads it right after the question.
- `markOption.thousands` and `markOption.decimal` are the two options: the separator read as a
thousands separator or as the decimal mark. Both get the characters of the value as written:
`{whole}` and `{fraction}` on each side of the separator, and `{value}`, both joined without it.
- The decimal text must not show the separator. "“1,234” means 1,234" answers nothing. Spell the
mark out instead, as in `"{whole} point {fraction}"`.
- Without one of these texts, the preview shows no choice.

They load with the import UI, English and German in one file. A host's own language takes English
there unless its `labels` give `dataImport`.
Expand Down
10 changes: 7 additions & 3 deletions docs/use/load-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,17 @@ The Data menu says which formats the report reads, for example
| Sheet | A workbook with more than one sheet: which one to read. A hidden sheet says "(hidden)". Another sheet reads the file again. |
| The first rows | Eight rows as they will be loaded, numbers in your language's notation. |
| Type | Under each column name: **Text**, **Number**, **Date** or **Yes/No**. The report picks one from the values. You can change it here. A value that does not fit the type you pick stays empty, and a note counts these values. |
| Decimal mark | When a value such as `1,234` can be read two ways, its column asks what it means: 1234 (thousands) or 1 point 234. |
| Notes | How the report read the file and what it changed: the encoding, the separator, lines skipped above the column names, empty rows left out, columns renamed, values cut, and numbers that could read two ways or were too long or too large. |

While the report reads a large file, the preview shows the progress, with **Cancel**. The preview
shows up to 60 columns. The others keep the type the report found.
shows up to 60 columns. The others keep the type and decimal mark the report found.

??? info "How the types are found"
- A column of whole and decimal numbers is a **Number**, in German (`1.234,5`) or English
(`1,234.5`) notation. When some values read as different numbers in the two, such as
`1,234`, a note names the decimal mark the report used. If it is wrong, change the file.
`1,234`, a note names the decimal mark the report used. To change it, pick what the value means
under the column name. A column after the first 60 keeps it; change the file for that one.
- Dates such as `10.11.2026`, `2026-11-10` or `11/10/2026` are a **Date**.
- `true` and `false`, and also `WAHR` and `FALSCH`, are **Yes/No**.
- A number stays **Text** when it has a leading zero, such as the postcode `01067`, or more than
Expand Down Expand Up @@ -144,7 +146,9 @@ next file.
- The preview is a dialog. The focus moves in, Tab stays inside, and Escape cancels. Afterwards the
focus goes back to where it was.
- When the first rows are there, the focus is on **Load data**, so Enter loads. Tab from there goes
to the sheet and the types, each a list named like "Type of Hours". Shift+Tab goes to **Cancel**.
to the sheet and the types, each a list named like "Type of Hours", and to the decimal marks, each
named by its question and column, like "“1,234” means (decimal mark of Sales)". Shift+Tab goes to
**Cancel**.
- After you pick another sheet, the focus stays on the sheet list.
- The dialog's description is its line of rows and columns and its notes, so a screen reader reads
them out.
Expand Down
5 changes: 5 additions & 0 deletions packages/pivotkit-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ All notable changes to `pivotkit-core` are documented in this file. The format i

### Added

- `retype(table, types, { decimal })` picks the decimal mark of number columns, `"."` or `","`, 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 its new params `point` and
`comma` give the example's number with each mark
([#787](https://github.com/eizedev/pivotkit/issues/787)).
- `describeView(view, schema, { labels, locale })` writes its texts in German too: `DESCRIBE_LABELS.de`,
or `describeLabels(locale)` for a locale's language. German quotes text values („North“) and names
one whole unit of a relative range as the engine keeps it ("heute", "gestern", "im Vorjahr"; from
Expand Down
Loading
Loading