daily-focus 0.1.1-dev.10 → 0.1.1-dev.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "daily-focus",
3
- "version": "0.1.1-dev.10",
3
+ "version": "0.1.1-dev.11",
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
@@ -2653,6 +2653,7 @@ function renderActions(item, state2, ui2, handlers2) {
2653
2653
  {
2654
2654
  type: "button",
2655
2655
  class: "button",
2656
+ "aria-haspopup": "menu",
2656
2657
  "aria-expanded": String(ui2.menuFor.value === item.id),
2657
2658
  onClick: () => handlers2.toggleMenu(item.id)
2658
2659
  },
@@ -2676,9 +2677,9 @@ function renderSnoozeMenu(item, now, handlers2, { indefinite = true, longRange =
2676
2677
  presets.push(["Next month", addMonths(now, 1), true], ["Next quarter", addMonths(now, 3), true]);
2677
2678
  }
2678
2679
  let dateInput = null;
2679
- return el(
2680
- "div",
2681
- { class: "menu", role: "menu" },
2680
+ return k(
2681
+ Menu,
2682
+ { class: "menu" },
2682
2683
  presets.map(
2683
2684
  ([label, until, dated]) => el(
2684
2685
  "button",
@@ -2727,6 +2728,14 @@ function renderSnoozeMenu(item, now, handlers2, { indefinite = true, longRange =
2727
2728
  )
2728
2729
  );
2729
2730
  }
2731
+ function Menu({ class: className, children }) {
2732
+ const ref = A2(null);
2733
+ _2(() => {
2734
+ const node = ref.current;
2735
+ if (node?.showPopover && !node.matches(":popover-open")) node.showPopover();
2736
+ });
2737
+ return el("div", { class: className, role: "menu", popover: "manual", ref }, children);
2738
+ }
2730
2739
  function addDays(from, days) {
2731
2740
  return localDateKey(new Date(from.getFullYear(), from.getMonth(), from.getDate() + days));
2732
2741
  }
@@ -3069,6 +3078,7 @@ function renderPullActions(row, ui2, handlers2) {
3069
3078
  type: "button",
3070
3079
  class: "button",
3071
3080
  title: "Park this until a date",
3081
+ "aria-haspopup": "menu",
3072
3082
  "aria-expanded": String(ui2.menuFor.value === row.id),
3073
3083
  onClick: () => handlers2.toggleMenu(row.id)
3074
3084
  },
@@ -3320,6 +3330,7 @@ function renderTicketStatus(row, state2, ui2, handlers2) {
3320
3330
  type: "button",
3321
3331
  class: "pill pill--status pill--button",
3322
3332
  title: `Move ${row.key} to another status`,
3333
+ "aria-haspopup": "menu",
3323
3334
  "aria-expanded": String(ui2.statusFor.value === row.id),
3324
3335
  onClick: () => handlers2.toggleStatus(row.id)
3325
3336
  },
@@ -3336,9 +3347,9 @@ function ticketStatusOptions(row, state2) {
3336
3347
  }
3337
3348
  function renderStatusMenu(row, offered, ui2, handlers2) {
3338
3349
  const busy = ui2.pending.value.has(row.id);
3339
- return el(
3340
- "div",
3341
- { class: "menu menu--status", role: "menu" },
3350
+ return k(
3351
+ Menu,
3352
+ { class: "menu menu--status" },
3342
3353
  offered.map(
3343
3354
  (status) => el(
3344
3355
  "button",
@@ -3389,6 +3400,7 @@ function renderTicketActions(row, ui2, handlers2) {
3389
3400
  type: "button",
3390
3401
  class: "button",
3391
3402
  title: "Park this until a date",
3403
+ "aria-haspopup": "menu",
3392
3404
  "aria-expanded": String(ui2.menuFor.value === row.id),
3393
3405
  onClick: () => handlers2.toggleMenu(row.id)
3394
3406
  },
package/public/style.css CHANGED
@@ -1152,14 +1152,29 @@ body[data-session-active='true'] #today .item:not([data-running='true']):focus-w
1152
1152
 
1153
1153
  /* snooze menu */
1154
1154
 
1155
+ /*
1156
+ * A popover in the top layer (`Menu` in client/items.ts says why), hung from the
1157
+ * button that opened it. Only one menu is ever open, so only one button is
1158
+ * expanded and the one anchor name is never ambiguous. `inset` and `margin`
1159
+ * undo the popover's own centring on the viewport.
1160
+ */
1161
+ [aria-haspopup='menu'][aria-expanded='true'] {
1162
+ anchor-name: --menu;
1163
+ }
1164
+
1155
1165
  .menu {
1156
- position: absolute;
1157
- top: 34px;
1158
- right: 10px;
1159
- z-index: 5;
1166
+ position: fixed;
1167
+ position-anchor: --menu;
1168
+ inset: auto;
1169
+ top: anchor(bottom);
1170
+ right: anchor(right);
1171
+ margin: 4px 0;
1172
+ /* Above the button instead, when the window has no room left below it. */
1173
+ position-try-fallbacks: flip-block;
1160
1174
  /* Wide enough that the date field below still shows its own placeholder. */
1161
1175
  min-width: 204px;
1162
1176
  padding: 5px;
1177
+ color: var(--ink-2);
1163
1178
  background: var(--surface);
1164
1179
  border: 1px solid var(--border);
1165
1180
  border-radius: var(--radius-sm);
@@ -1636,10 +1651,11 @@ body[data-view='settings'] .layout {
1636
1651
  * line up with the other tabs' however wide the display is. The 460px floor is
1637
1652
  * what drops it to one column on a narrow window rather than squeezing two.
1638
1653
  *
1639
- * The abspos worry that picked the grid does not apply: `.item` is
1640
- * `position: relative`, so `.item__actions` and the snooze `.menu` resolve
1641
- * against the card and travel with it into its column. Only a child resolving
1642
- * against the multicol container itself would land beside the wrong row.
1654
+ * An absolutely positioned child is still fragmented by the columns, and counts
1655
+ * toward balancing them. `.item__actions` stays inside its card, so it travels
1656
+ * with the card into its column and nothing notices. Anything that hangs below a
1657
+ * card must not be in here at all: the row menus once were, and were split
1658
+ * across both columns and pushed the next section down. They are popovers now.
1643
1659
  */
1644
1660
  #tickets .list {
1645
1661
  display: block;
@@ -1836,14 +1852,13 @@ body[data-view='settings'] .layout {
1836
1852
  }
1837
1853
 
1838
1854
  /*
1839
- * Anchored to the gutter rather than the card's right edge, unlike the park
1840
- * menu: it belongs to the pill that opened it, and the two menus must not be
1841
- * able to appear in the same place.
1855
+ * Hung from the pill's left edge, where the park menu hangs from its button's
1856
+ * right: the pill sits in the card's left gutter, so each menu opens toward the
1857
+ * middle of its own card.
1842
1858
  */
1843
1859
  .menu--status {
1844
- top: 26px;
1845
1860
  right: auto;
1846
- left: 0;
1861
+ left: anchor(left);
1847
1862
  min-width: 9rem;
1848
1863
  }
1849
1864