* Tweak CSS bundling to dedupe more styles
Previously all of compound-web & compound-design-tokens were duplicated amongst all the themes rather than just being in `bundle.css`.
* Fix highlight.js & github-markdown-css dark/light
* Fix highlight.js & github-markdown-css dark/light
* Iterate
* Add functionality to UIStore
- Make it possible to query if the window is currently being resized
- Emit WidthIncreased/WidthDecreased events
* Change resize behaviour of panel
So that the panel does not become smaller when the window is resized.
This is consistent with the old room-list design.
* Introduce a `CollapseHandler` object
This should be used by the collapse behaviours to collapse/expand the
panel. There's a good reason to not have the behaviours depend directly
on the react-resizable-panels API methods: We dont want the collapse/expand
calls to conflict with each other. See the comments in the code for more
information.
* Introduce a base class for collapse behaviour logic
Behaviours should extend this class to describe when the panel should
automatically collapse and expand.
* Add the window resize collapse behaviour
* Create a central file from which to export all behaviours
* Add a class to orchestrate the collapse behaviours
ResizerViewModel will only have a dependency on this class.
* Collapse panel on app start if necessary
For eg, if the app is started with a small window width, the panel should be
collapsed.
* Wire auto collapse code into the viewmodel
* Write jest tests
* Fix e2e tests
* Fix lint error
* Fix e2e test failures
* Expand the panel before taking screenshot
Fixes incorrect narrow screenshots in RTE.spec.ts and CIDER.spec.ts
* Make comments consistent
* Move tests from jest to vitest
* Fix lint errors
* Improve comment
* Remove variable
* Remove mock
* Fix comment formatting
* Support for reading m.call status
(well, the prefixed version)
* Abstract the details away in userStatusFromProfile
make the validate functions non-exported
* Write on on-=a-call status
* Add tests
* Move user call status logic to its own listener
* Move tests
* use vi rather than jest
* add more mocks
* call async
* Widen the macOS title-bar drag strips so the window is easy to move
With titleBarStyle: "hidden" there is no native title bar, so the macOS window can only be
moved via the -webkit-app-region: drag strips above the room and left-panel headers. Those
strips were only ~13-24px tall and too thin to reliably grab, making the window awkward to
move.
Raise the drag strips above the room, left-panel and space headers to 32px (matching the
traffic-light offset already used elsewhere in the file) for a comfortable grab zone;
interactive controls keep -webkit-app-region: no-drag so they stay clickable. The injected CSS
is also extracted into a pure buildTitleBarCss() helper so the string contract can be
unit-tested.
* Address review: use author copyright, cover setupMacosTitleBar, drop dead selector
Use my own copyright on the new test file rather than New Vector's.
Add tests for setupMacosTitleBar() itself: the platform guard and the
enter-full-screen / leave-full-screen / did-finish-load lifecycle were
previously never executed, leaving the diff below the 80% coverage gate.
Drop the .mx_LeftPanel_newRoomList::before rule: #34040 removed that class
from the product, so the rule matched nothing and the border-right it carried
was silently lost from the left panel. Fold it back into .mx_LeftPanel::before,
with a regression test covering the separator.
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Warn when an encrypted search runs before the index has finished building
When a search runs in an encrypted room while the local Seshat index is still
crawling not-yet-indexed history, results can silently come back partial.
SearchWarning now subscribes to the event index's changedCheckpoint progress and
shows a polite (role=status) notice while the crawl is in progress, clearing
automatically the moment indexing finishes.
* Scope the partial-index warning to the room being searched
The warning was driven by `currentRoom() !== null`, which is a global signal:
it is non-null while the crawler has any outstanding checkpoint for any room.
Searching a fully-crawled room while an unrelated room was still being crawled
therefore claimed the results may be incomplete when they were not.
Drive it from `crawlingRooms()` instead, which reports the rooms with
outstanding checkpoints by id, and pass the search scope and room id in from
RoomSearchAuxPanel: a room-scoped search now asks only about that room, while
an all-rooms search still reacts to any outstanding checkpoint. Using room ids
throughout also avoids `currentRoom()` returning null, and so under-reporting a
crawl, when the js-sdk does not know the room at the head of the queue.
The `changedCheckpoint` payload only carries the globally-current room and
cannot answer a per-room question, so the handler re-reads the checkpoint set.
* Also warn when the searched room has not been indexed at all
The crawl set cannot see a room that has no checkpoint: before the initial
checkpoints have been seeded, such a room is absent from it and looks identical
to one that has been fully crawled. That is the case issue #32253 describes, so
ask isRoomIndexed() as well, and warn when the index holds no events for the
room being searched.
Only ask it while the crawler still has work outstanding. That is what the
warning claims, and the index has no event for its contents changing --
changedCheckpoint fires on checkpoint transitions only, and an idle crawler is
silent -- so a warning raised once the crawler had drained would never be
re-evaluated and would stick.
Rename the hook to useIsIndexIncomplete, as it no longer answers the narrower
question of whether a crawl is in progress. Re-seed it from the checkpoint set
on each scope or room change so that the previous search's answer is not left
on screen while the lookup is in flight, but not on each checkpoint change,
which would blink an already-earned warning off and on again.
Also reword the crawlingRooms() doc, which described the set as the rooms being
crawled when it holds every queued checkpoint too.
---------
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Make the text copy button use IconButton
This obviously should be a shared component, but design is looking at
what it will actually look like long term, so until then, let's at
least make it use compound's IconButton so it gets the hover background
state, and sort out the padding & margins.
Requires https://github.com/element-hq/compound-web/pull/528
* snapshots & add aria-label
* more snapshots
* Remove unnecessary width & height
update other screenshots with expected changes
* One more screenshot
* This really shouldn't be necessary: see what test fails
* Fix test to look in screen for the labels
Because the labels from the tooltip don't go in the container, they
get added to the dom at the top level in a floaty bit.
* update snapshots again
* Fix button size
and also add comment to the other place where we fudge the padding
* Update snapshots
* Align to center
* Screenshots
* use url preview bundle preview content in timeline
* fixed linting errors
* claude wrote a test!
* moved reading settings from the view model into the component
* claude wrote more tests
* applied reviews
* Support for reading m.call status
(well, the prefixed version)
* Abstract the details away in userStatusFromProfile
make the validate functions non-exported
* Add test
* format the oxen
* Remove set function
should be in the other PR
* Conform to oxlint rule jsx-a11y/role-has-required-aria-props
* Conform to oxlint rule jsx-a11y/role-supports-aria-props
* Conform to oxlint rule jsx-a11y/interactive-supports-focus
* Conform to oxlint rule jsx-a11y/click-events-have-key-events
* Update snapshots
Both the tooltip ("Video call") and the aria-label attribute ("Join video call") were trying to set different labels. I propose that the "Video call" tooltip should actually count as a description.
* Move more tests over to vitest
* Add exception for test_setting
* Update find-unused-settings script
To not consider usage in tests as real usage
* Remove legacy font settings
They have been being migrated for over 2 years at this point and are flagged by the script as unused
* Re-add test
* Make the persistent-storage request observable and warn when it is denied
The end-to-end encryption crypto store lives in IndexedDB. If the origin's storage is not
durable, Chromium can evict it under storage pressure, forcing a logout and recovery-key
re-entry. tryPersistStorage() requested navigator.storage.persist() but only logged the
boolean result, so a denial was invisible.
Make the request observable: it is now async and checks persisted() first (short-circuiting
to avoid re-requesting/re-prompting), a failure to query the state no longer blocks the
request, and a denial warns via the logger (captured by rageshakes) with a stronger
desktop-specific message. It never rejects - the sole caller treats it as fire-and-forget.
This makes the risk observable but cannot by itself guarantee durability: no Electron
main-process API can force per-origin persistence, so a complete cure needs a follow-up.
* Address review: log query errors, drop the requestStorageAccess fallback and the desktop-specific warning
- Include the caught error when the persisted-state query fails.
- Remove the document.requestStorageAccess branch: it is the Storage Access
API (cross-site cookie/storage access), not durability, and all supported
browsers (Safari >= 15.2 included) have navigator.storage.persist().
- Drop the desktop-specific suffix from the denial warning.
- Reword the fire-and-forget doc to avoid referencing the caller.
- Simplify the test harness: no descriptor save/restore, delete the stub in
afterEach.
* Space the collapsed space panel separator away from the macOS traffic lights
On macOS the frameless window draws the traffic light buttons over the top
of the space panel. The cluster is inset 9px and is roughly 52px wide, so it
ends about 61px from the window edge. The collapsed space panel is 68px wide,
which left its right-hand separator crowding the green button.
Widen the collapsed panel to 76px on macOS so the separator gets about 15px
of clearance, in line with the compound 4x spacing step. The rule is added to
the styling already injected for the macOS title bar, so it only affects the
desktop app on macOS and is removed in full screen along with the rest.
Fixes https://github.com/element-hq/element-web/issues/32012
Notes: Fix the collapsed space panel separator sitting too close to the macOS traffic light buttons.
* Use contributor copyright header on the new test file