* Fix more menu focus issue when focused with no hover.
* Use a js based solution for focus
* Return focus to the menu trigger when closing the menu with Escape
Keep the keyboard-focus marker set while a row/section-header menu is open
(focus is then in the portaled popover, outside the element). This keeps the
trigger revealed so the menu's own focus restoration lands on it when closed
with Escape, instead of dropping to <body>.
* test: cover keyboard-focus reveal of the room list hover menus
Adds unit tests that focus a room row / section header via the keyboard
(:focus-visible on mount) and assert the hover menu is revealed, then cleared
when focus leaves. Brings diff coverage of the focus handlers to 100%.
* Move ToastContext and utilities to shared components
* lint
* fix type
* cleanup
* fix broken test
* fix lint
* Add more tests for ToastContext
* Potential fix for pull request finding 'Unused variable, import, function or class'
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
---------
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
* Mock out window.addEventListener globally
As some code uses it
* Move to setupGlobals
* clean up import
* Only needed if we don't have happy-dom
* thank you!
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* feat:add missing methods to rls V3
* feat: use rls v3 methods instead of old alrgorithms
* feat: move stabel function to own utils
* feat: use this new moved functions
* test: cleaner test
* Don't re-export MainSplitContentType enum
I don't see why this was necessary, importing RoomView pulls in all sort
of stuff, whereas RoomContext is much smaller.
* ts, not tsx
* unintentional change
* Forward the scroller element and scroll handle through VirtualizedList
The room list needs two things the generic list did not expose: the underlying
scroll container (to observe which items are genuinely visible) and the imperative
scroll handle (to scroll an item into view). Forward an optional scrollerRef from
useVirtualizedList and pass scrollHandleRef through FlatVirtualizedList, mirroring
what GroupedVirtualizedList already exposes. Both are additive and optional, so other
consumers are unaffected.
Signed-off-by: David Langley <langley.dave@gmail.com>
* Add an unread-activity toast to the room list
Show a clickable "You have unread activity" pill when there are unread rooms
scrolled below the visible fold, including unreads hidden inside collapsed sections
whose header is below the fold. Clicking it scrolls the next such unread into view.
The visible fold is tracked with an IntersectionObserver over the rendered item
elements, so the toast appears as soon as a room crosses the fold rather than only
once it leaves Virtuoso's overscan buffer. The toast click is wired through an
imperative scroll handle the view registers with the view model.
Signed-off-by: David Langley <langley.dave@gmail.com>
* Change toast to target notifications only, not unread activity.
* Fix formatting and refresh Toast snapshots for compound-web 9.7.0
- Apply oxfmt to the room list view model and virtualized view.
- Refresh the RoomListToast/RoomListView story snapshots: compound-web
9.7.0 moves the typography classes onto the toast .content element and
rebuilds the Toast CSS module hashes.
- Add the missing UnreadActivityToast render snapshot baseline.
* Add e2e tests for the room list unread activity toast
Cover the unread-activity toast end to end:
- it appears for a notifying room scrolled below the fold and clicking it
scrolls that room into view (then the toast clears);
- a room with only an unread-activity dot (no notification count) does not
raise it;
- a collapsed section hiding a notifying room raises it, and clicking
scrolls the section header into view.
* Add visual snapshot baselines for the unread-activity toast stories
* Converge room-list toast codepaths into a single state-driven toast
Reviewer feedback: the unread-activity toast and the transient event toasts
(section_created / chat_moved) should share one mechanism, with toast
lifecycle and precedence owned by the view model rather than split across a
separate snapshot flag and a view-level ternary.
- RoomListViewModel now reconciles the transient event toast and the derived
unread-activity state into a single snapshot.toast via recomputeToast(); the
event toast still takes precedence and auto-dismisses, and the unread toast
reappears once it clears. Drops hasUnreadActivityBelow from the snapshot.
- RoomListView renders a single RoomListToast driven by snapshot.toast; the
ToastType union gains 'unread_activity'. The standalone UnreadActivityToast
component is folded into RoomListToast (clickable arrow-down variant).
- Adds VM tests for the unread-activity toast and the event/unread precedence.
* Pre-bundle the room-list dnd-kit + virtuoso graph in vitest browser mode
The room-list suites (RoomListView, VirtualizedRoomListView,
RoomListItemMoreOptionsMenu) import a heavy @dnd-kit + react-virtuoso graph.
Only @dnd-kit/abstract was pinned in optimizeDeps.include; @dnd-kit/dom,
@dnd-kit/react, @dnd-kit/abstract/modifiers and react-virtuoso were left to
runtime discovery. Under CI load the browser-mode dep optimizer can discover
them late, re-bundle and reload the page, which fails the in-flight
setupTests.ts import for those suites. Pinning the whole graph forces it into
the initial optimize pass so no re-run happens while tests load.
---------
Signed-off-by: David Langley <langley.dave@gmail.com>
* Update to compound-web 9.7.0
* Update snapshots for compound-web 9.7.0 toast markup
The 9.7.0 Toast moves typography classes from .toast-container to .content
and rebuilds CSS-module hashes, so the RoomListToast unit snapshots, the
storybook visual baselines, and the room-list e2e screenshots needed
regenerating.
* Update blurhash screenshot
* Revert "Update blurhash screenshot"
This reverts commit 6eacecc1ed.
* feat(rls): centralize room-list section ordering via getOrderedSections
Introduce a single source of truth for the ordered list of section
tags (defaults + custom) in section.ts. RoomListStoreV3 no longer
hard-codes the default tag order — it asks section.ts.
* feat(vm): add section reorder logic to RoomListStoreV3 and view model
* refactor(sc): extract RoomListSectionHeaderContent from RoomListSectionHeaderView
* feat(sc): add drag-and-drop reordering for room-list sections
* test(sc): update existing tests
* test: add new tests
* test(sc): add snapshot test for overlay
* test(e2e): add playright test for dnd of sections
* feat: tweak opacity
* fix: section detection when dragged
* feat: use relative position in section order
* chore: move style to room list section header view
* test: add e2e test for moving section before another
* feat: make favourite and low priority no draggable
* test: remove deprecated e2e test
* fix: type correctly dnd provider and hooks
* fix: use String instead of casting to string
* fix: wrong a11y attributes on section header
* test: fix keyboard navigation e2e tests
* feat: use custom a11y announcement for dnd
* fix: add aria-hidden to the overlay
* chore: remove duplicated code in a11Y announcement
* fix: increase keyboard drag offset
* fix: tests
* fix: virtuoso computed item key
* fix: aria-expanded double annoncement why dragging
* fix: re-add screen reader instructions
* chore: remove unused import
* fix: reduce keyboard drag offset
* fix: improve text readback on unread section
* feat: use a custom a11y plugin instead of buitin a11y plugin
* chore: formatting
* test: fix incorrect tests
* chore: use randomUUID
* fix: try to make test working
* fix: put back mock
* fix: circular import
* Revert "fix: circular import"
This reverts commit 6c69313ade.
* chore: add @dnd-kit/abstract to optimizeDeps.include
* test: fix e2e tests
* fix: disable interaction with section when dragging
* fix: be more explicit if the section will be dropped before or after
* fix: add info that space is dropping too
* fix: scroll to dropped section
* test: fix virtualized room list test
* chore: update lang
* chore: fix dead code analyze
* test: add provider section story
* fix: lang
* fix: again lang...
* fix: improve voice over on chrome
* test: upate snapshot
* fix: add readback when a section is over a non droppable element
* Use real interface type for SynapseConfig
* Reconfigure for Synapse retention config
* Add beforeEach
* fix import
* lint lint
* fix number type
* fix
* cleanup
* formatted
This rejectToast was added erroneously: as the comment above states,
there should be no toast left after we verify (apart from our old
friend the notifications nag toast). This was probably flaking because
it was racing to reject the toast before it vanished.
* Fix long display / user names in UserMenu
And add a playwright test to assert (see playwright screenshot for
after photo).
* Dave installs the oxfmt extension
* snapshots
* Replace override raw-loader with `?raw` query
For compatibility with vite/st
* Make knip happy
* Fix icon in Jitsi lobby
* Fix jest config for `?raw`
* Remove stale `$webapp` alias
* Ensure css files loaded as `?raw` do not get bundled
* Fix desktop registering protocol handler wrong
Was previously registering with too many args and was also only handling deeplinks if the app was already open, on a cold start they would be blindly ignored.
Tests aplenty
* Refactor Desktop config to avoid global
and centralise defaults
* Improve coverage
* Fix tests
* Improve coverage
* Fix test
* Rename field
* Improve coverage
* Rename field
* Move protocolHandler initialisation to after mainWindow is navigating
* Add comment
* Avoid double call to loadURL
* Improve coverage
* Improve coverage
* Fix tsc
* Fix desktop registering protocol handler wrong
Was previously registering with too many args and was also only handling deeplinks if the app was already open, on a cold start they would be blindly ignored.
Tests aplenty
* Rename field
* Move protocolHandler initialisation to after mainWindow is navigating
* Add comment
* Avoid double call to loadURL