From 48294239e55eb1352732e99ff6358b423a1435eb Mon Sep 17 00:00:00 2001 From: Diego Imbert Date: Tue, 25 Aug 2026 19:31:39 +0200 Subject: [PATCH] fix(datatables): key a table's favourite star on its own data table --- frontend/src/lib/components/DBManager.svelte | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/lib/components/DBManager.svelte b/frontend/src/lib/components/DBManager.svelte index 7da3acbee7..57000750a8 100644 --- a/frontend/src/lib/components/DBManager.svelte +++ b/frontend/src/lib/components/DBManager.svelte @@ -170,6 +170,14 @@ // without schemas has nothing to put between a data table and its tables. const currentDatatable = $derived(asset?.kind === 'datatable' ? asset.path : undefined) + /** Favourites are keyed by the table's own asset URI, so a row under another + * data table must not borrow the one the manager is currently pointed at. */ + function tableAssetPath(datatable: string | undefined, schemaKey: string, tableKey: string) { + const kind = datatable !== undefined ? 'datatable' : asset!.kind + const path = datatable ?? asset!.path + return `${kind}://${path === 'main' ? '' : path}/${schemaKey}.${tableKey}` + } + /** Tables per schema for a data table, as `schema -> table[]`. */ function schemasOf(datatable: string | undefined): Record { // The open data table reads from `dbSchema`, which is refetched after a DDL; @@ -566,7 +574,7 @@ {:else}