refactor: use CSV path instead of markdown file for spark tables

Switch the spark table resolution logic to use the direct path to the
backing CSV file rather than attempting to parse the containing
markdown file. This simplifies the lookup process and improves
reliability.

Also refactor `SparkTableMeta` to store rows as objects keyed by
header instead of raw string arrays.
This commit is contained in:
2026-07-11 11:45:38 +08:00
parent b8cfb05e53
commit 719bb6ad8a
6 changed files with 65 additions and 34 deletions
+2 -2
View File
@@ -127,8 +127,8 @@ export const JournalInput: Component = () => {
try {
const key = (parsed.payload as { key: string }).key;
const match = comp.data.sparkTables.find((s) => s.slug === key);
const filePath = match?.filePath ?? "";
const p = await resolveSparkPayload({ key, filePath });
const csvPath = match?.csvPath ?? "";
const p = await resolveSparkPayload({ key, csvPath });
const result = sendMessage("spark", p);
const r = unwrap(result);
finish(r.ok, r.err);