daily-focus 1.1.0-dev.1 → 1.1.1-dev.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/public/app.js +11 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daily-focus",
3
- "version": "1.1.0-dev.1",
3
+ "version": "1.1.1-dev.1",
4
4
  "description": "An interactive dashboard of what you should focus on today at work",
5
5
  "keywords": [
6
6
  "dashboard",
package/public/app.js CHANGED
@@ -1085,6 +1085,7 @@ var state = y2(null);
1085
1085
  function createUi(initial = {}) {
1086
1086
  return {
1087
1087
  selectedId: y2(initial.selectedId ?? null),
1088
+ clickedId: y2(initial.clickedId ?? null),
1088
1089
  pending: y2(initial.pending ?? /* @__PURE__ */ new Set()),
1089
1090
  menuFor: y2(initial.menuFor ?? null),
1090
1091
  statusFor: y2(initial.statusFor ?? null),
@@ -1136,6 +1137,9 @@ function setDetailFor(target, id) {
1136
1137
  if (target.detailFor.value !== id) {
1137
1138
  target.noteDraft.value = "";
1138
1139
  target.assistantDraft.value = "";
1140
+ const clicked = target.clickedId.value;
1141
+ if (clicked !== null && target.selectedId.value === clicked) target.selectedId.value = null;
1142
+ target.clickedId.value = null;
1139
1143
  }
1140
1144
  target.detailFor.value = id;
1141
1145
  });
@@ -1984,10 +1988,13 @@ var handlers = {
1984
1988
  onAction: (id, action, extra) => void applyAction(id, action, extra),
1985
1989
  // A click on a card: the cursor goes to it, and the panel opens on it — or
1986
1990
  // closes, if it was already open on this one. The card is the one way in with
1987
- // a mouse; `n` and `a` are the ways in from the keyboard.
1991
+ // a mouse; `n` and `a` are the ways in from the keyboard. A cursor the click
1992
+ // brought leaves with the panel, however that is closed.
1988
1993
  onSelect: (id) => n2(() => {
1994
+ const opening = ui.detailFor.value !== id;
1989
1995
  ui.selectedId.value = id;
1990
- setDetailFor(ui, ui.detailFor.value === id ? null : id);
1996
+ setDetailFor(ui, opening ? id : null);
1997
+ if (opening) ui.clickedId.value = id;
1991
1998
  ui.focusField.value = null;
1992
1999
  closeMenus();
1993
2000
  }),
@@ -2033,6 +2040,7 @@ var handlers = {
2033
2040
  jumpToTicket: (id) => {
2034
2041
  setTicketMode("sync");
2035
2042
  ui.selectedId.value = id;
2043
+ ui.clickedId.value = null;
2036
2044
  afterRender(
2037
2045
  () => document.querySelector('#tickets .item[data-selected="true"]')?.scrollIntoView({ block: "center", behavior: "smooth" })
2038
2046
  );
@@ -4975,6 +4983,7 @@ function moveSelection(delta) {
4975
4983
  const current = ids.indexOf(ui.selectedId.value ?? "");
4976
4984
  const next = current === -1 ? delta > 0 ? 0 : ids.length - 1 : current + delta;
4977
4985
  ui.selectedId.value = ids[Math.max(0, Math.min(ids.length - 1, next))] ?? null;
4986
+ ui.clickedId.value = null;
4978
4987
  afterRender(
4979
4988
  () => document.querySelector(`#${ui.view.value} .item[data-selected="true"]`)?.scrollIntoView({ block: "nearest", behavior: "smooth" })
4980
4989
  );