Compare commits

...

2 Commits

Author SHA1 Message Date
pdmarf
0eeeed270f Merge branch 'stable-rebuild' 2026-04-24 09:13:41 +01:00
pdmarf
5cdc77ccf3 v1.0.36: eliminate blue flash between setSettings and setState
setState was being called after setRunningEntry, which makes two
async global settings calls and takes ~1 second. During that time
the button sat in the blue reset state from setSettings. Now
setState is called immediately after setSettings, before
setRunningEntry, so the blue flash is imperceptibly brief.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 09:13:38 +01:00
6 changed files with 12 additions and 12 deletions

View File

@@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) {
} }
// src/plugin.ts // src/plugin.ts
var CURRENT_VERSION = "1.0.35"; var CURRENT_VERSION = "1.0.36";
var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild"; var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
@@ -6625,8 +6625,8 @@ var TimerToggle = class extends SingletonAction {
const stopped = { ...ev.payload.settings, activeEntryId: null }; const stopped = { ...ev.payload.settings, activeEntryId: null };
await ev.action.setSettings(stopped); await ev.action.setSettings(stopped);
this.settingsCache.set(ev.action.id, stopped); this.settingsCache.set(ev.action.id, stopped);
await setRunningEntry(null);
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]); await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
await setRunningEntry(null);
} else { } else {
const prevEntryId = await getRunningEntryId(); const prevEntryId = await getRunningEntryId();
if (prevEntryId) { if (prevEntryId) {
@@ -6651,8 +6651,8 @@ var TimerToggle = class extends SingletonAction {
const started = { ...ev.payload.settings, activeEntryId: entryId }; const started = { ...ev.payload.settings, activeEntryId: entryId };
await ev.action.setSettings(started); await ev.action.setSettings(started);
this.settingsCache.set(ev.action.id, started); this.settingsCache.set(ev.action.id, started);
await setRunningEntry(entryId);
await Promise.all([ev.action.setState(1), ev.action.setTitle(`\u23F1 ${title}`)]); await Promise.all([ev.action.setState(1), ev.action.setTitle(`\u23F1 ${title}`)]);
await setRunningEntry(entryId);
} }
} catch (err) { } catch (err) {
await Promise.all([ev.action.setState(activeEntryId ? 1 : 0), ev.action.setTitle(activeEntryId ? `\u23F1 ${title}` : title)]); await Promise.all([ev.action.setState(activeEntryId ? 1 : 0), ev.action.setTitle(activeEntryId ? `\u23F1 ${title}` : title)]);

View File

@@ -1,2 +1,2 @@
x3:Œb™ <EFBFBD> Yx<■bМwHW.Eш?сI* ║╘%g╘жЮтр>eШаk╡╒Н┤*иГ╨o
«… <EFBFBD>…A!úɨ½ol<6F>ž&ÊhoÛ”c±`5^LBœ'#9«PISïó{ Á‰ hг@÷╘╚╞=л

View File

@@ -2,7 +2,7 @@
"Author": "Pete Marfleet", "Author": "Pete Marfleet",
"Description": "Toggle Notion time tracking for a project with a single button press.", "Description": "Toggle Notion time tracking for a project with a single button press.",
"Name": "Notion Timer", "Name": "Notion Timer",
"Version": "1.0.35", "Version": "1.0.36",
"SDKVersion": 2, "SDKVersion": 2,
"Software": { "MinimumVersion": "5.0" }, "Software": { "MinimumVersion": "5.0" },
"OS": [{ "Platform": "mac", "MinimumVersion": "10.11" }], "OS": [{ "Platform": "mac", "MinimumVersion": "10.11" }],

Binary file not shown.

View File

@@ -1,4 +1,4 @@
const CURRENT_VERSION = "1.0.35"; const CURRENT_VERSION = "1.0.36";
const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild"; const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/stable-rebuild";
const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4=
@@ -237,9 +237,9 @@ class TimerToggle extends SingletonAction<TimerSettings> {
const stopped = { ...ev.payload.settings, activeEntryId: null }; const stopped = { ...ev.payload.settings, activeEntryId: null };
await ev.action.setSettings(stopped); await ev.action.setSettings(stopped);
this.settingsCache.set(ev.action.id, stopped); this.settingsCache.set(ev.action.id, stopped);
await setRunningEntry(null); // Re-assert immediately — before setRunningEntry's async calls
// Re-assert after setSettings resets visual state
await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]); await Promise.all([ev.action.setState(0), ev.action.setTitle(title)]);
await setRunningEntry(null);
} else { } else {
const prevEntryId = await getRunningEntryId(); const prevEntryId = await getRunningEntryId();
@@ -267,9 +267,9 @@ class TimerToggle extends SingletonAction<TimerSettings> {
const started = { ...ev.payload.settings, activeEntryId: entryId }; const started = { ...ev.payload.settings, activeEntryId: entryId };
await ev.action.setSettings(started); await ev.action.setSettings(started);
this.settingsCache.set(ev.action.id, started); this.settingsCache.set(ev.action.id, started);
await setRunningEntry(entryId); // Re-assert immediately — before setRunningEntry's async calls
// Re-assert after setSettings resets visual state
await Promise.all([ev.action.setState(1), ev.action.setTitle(`${title}`)]); await Promise.all([ev.action.setState(1), ev.action.setTitle(`${title}`)]);
await setRunningEntry(entryId);
} }
} catch (err) { } catch (err) {
// Revert optimistic visual on error // Revert optimistic visual on error

View File

@@ -1 +1 @@
{ "version": "1.0.35" } { "version": "1.0.36" }