@bobfrankston/rmfmail 1.1.94 → 1.1.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.commitmsg CHANGED
@@ -1,8 +1,15 @@
1
- Tabs: keep the strip visible with one tab so "+" is discoverable
1
+ Alarm/snooze: log decisions to the daemon log so snooze is verifiable
2
2
 
3
- The view-tab strip was hidden until a 2nd tab existed but with it
4
- hidden there was no hint that tabs exist or that Ctrl+T creates one
5
- (Bob: "there needs to be some indicator that ^t creates a tab"). The
6
- strip now stays visible with a single tab, showing that tab plus the
7
- "+" button; its tooltip names the Ctrl+T shortcut. Hidden only before
8
- the very first tab is seeded.
3
+ On review the snooze keying is actually correctsnoozeItem stores under
4
+ item.uuid, which IS the full per-occurrence key (uuid:startMs@offset for
5
+ calendar, uuid:dueMs for tasks) that collectDueAlarms reads back as
6
+ snoozed[key]. They match.
7
+
8
+ What was missing was visibility: the [alarm] decisions used plain
9
+ console.log, which from the WebView never reaches the daemon log file —
10
+ so "is snooze working?" couldn't be answered after the fact. Added an
11
+ alog() helper that mirrors to the daemon log via logClientEvent, a
12
+ "snooze saved" line (key + minutes + untilMs), and routed the existing
13
+ fire-decision / dismiss / unknown-result logs through it. Next snooze is
14
+ now traceable: the "snooze saved" line and the following "fire decision"
15
+ line confirm the snooze took and for how long.
@@ -4829,6 +4829,13 @@ var alarms_exports = {};
4829
4829
  __export(alarms_exports, {
4830
4830
  startAlarmPoller: () => startAlarmPoller
4831
4831
  });
4832
+ function alog(tag, data) {
4833
+ console.log(`[alarm] ${tag}`, data ?? "");
4834
+ try {
4835
+ logClientEvent(`[alarm] ${tag}`, data);
4836
+ } catch {
4837
+ }
4838
+ }
4832
4839
  function loadDismissed() {
4833
4840
  try {
4834
4841
  return JSON.parse(localStorage.getItem(DISMISSED_KEY) || "{}");
@@ -4903,7 +4910,7 @@ async function collectDueAlarms(now) {
4903
4910
  }
4904
4911
  }
4905
4912
  if (pick) {
4906
- console.log(`[alarm] fire decision key=${pick.key} title="${ev.title || ""}" startMs=${startMs}`);
4913
+ alog("fire decision", { key: pick.key, title: ev.title || "", startMs, effective: pick.effective });
4907
4914
  items.push({
4908
4915
  uuid: pick.key,
4909
4916
  kind: "calendar",
@@ -5176,7 +5183,7 @@ async function firePopupForItem(item) {
5176
5183
  const m = loadDismissed();
5177
5184
  m[item.uuid] = true;
5178
5185
  saveDismissed(m);
5179
- console.log(`[alarm] dismiss saved key=${item.uuid}`);
5186
+ alog("dismiss saved", { key: item.uuid, via: r.button });
5180
5187
  }
5181
5188
  break;
5182
5189
  case "Delete":
@@ -5189,7 +5196,7 @@ async function firePopupForItem(item) {
5189
5196
  deleteCalendarEvent(item.uuid).catch((e) => console.error(` [alarm] delete failed for ${item.uuid}: ${e?.message || e}`));
5190
5197
  break;
5191
5198
  default:
5192
- console.warn(`[alarm] unknown popup result: button=${JSON.stringify(r.button)}, form=${JSON.stringify(r.form)}`);
5199
+ alog("unknown popup result", { button: r.button, form: r.form });
5193
5200
  {
5194
5201
  const m = loadDismissed();
5195
5202
  m[item.uuid] = true;
@@ -5204,6 +5211,7 @@ function snoozeItem(item, minutes) {
5204
5211
  map[item.uuid] = now + minutes * 6e4;
5205
5212
  saveSnoozed(map);
5206
5213
  firedThisSession.delete(item.uuid);
5214
+ alog("snooze saved", { key: item.uuid, minutes, untilMs: map[item.uuid] });
5207
5215
  }
5208
5216
  async function pollAlarms() {
5209
5217
  if (document.hidden)
@@ -7166,7 +7174,7 @@ function showComposeOverlay(title = "Compose") {
7166
7174
  if (isSmall) {
7167
7175
  wrapper.style.cssText = "position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;background:#fff;";
7168
7176
  } else {
7169
- wrapper.style.cssText = "position:fixed;bottom:0;right:16px;width:min(900px,55vw);height:min(700px,70vh);z-index:1000;border-radius:8px 8px 0 0;box-shadow:0 -4px 24px rgba(0,0,0,0.3);display:flex;flex-direction:column;overflow:hidden;";
7177
+ wrapper.style.cssText = "position:fixed;top:48px;left:calc((100vw - min(900px,55vw)) / 2);width:min(900px,55vw);height:min(700px,70vh);z-index:1000;border-radius:8px;box-shadow:0 4px 24px rgba(0,0,0,0.3);display:flex;flex-direction:column;overflow:hidden;";
7170
7178
  }
7171
7179
  const titleBar = document.createElement("div");
7172
7180
  titleBar.style.cssText = "display:flex;align-items:center;justify-content:space-between;padding:4px 8px;background:#e8ecf0;border-radius:8px 8px 0 0;cursor:move;user-select:none;flex-shrink:0;";