Make Table Formulas a built-in feature

The formula engine, the rendered results, and the formula help now
come from src/lib/formulas/. The editor and the renderer call this
module directly. The tableFormulas contribution type is removed.

- Add the tableFormulas general setting (default on) and a switch in
  Settings > General. When it is off, formulas show as source text.
- Do not load an installed runestone.table-formulas package. Settings
  > Plug-ins marks it as included with RuneStone and tells the user
  that it can be removed. The user's files stay in place.
- Translate the formula help and the error descriptions into French,
  Japanese, and Simplified Chinese.
- Port the plugin unit tests. Test the setting and use a test-only
  contribution for the generic plugin lifecycle tests.
- Smoke tests load only Terminal. The formula and lifecycle tests use
  the built-in feature and its setting.
- Remove scripts/buildPlugins.mjs, the build:plugins script, and the
  plugin-packages requirement of the smoke runner.
- Remove RuneStone_Table_Formulas from the menu audit scope. It had no
  menu surfaces.
- Update the README, the user guides, and the developer references.
This commit is contained in:
Knotty Wyvern
2026-10-28 01:05:43 -07:00
parent 72671e5d01
commit 5e1533c371
43 changed files with 580 additions and 198 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import { t } from "$lib/i18n";
import { pluginHost } from "$lib/plugins/registry";
import { tableFormulasEnabled } from "$lib/formulas";
import { tick, type Snippet } from "svelte";
import { workspaceReadDataUrl } from "$lib/workspace/api";
import { markdownImages, renderMarkdownHtml, renderMarkdownSections, type MarkdownSection } from "$lib/workspace/noteHtml";
@@ -64,7 +64,7 @@
}
$effect(() => {
void $pluginHost;
void $tableFormulasEnabled;
const path = noteRel;
if (foldingNote !== path) { collapsedHeadings.clear(); foldingNote = path; }
const text = contents;
+8 -1
View File
@@ -40,7 +40,7 @@
type Section = string;
const sections: { id: Section; label: string; icon: IconName; keywords: string }[] = $derived([
{ id: "about", label: $t("Help and about"), icon: "help", keywords: "help about version shortcuts keyboard guide" },
{ id: "general", label: $t("General"), icon: "settings", keywords: "auto-save autosave save interval seconds files language français 日本語 简体中文" },
{ id: "general", label: $t("General"), icon: "settings", keywords: "auto-save autosave save interval seconds files language français 日本語 简体中文 tables table formulas calculate" },
{ id: "appearance", label: $t("Appearance"), icon: "sun", keywords: "theme colors light dark Claude Sakura Harvest Moon Crimson Pilot Silver Serpent" },
{ id: "plugins", label: $t("Plug-ins"), icon: "puzzle", keywords: "plugins extensions community" },
]);
@@ -129,6 +129,13 @@
<p class="intro">{$t("Choose how RuneStone saves your work.")}</p>
<h3>{$t('Language')}</h3>
<div class="card"><div class="setting-row language-row"><div><label for="language-picker">{$t('Display language')}</label><p>{$t('Choose the language for RuneStone controls.')}</p></div><button id="language-picker" class="text-button language-picker" aria-haspopup="menu" onclick={languagePicker}><Icon icon="globe" />{LANGUAGES.find(item => item.id === $locale)?.name}<Icon icon="chevron-down" /></button></div></div>
<h3>{$t("Tables")}</h3>
<div class="card">
<div class="setting-row">
<div><label for="table-formulas">{$t("Table formulas")}</label><p id="table-formulas-description">{$t("Calculate table cells that start with =. When this is off, formulas show as text.")}</p></div>
<input id="table-formulas" class="switch" type="checkbox" role="switch" aria-describedby="table-formulas-description" checked={settings.tableFormulas} onchange={event => apply({ ...settings, tableFormulas: event.currentTarget.checked })} />
</div>
</div>
<h3>{$t("Files")}</h3>
<div class="card">
<div class="setting-row">