From 22361d0ddece0d143a23c26caa2e5c9e3483fd1c Mon Sep 17 00:00:00 2001 From: Priec Date: Tue, 18 Aug 2026 11:46:34 +0200 Subject: [PATCH] fixesc --- search/src/lib.rs | 6 ++-- web/locales/cs/main.ftl | 3 +- web/locales/en/main.ftl | 3 +- web/locales/sk/main.ftl | 3 +- web/static/app.css | 29 +++++++++++-------- .../pages/import_export/import/behaviour.html | 2 -- .../pages/import_export/import/step.html | 1 - 7 files changed, 24 insertions(+), 23 deletions(-) diff --git a/search/src/lib.rs b/search/src/lib.rs index 222731aa..f95383e5 100644 --- a/search/src/lib.rs +++ b/search/src/lib.rs @@ -31,6 +31,7 @@ const HARD_RESULT_LIMIT: usize = 200; const DEFAULT_LIST_LIMIT: usize = 5; const SEARCH_SCORE_RELATIVE_FLOOR: f32 = 0.25; const SEARCH_SCORE_GROUP_WIDTH: f32 = 0.25; +const LEDGER_ACCOUNTS_TABLE_NAME: &str = "ledger_accounts"; pub struct AccountPathProjection { paths: HashMap, @@ -48,7 +49,7 @@ impl AccountPathProjection { let account_column = physical_to_display .get(common::system_column::ACCOUNT_REFERENCE_COLUMN) .cloned(); - let accounts_table = table_name == "accounts"; + let accounts_table = table_name == LEDGER_ACCOUNTS_TABLE_NAME; if account_column.is_none() && !accounts_table { return Ok(Self { paths: HashMap::new(), @@ -58,8 +59,9 @@ impl AccountPathProjection { } let qualified_accounts = format!( - "\"{}\".\"accounts\"", + "\"{}\".\"{}\"", profile_name.replace('"', "\"\""), + LEDGER_ACCOUNTS_TABLE_NAME, ); let rows = sqlx::query(AssertSqlSafe(format!( "SELECT id, segment, parent_account_id FROM {qualified_accounts} WHERE deleted = FALSE" diff --git a/web/locales/cs/main.ftl b/web/locales/cs/main.ftl index e5ced89d..75868846 100644 --- a/web/locales/cs/main.ftl +++ b/web/locales/cs/main.ftl @@ -615,8 +615,7 @@ import-mapping-rows = Soubor obsahuje { $rows } datových řádků. import-summary-mapped-short = namapováno import-summary-attention-short = sloupců tabulky bez mapování import-csv-columns = Nalezené sloupce CSV -import-csv-columns-hint = Klikněte na sloupec, Ctrl/Cmd-kliknutím přidejte další nebo Shift-kliknutím vyberte rozsah. Malý text je první datová hodnota. -import-selection-hint = Kliknutím na sloupec tabulky nebo přetažením na něj umístíte vybrané sloupce postupně od něj. +import-csv-columns-hint = Klikněte na sloupec, Ctrl/Cmd-kliknutím přidejte další nebo Shift-kliknutím vyberte rozsah; pak klikněte na sloupec tabulky, kterým má výběr začít, nebo jej na něj přetáhněte. Malý text je první datová hodnota. import-select-all-columns = Vybrat všechny import-clear-selection = Zrušit výběr import-map-in-order = Namapovat podle pořadí diff --git a/web/locales/en/main.ftl b/web/locales/en/main.ftl index eb472856..f89bef22 100644 --- a/web/locales/en/main.ftl +++ b/web/locales/en/main.ftl @@ -603,8 +603,7 @@ import-mapping-rows = The file holds { $rows } data rows. import-summary-mapped-short = mapped import-summary-attention-short = table columns not mapped import-csv-columns = CSV columns found -import-csv-columns-hint = Click a column, Ctrl/Cmd-click to add more, or Shift-click for a range. The small text is the first data value. -import-selection-hint = Click or drag onto a table column to place the selected columns there, one after another. +import-csv-columns-hint = Click a column, Ctrl/Cmd-click to add more, or Shift-click for a range, then click or drag onto the table column the selection should start at. The small text is the first data value. import-select-all-columns = Select all import-clear-selection = Clear selection import-map-in-order = Map in order diff --git a/web/locales/sk/main.ftl b/web/locales/sk/main.ftl index 03b02384..30b71789 100644 --- a/web/locales/sk/main.ftl +++ b/web/locales/sk/main.ftl @@ -613,8 +613,7 @@ import-mapping-rows = Súbor obsahuje { $rows } riadkov údajov. import-summary-mapped-short = namapovaných import-summary-attention-short = stĺpcov tabuľky bez mapovania import-csv-columns = Nájdené stĺpce CSV -import-csv-columns-hint = Kliknite na stĺpec, Ctrl/Cmd-kliknutím pridajte ďalšie alebo Shift-kliknutím vyberte rozsah. Malý text je prvá hodnota údajov. -import-selection-hint = Kliknutím na stĺpec tabuľky alebo potiahnutím naň umiestnite vybrané stĺpce postupne od neho. +import-csv-columns-hint = Kliknite na stĺpec, Ctrl/Cmd-kliknutím pridajte ďalšie alebo Shift-kliknutím vyberte rozsah; potom kliknite na stĺpec tabuľky, ktorým má výber začať, alebo ho naň potiahnite. Malý text je prvá hodnota údajov. import-select-all-columns = Vybrať všetky import-clear-selection = Zrušiť výber import-map-in-order = Namapovať podľa poradia diff --git a/web/static/app.css b/web/static/app.css index 6d7c20d7..1966d1d6 100644 --- a/web/static/app.css +++ b/web/static/app.css @@ -373,24 +373,29 @@ .palette-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; } .palette-actions { display: flex; align-items: center; gap: 6px; } .palette-actions button.secondary { margin: 0; padding: 4px 8px; border: 1px solid #cfd8e5; border-radius: 6px; color: #46566d; background: white; font-size: 11px; cursor: pointer; } - .selection-count { color: #6d798a; font-size: 11px; font-variant-numeric: tabular-nums; } - .selection-hint { margin: 0 0 10px; padding: 7px 9px; border-radius: 6px; color: #1d4ed8; background: #eef4ff; font-size: 12px; } + .selection-count { min-width: 42px; color: #6d798a; font-size: 11px; font-variant-numeric: tabular-nums; text-align: right; } + /* Every track is a fixed width and there is only ever one row, so selecting a + chip or mapping it changes colour and nothing else — no part of the list + moves under the pointer that just clicked it. */ .source-chips { display: grid; gap: 7px; } - .source-chip { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px 8px; width: 100%; padding: 9px 10px; border: 1px solid #cfd9e6; border-radius: 7px; color: #33415c; background: white; text-align: left; cursor: grab; transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease; } + .source-chip { display: grid; grid-template-columns: 19px minmax(0, 1fr) 108px; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 1px solid #cfd9e6; border-radius: 7px; color: #33415c; background: white; text-align: left; cursor: grab; transition: border-color 120ms ease, box-shadow 120ms ease, opacity 120ms ease; } .source-chip:hover { border-color: #78a1df; box-shadow: 0 3px 10px rgb(31 43 58 / 9%); } .source-chip.is-mapped { border-color: #a8cfb3; background: #f4fbf6; } .source-chip.is-selected { border-color: #78a1df; background: #f3f7ff; outline: 3px solid rgb(37 99 235 / 12%); } .source-chip.is-dragging { opacity: .55; cursor: grabbing; } .source-chip code { overflow: hidden; text-overflow: ellipsis; } - .source-chip small { max-width: 100px; overflow: hidden; color: #778396; text-overflow: ellipsis; white-space: nowrap; } - /* The rank a selected column will take when the batch is placed. Hidden - entirely while nothing is selected, so every chip shifts together. */ - .chip-order { grid-row: 1 / span 2; display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; color: white; background: #2563eb; font-size: 11px; font-variant-numeric: tabular-nums; } - .mapping-workbench:not(.has-selection) .chip-order, .chip-order:empty { display: none; } - /* Where this column ended up, read off the destination it was given. */ - .chip-target { grid-column: 2 / -1; overflow: hidden; color: #287443; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; } - .chip-target:empty { display: none; } + /* The rank a selected column will take when the batch is placed. Its track is + reserved whether or not it is showing. */ + .chip-order { display: grid; width: 19px; height: 19px; place-items: center; border-radius: 50%; visibility: hidden; color: white; background: #2563eb; font-size: 11px; font-variant-numeric: tabular-nums; } + .source-chip.is-selected .chip-order { visibility: visible; } + /* One slot, two things to say: the first data value while the column is still + free, and where it went once it is mapped — by then the destination row is + showing that value anyway. */ + .source-chip small, .chip-target { grid-column: 3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .source-chip small { color: #778396; } + .chip-target { color: #287443; font-size: 11px; } + .source-chip.is-mapped small, .chip-target:empty { display: none; } .destination-rows { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; } .destination-rows li { display: grid; grid-template-columns: minmax(100px, .7fr) 22px minmax(210px, 1.3fr) minmax(70px, .65fr) auto; align-items: center; gap: 8px; min-height: 62px; padding: 8px 9px; border: 1px dashed #cdd6e2; border-radius: 7px; background: white; transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease; } @@ -412,7 +417,7 @@ @media (max-width: 850px) { .mapping-panels { grid-template-columns: 1fr; } .source-palette { position: static; max-height: none; } - .source-chips { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); } + .source-chips { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); } .destination-rows li { grid-template-columns: minmax(90px, .7fr) 18px minmax(180px, 1.3fr) auto; } .mapped-example { display: none; } } diff --git a/web/templates/pages/import_export/import/behaviour.html b/web/templates/pages/import_export/import/behaviour.html index ba68915b..64b9e96b 100644 --- a/web/templates/pages/import_export/import/behaviour.html +++ b/web/templates/pages/import_export/import/behaviour.html @@ -72,8 +72,6 @@ workbench.classList.toggle("has-selection", selectedSources.size > 0); const count = workbench.querySelector("[data-selection-count]"); if (count) count.textContent = selectedSources.size + " / " + sourceChips.length; - const hint = workbench.querySelector("[data-selection-hint]"); - if (hint) hint.hidden = selectedSources.size === 0; const summary = document.querySelector("[data-mapping-summary]"); if (summary) { diff --git a/web/templates/pages/import_export/import/step.html b/web/templates/pages/import_export/import/step.html index f35af2b3..ec38e5da 100644 --- a/web/templates/pages/import_export/import/step.html +++ b/web/templates/pages/import_export/import/step.html @@ -94,7 +94,6 @@

{{ nav.tr("import-csv-columns-hint") }}

-
{% for source in step.sources %}