Riley Crane
e505e54610
fix(desktop): restore focus to the invoking card, not the first URL match
...
The panel-close focus restore located the opener card by document URL
alone, but the same attachment can appear in several messages — several
cards, one URL — so querySelector always returned the first DOM match
and closing a panel opened from a later duplicate focused the wrong
card.
FileCard now passes the clicked element through the open call, and the
channel pane opener records it as its DOM-order index among the cards
sharing that URL — a per-invocation identity that survives the
narrow-layout unmount/remount where an element reference cannot. The
restore consumes the record (deep-link/reload opens fall back to the
first match, as before), clamps when the recorded card is gone, and
still yields to any control that already claimed focus.
Covered by a JSDOM unit suite for the record/restore contract and a
duplicate-URL narrow-layout keyboard e2e.
Signed-off-by: Riley Crane <rileycrane@squareup.com >
Co-authored-by: Fizz <d4ec90109b43092b0ec94cf136850915a3732a29ab3089a1dec43d2ed43dd6eb@buzz.block.builderlab.xyz >
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com >
2026-08-25 13:30:51 -07:00
..
2026-07-22 13:24:46 -07:00
2026-07-30 11:25:08 -07:00
2026-08-13 14:49:40 -07:00
2026-08-21 16:53:50 -07:00
2026-07-03 15:40:29 +00:00
2026-07-30 12:34:35 -07:00
2026-08-05 11:56:14 -07:00
2026-08-17 09:51:00 -07:00
2026-07-08 18:18:44 -04:00
2026-07-24 01:23:31 +01:00
2026-08-03 18:09:24 -04:00
2026-07-24 01:23:31 +01:00
2026-08-07 16:25:49 -07:00
2026-07-28 15:01:03 -04:00
2026-07-22 13:24:46 -07:00
2026-08-18 15:24:09 -07:00
2026-08-10 14:33:23 -07:00
2026-08-19 14:32:17 -07:00
2026-08-24 11:48:48 -04:00
2026-07-14 11:11:02 -07:00
2026-08-21 17:21:36 -07:00
2026-08-24 16:28:51 -07:00
2026-07-16 18:01:53 +00:00
2026-07-20 14:44:08 -07:00
2026-07-27 15:47:04 -07:00
2026-08-12 08:25:04 -07:00
2026-07-04 11:51:58 -04:00
2026-08-24 10:11:07 -04:00
2026-08-11 10:25:23 -07:00
2026-06-29 06:42:31 -07:00
2026-08-20 17:31:39 -06:00
2026-06-25 09:25:34 -07:00
2026-07-04 11:51:58 -04:00
2026-08-24 09:18:29 -06:00
2026-06-26 18:09:07 +00:00
2026-08-18 12:55:00 -07:00
2026-08-05 15:16:32 -07:00
2026-08-07 10:56:08 -07:00
2026-08-24 09:39:55 -06:00
2026-08-18 12:55:00 -07:00
2026-08-14 16:29:50 +01:00
2026-07-11 13:40:16 -04:00
2026-07-14 11:11:02 -07:00
2026-08-24 16:28:51 -07:00
2026-08-07 09:21:29 -07:00
2026-08-21 09:17:04 -06:00
2026-08-13 14:49:40 -07:00
2026-07-14 16:50:22 +01:00
2026-07-19 19:01:38 +00:00
2026-08-14 16:25:40 +01:00
2026-07-28 19:37:12 +01:00
2026-07-27 16:45:34 -04:00
2026-08-03 12:08:29 -04:00
2026-08-07 16:25:49 -07:00
2026-08-21 18:20:19 -06:00
2026-08-24 20:45:42 -07:00
2026-08-11 09:51:42 -07:00
2026-08-13 14:49:40 -07:00
2026-08-11 10:25:23 -07:00
2026-07-27 11:01:42 -07:00
2026-07-30 20:58:03 -04:00
2026-07-20 00:53:53 +02:00
2026-07-24 19:30:33 -07:00
2026-08-24 16:13:03 -04:00
2026-08-13 19:42:54 -04:00
2026-07-06 06:55:58 -07:00
2026-07-20 08:58:48 -07:00
2026-08-12 08:25:04 -07:00
2026-07-27 09:47:02 -07:00
2026-08-06 11:47:18 -07:00
2026-08-25 11:34:16 -07:00
2026-08-14 17:16:28 +01:00
2026-07-18 00:01:24 +00:00
2026-08-24 16:28:51 -07:00
2026-08-21 17:21:36 -07:00
2026-08-07 16:25:49 -07:00
2026-08-20 15:20:24 -04:00
2026-08-04 10:39:09 -07:00
2026-08-04 10:39:09 -07:00
2026-07-18 15:45:41 +00:00
2026-07-04 11:51:58 -04:00
2026-07-06 17:41:56 -04:00
2026-08-25 13:30:51 -07:00
2026-07-08 14:38:52 -07:00
2026-08-25 18:44:25 +00:00
2026-08-03 14:12:21 -07:00
2026-08-24 16:28:51 -07:00
2026-07-30 07:46:56 -07:00
2026-08-24 13:06:00 -07:00
2026-08-18 15:24:09 -07:00
2026-08-24 14:55:05 -07:00
2026-08-06 08:21:35 -07:00
2026-07-16 12:44:14 -07:00
2026-08-19 14:20:58 -04:00
2026-07-24 12:10:09 -04:00
2026-08-20 19:01:18 -07:00
2026-08-10 14:33:23 -07:00
2026-08-06 17:13:55 -07:00
2026-08-10 14:33:23 -07:00
2026-08-19 12:50:00 +01:00
2026-08-03 21:51:17 -04:00
2026-07-04 11:51:58 -04:00
2026-08-25 18:44:25 +00:00
2026-08-07 16:25:49 -07:00
2026-08-07 16:25:49 -07:00
2026-07-28 15:01:03 -04:00
2026-07-03 15:40:29 +00:00
2026-07-30 11:15:39 -07:00
2026-06-11 15:06:24 +00:00
2026-07-12 18:46:02 -04:00
2026-08-21 22:04:53 -07:00
2026-08-21 05:45:55 -07:00
2026-08-24 16:13:03 -04:00
2026-08-20 07:42:02 -07:00
2026-08-21 05:45:55 -07:00
2026-08-21 05:45:55 -07:00
2026-08-21 05:45:55 -07:00
2026-08-12 08:25:04 -07:00
2026-08-03 14:09:46 -07:00
2026-08-24 16:28:51 -07:00
2026-07-02 19:30:24 +00:00
2026-06-25 09:25:34 -07:00
2026-08-24 10:11:07 -04:00
2026-07-30 11:25:08 -07:00
2026-08-13 14:49:40 -07:00
2026-07-15 07:34:50 -07:00
2026-07-27 16:45:34 -04:00
2026-08-11 11:11:57 -07:00
2026-06-18 20:40:05 -04:00
2026-07-06 13:58:15 -04:00
2026-08-11 11:11:57 -07:00
2026-08-25 18:44:25 +00:00
2026-08-14 16:25:40 +01:00
2026-06-29 09:18:16 -07:00
2026-08-18 12:54:40 -07:00
2026-07-29 15:48:06 -04:00
2026-08-12 14:23:41 -07:00
2026-08-21 05:45:55 -07:00
2026-07-30 20:58:03 -04:00
2026-07-30 15:47:35 -07:00
2026-08-25 16:22:12 +00:00
2026-08-05 15:16:32 -07:00
2026-08-11 19:47:19 -04:00
2026-07-15 18:39:39 -04:00
2026-07-28 15:01:03 -04:00
2026-08-19 12:50:00 +01:00
2026-08-06 15:04:39 +00:00
2026-08-24 16:13:03 -04:00
2026-06-27 06:27:51 -07:00
2026-08-03 09:26:06 -07:00
2026-08-05 15:40:40 -07:00
2026-07-25 16:49:56 -07:00
2026-08-21 07:07:36 -04:00
2026-08-21 17:21:36 -07:00
2026-07-18 00:01:24 +00:00
2026-08-04 15:39:45 +00:00
2026-08-14 17:16:28 +01:00
2026-08-19 12:50:00 +01:00
2026-07-31 11:15:09 -04:00
2026-07-08 14:38:52 -07:00
2026-08-07 17:03:16 +01:00
2026-08-07 16:25:49 -07:00
2026-08-24 17:40:23 -07:00
2026-08-21 16:53:50 -07:00
2026-08-21 16:53:50 -07:00
2026-08-21 16:53:50 -07:00