From 1167d138a31ad8c4491b5a81948536eeb83aaf25 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Sun, 22 Mar 2026 03:14:51 +0300 Subject: [PATCH] feat: locale-aware command templates, debounced auto-sync, entity pickers - Locale-aware templates: CommandTemplateSlot now has a locale column, allowing each slot to have per-language variants (EN/RU). Templates are resolved at runtime from the Telegram user's language_code. - Merged system configs: "Default Commands (EN)" and "(RU)" merged into a single "Default Commands" config with locale-aware slots. Migration handles existing data automatically. - Configurable command descriptions: hardcoded COMMAND_DESCRIPTIONS replaced with desc_* template slots (desc_status, desc_help, etc.) that users can customize per locale. setMyCommands registers all locales explicitly. - Removed locale from CommandConfig: no longer needed since locale is derived from the Telegram user's language at runtime. - Debounced command auto-sync: after command config/tracker changes, affected bots are marked dirty and synced after a 30s debounce window. Manual "Sync with Telegram" button still works. - Entity pickers in LinkedTargetsSection: replaced 6 plain onupdateLink(tt, 'tracking_config_id', Number((e.target as HTMLSelectElement).value) || null)} - class="text-xs px-2 py-1 border border-[var(--color-border)] rounded-md bg-[var(--color-background)]"> - - {#each configsForTracker(trackingConfigs) as tc}{/each} - - +
+ onupdateLink(tt, 'tracking_config_id', Number(v) || null)} /> +
+
+ onupdateLink(tt, 'template_config_id', Number(v) || null)} /> +
onopenTestMenu(tt.id, e)} @@ -91,24 +108,21 @@ {#if unlinkedTargets.length > 0}
- - - +
+ onchangeNewTarget(Number(v) || 0)} /> +
+
+ onchangeNewTrackingConfig(Number(v) || 0)} /> +
+
+ onchangeNewTemplateConfig(Number(v) || 0)} /> +