as we're approaching from the last node, if we're scrolled up,
the first node we encounter would be below the bottom of the viewport
change the logic to stop at the first node that has its top
above the viewport bottom.
When completely scrolled up, this was causing nodes way below
the viewport to be selected as the reference for the pixelOffset,
and when pagination came in, it would immediately try to apply
the big negative pixelOffset, scrolling to a negative scrollTop,
thus going to the top again, and triggering another pagination,
entering in an infinite pagination loop until you scrolled down.
this is not nearly as smooth as using ResizeObserver, as the
callback rate is a lot lower, but seems to be quite a bit better
than what we have right now, without the 7% cpu hog that
the requestAnimationFrame polling fallback has.
before we would clear it as soon as you were 1px away from
the bottom of the timeline, which would still create jumping as
the whitespace would around 36px. To play it safe, we only clear it
after moving 200px from the bottom.
Also include "local echo" scroll events, caused by setting scrollTop
The fallthrough for `notifier_enabled` caused a NPE on `payload.error`, so this moves the fallthrough to where it is intended and sanity checks `payload.error` for next time.
The initial phase of registration can differ by the default server type. In
particular, the Matrix.org HS type wants to skip to the registration form.
Fixes https://github.com/vector-im/riot-web/issues/8862
`enableRichText` would convert the editor state between rich and md versions
explicitly, but then it would also call `createEditorState`, which can do the
same thing.
This removes the duplication, and also supplies the right arguments to
`createEditorState` so it can do its work correctly.
The step that would notify parent components of rich text state changes was
stirred into the input's change handler, which leads to race which the parent is
sometimes notified of the old rich text state instead of the new.
Here we avoid this complication by using a separate path for sending the rich
text state when we know we have updated it correctly.
`AccessibleButton` expects click handlers, which we can use here, as long we
make some additional changes to avoid race processing the new state (see
subsequent patch).
Fixes https://github.com/vector-im/riot-web/issues/8866
The sample config.json in riot-web has "roomDirectory.servers" and not "servers".
Are other systems than riot-web use "servers" without "roomDirectory" ? Then this would break these.
Fixes an issue discovered after fixing the toggle - The SdkConfig in onEnableEmailNotificationsChange ends up being undefined if the import is left as-is.
If Riot has been configured with a `default_hs_url` (or `default_server_name`,
which then sets a default HS URL), then skip the server details on registration
by default.
Fixes https://github.com/vector-im/riot-web/issues/8840
This passes the validity state of all fields to the consumer of
`RegistrationForm` via the `onValdiationChange` callback, instead of just the
most recent error.
In addition, we notify the consumer for any validation change, whether success
or failure. This allows old validation messages to be properly cleared. It also
allows the consumer to be aware of multiple validation errors and display the
next one after you have fixed the first.
Fixes https://github.com/vector-im/riot-web/issues/8769
Now that auth flows can show a server name like `example.com` which might
delegate the HS to some other server, it could be confusing to see text like
"Sign in to example.com", especially if `example.com` runs an identity service,
uses SSO, has its own account system, or other things like this.
To clarify that we mean Matrix accounts, all auth flows are updated to talk in
terms of "<verb> your Matrix account on <server>".
Fixes part of
https://github.com/vector-im/riot-web/issues/8763#issuecomment-464823909.
If a default server name is set and the current HS URL is the default HS URL,
we'll display that name in the "your account" text on the forgot password form.
This can be a bit more user friendly, especially when the HS is delegated to
somewhere such as Modular, since you'll then see "example.com" instead of
"example.modular.im", which you have no direct relationship with as a user.
This is the key bit of https://github.com/vector-im/riot-web/issues/8763 for
forgot password.
If a default server name is set and the current HS URL is the default HS URL,
we'll display that name in the "sign in to" text on the login form.
This can be a bit more user friendly, especially when the HS is delegated to
somewhere such as Modular, since you'll then see "example.com" instead of
"example.modular.im", which you have no direct relationship with as a user.
This is the key bit of https://github.com/vector-im/riot-web/issues/8763 for
login.
Multi-line commits aren't actually formatted correctly, and most likely the
first line is enough of a summary anyway, so this change trims to the first
line. The commits are linked, so you can click through if you want more detail.
Fixes https://github.com/vector-im/riot-web/issues/8285
If a default server name is set and the current HS URL is the default HS URL,
we'll display that name in the "your account" text on the registration form.
This can be a bit more user friendly, especially when the HS is delegated to
somewhere such as Modular, since you'll then see "example.com" instead of
"example.modular.im", which you have no direct relationship with as a user.
This is the key bit of https://github.com/vector-im/riot-web/issues/8763 for
registration.
Adds a UserView that contains a MainSplit with an empty div
and a RightPanel, preset to the given member.
UserView fetches the profile and creates a fake member, which
it passed on to the RightPanel.
this doesn't use the view_user action on purpose, to avoid any
interference of the UserView when trying to view a room member.
`ServerTypeSelector` would call its `onChange` prop both at construction
(because it computed the default selected type and consumers might want to know)
as well as on actual user change. This ended up complicating consumer code, as
they want to differentiate between initial state and changes made by the user.
To simplify things, `ServerTypeSelector` now exports a function to compute the
server type from HS URL, which can be useful for setting its initially selected
type. The consumer now provides that type via a prop, and `onChange` is now only
called for actual user changes, simplifying the logic in `Registration` which
uses `ServerTypeSelector`.
In addition, some usages of `customHsUrl` vs. `defaultHsUrl` in `Registration`
are simplified to be `customHsUrl` only (since it already includes a fallback to
the default URL in `MatrixChat`).
Tjis is quite confusing as the welcome page is designed for when
you're not logged in, ie. has a sign-in button. There's also no way
to get back into the app so it really looks like it's logged you
out.
Reverts 116367fd69
as not all state that goes into rendering comes from state or props,
we shouldn't be blocking rendering at all
This might rerender a few times more, but it shouldn't be worse
than what was there before the redesigned roomlist.