Commit Graph
5 Commits
Author SHA1 Message Date
ba5eb6b463 Let a click on the separator wander a little before it counts as a drag (#34580)
The separator has to tell a click apart from a drag, because dragging it
also ends in a click, and it did so by treating any pointer movement at all
between press and release as a drag. A pointer rarely holds perfectly
still, least of all on a trackpad, so clicking the separator to open the
room list often did nothing and had to be tried again.

Movement is now measured from where the pointer went down and only counts
as a drag past a few pixels, which means the handlers need the pointer
position and the separator passes its events through to get it. Movement
with nothing held down is ignored too: those events fire on hover, and one
of them used to spend the click that came after it.

Tests: a click that wanders a couple of pixels still opens the panel, as
does one that follows moving across the separator, while a real drag is
still no click.

Co-authored-by: R Midhun Suresh <hi@midhun.dev>
2026-08-07 10:18:55 +00:00
R Midhun SureshandGitHub 01640bb8d6 Remove code to round newSize on resize (#34543)
This never actually fixed the issue of the call elements being blurry
due to fractional pixels. But it also causes other issues like the
max/min width of the left panel never being persisted in settings.
2026-08-05 10:13:38 +00:00
R Midhun SureshandGitHub 67206624a0 Auto Collapse Behaviour - Collapse left panel during calls (#33771)
* Add call resize behaviour

* Export behaviour from behaviours.ts

* Fix e2e tests

* Fix lint

* Move test to vitest

* Pass call-store instead of global access

* Fix broken collapse behaviour on strict mode

* Remove unused variable from test
2026-07-24 12:45:34 +00:00
R Midhun SureshandGitHub 3bff251010 Auto Collapse Behaviour - Collapse left panel on window resize (#32964)
* 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
2026-07-21 16:37:28 +00:00
Michael TelatynskiandGitHub b719f531dd Migrate more tests to vitest (#34349) 2026-07-20 13:07:35 +00:00