Very similar to password resets and registration, the components pass around a server config for usage by other components. Login is a bit more complicated and needs a few more changes to pull the logic out to a more generic layer.
All `Room.timeline*` handlers must currently test for `room` first if they
expect it to exist. It is emitted not only for rooms, but also for timeline sets
without rooms, such as for notifications.
Almost all such handlers were correctly testing as needed, but it was missing
from `RoomBreadcrumbs`.
While that's quite confusing, we can start by testing for `room` when we expect
to have one.
Fixes https://github.com/vector-im/riot-web/issues/9630
This allows you to increment an existing reaction below a message by clicking on
it.
At the moment, this is not linked to the action bar, so they each are using
local state. We'll likely want to add some mechanism so that we can local echo
to both of these UI areas at the same time, but that can be done separately.
Fixes https://github.com/vector-im/riot-web/issues/9486
This displays the existing reactions a message has from all users below the
message.
Since we don't currently have an API to actually get these events yet,
adds a temporary hook that looks for a specific message to inject some sample
data. This helps build out the UI for now and can be removed once it exists.
Fixes https://github.com/vector-im/riot-web/issues/9573
Concludes https://github.com/vector-im/riot-web/issues/8593
We are no longer seeing this error being triggered, and are considering it fixed. As a result, the dialog can be removed to reduce the amount of dead code in the project.
This adds the primary reactions to the action bar. They act as toggles where you
can only select one from each group at a time.
Note that currently we aren't actually sending the reaction at all. That's left
for a separate task.
Fixes https://github.com/vector-im/riot-web/issues/9576
This removes the clickable inviter behaviour, as it was too confusing to reveal
the user info sidebar and also hide the invite. Keeping both on screen would be
okay, but seems a bit too complex to resolve right before RC.
In addition, this adds the full inviter MXID to ensure it's clear who invited
you.
This applies the new design for multiple buttons in the message action bar,
paving the way for more things to appear here.
In addition, this changes the existing options button to use the three vertical
dots icon. Some theme colors are also tweaked to align with what they were meant
to be from the unified palette.
This adds a new action bar component to hold multiple per-message actions. This
existing options button has moved to this new component, and is currently the
only action.
This naming is clearer as it doesn't really edit at all (it shows a context
menu). This should also be less confusing with actual editing when it arrives.
Now that we have a fancier password complexity check, remove the older minimum
length to avoid the feeling of two password style guides fighting each other.
This adds a password complexity rule during registration to require strong
passwords. This is based on the `zxcvbn` module that we already use for key
backup passphrases.
In addition, this also tweaks validation more generally to allow rules to be
async functions.
In addition to migrating password fields, this also removes the remaining
support for old-style validation in registration now that all checks have been
converted.
When submitting a form, we want to validate more strictly to check for empty
values that might be required. A separate mode is used since we want to ignore
this issue when visiting a field one by one to enter data.
As an example, we convert the pre-existing logic for the username requirement
using this new support.
Since we're keeping the input as a ref anyway, let's use that rather than
requiring the value to be passed to `validate`. This allows others to call
`validate` as well.
This adjusts the submission step to focus the first invalid field and redisplay
validation. This also rearranges the older style field error handling on
registration which is slated for removal once we convert all fields to the new
style.
This updates the registration form to include the new-style validation state
when deciding whether the entire form is valid overall.
In addition, this tweaks the validation helper to take functions instead of
strings for translated text. This allows the validation helper to be create once
per component instead of once every render, which improves performance.
Alt-enter is a common macOS shortcut for inserting a new line in an
input that has a separate action tied to the enter key.
Signed-off-by: Ross Brandes <ross.brandes@gmail.com>
This makes the key backup panel much more explicit about the case where an
existing backup does exist, but this device just isn't using it. You can join
the device to the backup and restore from it by going through the restore
workflow.
Fixes https://github.com/vector-im/riot-web/issues/9446
To avoid confusion with other components that also might be named Avatar
Signed-off-by: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com>
To reduce the complexity in render(), move the format bar rendering to a
separate method
Signed-off-by: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com>
Make the user avatar a separate function component, make the logic for
laying out components a little more concise
Signed-off-by: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com>
Make the call/voice-call/hangup buttons separate react components
to reduce the amount of complexity on MessageComposer.
Signed-off-by: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com>
We might not have the device in `sig.device`, so we have to check for it's
existence first. This fixes the "Unable to load key backup status" message that
is incorrectly triggering.
Fixes https://github.com/vector-im/riot-web/issues/9442
The `BottomLeftMenu` component is not used in the new design. This removes the
component and also any images and sub-components that were only used by it.
The class name handling for validation inadvertently added `undefined` as a
class when validation is not used. This rearranges the logic to avoid the issue.
Fixes https://github.com/vector-im/riot-web/issues/9345
Rooms which are already upgraded shouldn't be asked to upgrade. Additionally, this fixes a bug where the room upgrade dialog would stay open even after upgrading the room.
Fixes an issue where hovering over the breadcrumbs could cause hundreds of web requests due to updates. This also fixes https://github.com/vector-im/riot-web/issues/9390 as the update is more reliable.
Add i18n entries for rotating images; fix the way `getName` is defined
Signed-off-by: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com>
Little bit of a mix of things in this one:
* Support variable-width dialogs. Default is fixed-width as before,
only UploadConformDialog is variable-width. Controlled by a prop
to BaseDialog.
* Fixes to the cancel 'x' - scale the mask image, tweak size & colour
* Colour & boldness of dialog titles
* Align the dialog title & cancel 'x'
* Remove gap between dialog buttons & right hand side of dialog(!)
* Round corners on dialogs
* Add grey border on image preview in upload confirm dialog
* and, squeezing in slightly randomly, finish the partially renamed
ChatInviteDialog to AddressPickerDialog.
This ensures we always include the current power level in the power selector,
even if it's greater than the level you're allowed to set yourself. This ensures
the selector can display the current value correctly when disabled.
Fixes https://github.com/vector-im/riot-web/issues/9340
Fixes https://github.com/vector-im/riot-web/issues/9353
The ContextualMenu now accepts a zIndex parameter which can be used to control its level. Dialogs are at around 4000 in the z-index, and the context menu defaults to 5000 for the things that need tooltips and such in a dialog.
When setting, delete the old one. Because delete checks if it exists first, we can safely call this.
The change in FromWidgetPostMessageApi is just something noticed while debugging.
Fixes https://github.com/vector-im/riot-web/issues/9354https://github.com/matrix-org/matrix-react-sdk/pull/2801 introduced a change which tried to make sure that when the widget URL was changed that the picker would be re-mounted, however it accidentally introduced a regression. While it effectively did the task it wanted to, it failed to keep the previously-mounted sticker picker alive. This is because the Stickerpicker component is remounted when opened, and the _updateWidget function is called. This results in this.state not having the "current" widget, meaning a URL change is always detected when the component is remounted (room changes, open sticker picker).
Instead of remounting always, we'll instead track which sticker picker widget is being used out of band. This therefore means that whenever the Stickerpicker component is mounted it doesn't create a whole new widget, and the existing (background) picker can be used. This also fixes the loading screen that people would see when opening the sticker picker after switching rooms, something which the persistent widget stuff is supposed to solve.
This uses the field component in the bug report dialog, which generally improves
the styling to fit in more naturally with the rest of the app so that it feels
more trustworthy.
Fixes https://github.com/vector-im/riot-web/issues/9343
Also fairly significant refactor of the uploading code: there are
a number of different ways of triggerring a file upload and each
went through a different code path (the media config size limit
worked on one of those paths). Basically take a lot of code out
of the views and put it into ContentMessages.
Sorry about the size of this patch.
https://github.com/vector-im/riot-web/issues/7565
Fixes https://github.com/vector-im/riot-web/issues/8605
The grey screen of sadness comes up when Chrome tries to open the PDF but doesn't have the right CSP headers. To avoid this, we'll just force a download of the PDF through `fetch` and `Blob`.
There are a few cases where the user might still get a grey screen though: namely if they open the URL in a new tab or when the event content is lying about the file type, or the file is too large to blobify.
`fetch` works in Chrome, Firefox, and our packaged Electron version.
If we have account data in local storage but nothing in the crypto store, it
generally means the browser has evicted IndexedDB out from under us. This adds a
modal to explain the situation and offer to completely clear storage to get
things back to normal.
Fixes https://github.com/vector-im/riot-web/issues/9109
Fixes https://github.com/vector-im/riot-web/issues/8714
Fixes https://github.com/vector-im/riot-web/issues/8890
Fixes https://github.com/vector-im/riot-web/issues/9034
Fixes https://github.com/vector-im/riot-web/issues/8954
This turned out to be much more complicated than it needed to be. We use an IndicatorScrollbar to do all the math for us and some minor changes have been made so it can flag left/right overflow. The complicated part is the css changes which make the gradients work: unlike the RoomSubList, we have to calculate the offset of the indicators (gradients) on our own because position:sticky doesn't work horizontally.
The changes to the css (well, mostly pointer-events:none) make it so the gradient doesn't interfere with the room avatars.
9034 and 8954 are fixed by this because they represent an overflow-x:none style breakage where browsers won't let you scroll without a scrollbar. The gradient offset problem is also demonstrated in 8954.
Having the referrer allows widgets to do customisation based on what
riot instance is embedding it. It gets a referrer when we embed it
in the iframe so there's nothing gained by suppressing it here.
This clarifies that the notification settings only apply to the current device.
This also tries to apply the spirit of
https://github.com/matrix-org/matrix-react-sdk/pull/1995 (authored by @aidalgol)
which wanted to remove "web" from the label, since there's also a desktop
client.
Fixes https://github.com/vector-im/riot-web/issues/6437
This also fixes a bug where if the room had apps open and you clicked the sticker picker's title, you'd end up closing the apps and not the picker.
The NetworkDropdown component was incorrectly guarding against a null
check when retrieving the list of networks
Signed-off-by: YaoiFangirl420 <48789208+YaoiFangirl420@users.noreply.github.com>
instead of setting a min-height on the whole timeline,
track how much height we need to add to prevent shrinking
and set paddingBottom on the container element of the timeline.
We moved off to our own fork of velocity many moons ago to fix
a memory leak bug when velocity was being barely maintained. They
have now merged the bugfix, so go back to mainline.
Fixes a bug for some widgets where they cannot do their startup routine (capabilities negotiation, etc) when someone maximizes the widget. By reloading the widget messaging, we ensure the widget is kept in the loop.
When working on the `Field` validation support, I thought `RegistrationForm`'s
refs would be okay to leave as is, but I missed that they also depended on the
value getter.
For the moment, it's quicker to temporarily revive the value getter to get
registration working.
Fixes https://github.com/vector-im/riot-web/issues/9171
The unknown devices dialog is confusing at the moment due to the complex trust
model in Riot involving various possible device states.
The room header padlock allows you to access this dialog even if there are no
unknown devices, which leads users to be unsure what they can believe and
reduces confidence in Riot. For now, we'll remove the room header click handler
that shows this dialog.
Fixes https://github.com/vector-im/riot-web/issues/8815
Since Scalar (and other integration managers) are loaded as apps into
an iframe, a valid `scalar_token` must exist when loading the app.
It is possible that a scalar_token becomes invalid between the time
when the integration manager button was rendered and the user clicking
the link. Here we make a call to integration manager `/account`
before trying to render the integration manager, which ensures we
have a valid token for the integration manager to work with.
Moving the scalar token revalidation to the cases where it is actually
needed could make it possible to decrease the amount of Scalar /account
calls we do when switching rooms, which is currently 3.
Signed-off-by: Jason Robinson <jasonr@matrix.org>
As part of adding validation to Field, the logic is simpler to follow if we can
assume that all usages of Field use it as a controlled component, instead of
supporting both controlled and uncontrolled.
This converts the uncontrolled usages to controlled.
* renames RoomTooltip to be a generic Tooltip (which it is)
* hooks it into Field to show validation results
* adds onValidate to Field to let Field instances call an arbitrary validation function
Rebased from @ara4n's https://github.com/matrix-org/matrix-react-sdk/pull/2550
by @jryans. Subsequent commits revise and adapt this work.
This fixes an unrelated bug where the currently selected country's prefix number
wasn't being displayed. Since other country dropdown's show the prefix, and this
is also for phone numbers, it seems good to also show it here as well.
As with other auth flows, this converts inputs on the login page to use the
Field component for consistent styling. The login type dropdown is left as-is
for now.
This allows Fields to have an optional prefix component which is placed inside
the border of the Field and to the left of the input. Since this label animation
would be complex to get right for this case, it is instead fixed to the top left
if there is a prefix component.
This canonical example of this today would be a phone number field which
includes a country dropdown.
This converts most fields in the registration form to use the Field component,
except for the phone number, which is a left as a separate task because of the
country dropdown menu.
Several small tweaks to the props handling:
* Use destructuring instead of `delete`
* Emphasize the `element` as a primary prop
* Document `textarea` as supported
There is a ref=target in the call to render AccessibleButton for
the hide stickers button. This ref is not present in the show case.
When clicking the stickerpicker show button, React gives a warning:
> Warning: Stateless function components cannot be given refs
> (See ref "target" in AccessibleButton created by Stickerpicker).
> Attempts to access this ref will fail.
Removed the ref. Stickerpicker hide/show still works fine, no warning.
Signed-off-by: Jason Robinson <jasonr@matrix.org>
We set the caption appropriately but forgot to actually do the
right thing depending on whether there was a key backup already.
Also fix the loadihng spinner which was never shown.
Fixes https://github.com/vector-im/riot-web/issues/8369
These icons are based on Feather as the original source, but they have various
tweaks applied, such as stroke width, color, etc. Hopefully the tweaked name
makes this more obvious in the future.
`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.
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 "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.
We weren't correctly jumping into the appropriate bit of the registration
flow when coming in from an email link.
* If we have client secret / sessionId, go straight to registration phase
* Don't reset server URLs when the server type component tells us its
initial value
* Confusingly, pass the custom server URL as 'default server URL' to
the custom server type, as this is what we want the inital section
to be based on.
Fixes https://github.com/vector-im/riot-web/issues/8490
In making the settings more positive, we flipped 'disable peer to
peer' but didn't change the caption, so the setting was inverted
from what it was labelled as.
Also, forcing p2p isn't the inverse of forcing turn.
Change the setting to be 'allow p2p' and the label to match.
* Separate out the emoji from the translateable string
* Put back the delete button if you're not using the backup,
otherwise you're stuck unable to use key backup at all if you
lost your recovery secret and the device you set it up on.
With the current wording, I half-think clicking this button might remove me from the community!
IMO 'Hide' sounds more like it's just going to disappear from the panel, but I can add it back at some point.
Direct the user to restore the backup in order to both get the keys
out of the backup and start putting them in.
Also hide the advanced key backup stuff in a diclosure.
They do local echo on changes to avoid jumping back and forth while requests are ongoing, however some areas modify the checked state after the toggle has mounted.
Fixes https://github.com/vector-im/riot-web/issues/8432
Add support for trust-on-decrypt (API change, recognise flag on
isKeyBackupTrusted). Catch rejection on wrong passphrase / recovery
key. Fix remembering whether we are restoring with key or passphrase.
Requires https://github.com/matrix-org/matrix-js-sdk/pull/836
Only fail if there were any keys in the backup (which does mean
that the backup will always succeed if there aren't any keys which
could also be misleading, but is probably not as bad and can probably
be fixed with Trust on Decrypt).
Also cheekily fix the error message so it talks about passphrases
if you used a passphrase and recovery keys if you used a recovery key.
This takes out the old user and room settings, replacing the paths with the new dialog editions. The labs setting has been removed in order to support this change.
In addition to removing the old components outright, some older components which were only used by the settings pages have been removed. The exception is the ColorSettings component as it has a high chance of sticking around in the future.
Styles that were shared by the settings components have been broken out to dedicated sections, making it easier to remove the old styles entirely.
Some stability testing of the app has been performed to ensure the app still works, however given the scope of this change there is a possibility of some broken functionality.