Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Improvements to alt aliases #6180

Closed

Conversation

aaronraimist
Copy link
Contributor

@aaronraimist aaronraimist commented Jun 12, 2021

Attempt 2 at #4574

Step towards fixing element-hq/element-web#13077


TR: Video

Screen.Recording.2021-06-15.at.17.19.05.mov

Here's what your changelog entry will look like:

🐛 Bug Fixes

@t3chguy t3chguy requested a review from a team June 14, 2021 21:57
@t3chguy
Copy link
Member

t3chguy commented Jun 15, 2021

Could we get screenshots/gif of the changes?

@aaronraimist
Copy link
Contributor Author

When I get back to the computer I’ll take some but it looks exactly like the original PR. It’s best experienced by using the Netlify preview or building it yourself.

@aaronraimist
Copy link
Contributor Author

Screen.Recording.2021-06-15.at.17.19.05.mov

@turt2live turt2live added the X-Blocked The PR cannot move forward in any capacity until an action is made label Jun 22, 2021
@turt2live turt2live requested review from turt2live and removed request for a team June 22, 2021 20:53
@turt2live turt2live self-assigned this Jun 22, 2021
@turt2live turt2live removed their request for review June 22, 2021 21:32
@turt2live turt2live requested a review from a team June 22, 2021 21:32
@turt2live turt2live removed the X-Blocked The PR cannot move forward in any capacity until an action is made label Jun 22, 2021
@turt2live turt2live removed their assignment Jun 22, 2021
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on bringing this back. I realize that the stuff I'm commenting on is not necessarily your code, but I do still have concerns with the approach given it introduces a moderately complex state machine for a component which doesn't appear to need it.

I haven't personally tested this, but from the looks of it the majority of the usability concerns were worked out already.

Design will probably want to take a look at this as well, as a sort of stopgap approach (hopefully). The spaces alias changes will almost certainly have collided with this too.

If it comes down to it, what is your interest in maintaining this and potentially pushing it forward with design support? Including potentially (re)writing a bunch of the state machine stuff.

verifyRemove: boolean,
}

export class EditableItem extends React.Component<IEditableItemProps, IEditableItemState> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this class got converted in another PR (at least, I remember seeing the name today...). Should be able to use that safely, I hope.

limitations under the License.
*/

import React, {useEffect, useRef, useState, FunctionComponent} from "react";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

applies throughout, as a new requirement: any non-component-property object definition should be padded with spaces. Eg: { words }

Comment on lines +51 to +79
interface AUpdateAlias {
type: 'update_alt_alias',
value: string,
}

interface ASyncedAliases {
type: 'synced_aliases',
alt: Alts,
canonical: string | undefined,
}

interface ABeginCommit {
type: 'begin_commit',
submitting: 'add' | 'remove' | 'canonical',
alt?: Alts,
canonical?: string,
regarding?: string,
}

interface AEndCommit {
type: 'end_commit'
}

interface AAbortCommit {
type: 'abort_commit',
error: Error
}

type Action = AUpdateAlias | ASyncedAliases | ABeginCommit | AEndCommit | AAbortCommit;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit worried that this is a lot of extra complexity... Can we get comments as to what these are trying to achieve, and what problems they solve?

Also, our interfaces are INamed, so in this case would be IUpdateAliasAction and such. The type Action should probably be named something that doesn't conflict with the dispatcher, such as type AliasAction

*/

class EditableAltAliasList extends EditableItemList {
private _publishedAliasField = React.createRef<Field>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop the underscore

Comment on lines +146 to +147
* TODO: Fixing up this, and AliasSettings, to not need a subclass is a very
* likely candidate for further cleanup
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open TODOs are a bit questionable

/* Don't throw up a dialog if the user closed the parent */
if (!isMounted.current) return;

dispatch({type: ABORT_COMMIT, error: err});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where is this dispatch function coming from?

class EditableAltAliasList extends EditableItemList {
private _publishedAliasField = React.createRef<Field>();

_onAliasAdded = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private, no underscore

this._publishedAliasField.current.focus();
};

_renderNewItemField() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private, no underscore

@aaronraimist
Copy link
Contributor Author

If it comes down to it, what is your interest in maintaining this and potentially pushing it forward with design support? Including potentially (re)writing a bunch of the state machine stuff.

I am not super interested in rewriting it. I was mostly reintroducing this PR because it already passed a code review and was just missing a design review. If it needs to be rewritten then it'll probably have to wait for someone else to pick it up.

@Palid
Copy link
Contributor

Palid commented Nov 29, 2021

@aaronraimist I'm taking this one over, hopefully you don't mind. 😄

@turt2live
Copy link
Member

@aaronraimist I think this got replaced with #7107 ? Are there remaining bits of this or the linked issue which might still need doing?

@aaronraimist
Copy link
Contributor Author

@turt2live #7107 is an improvement but in my opinion it doesn't replace this PR. #7107 checks that the address about to be published looked like an alias but this PR actually checks if the alias points at the room and provides a helpful error if not.

Currently if you enter a valid looking alias but it doesn't point at the room, you get this error which doesn't explain much.

I'm not sure if @Palid wants to leave this open and build on top of it or close it and rewrite it in a different way.

@turt2live
Copy link
Member

I think if you're able to pick it up instead that would be ideal.

@aaronraimist aaronraimist marked this pull request as draft January 21, 2022 01:13
@aaronraimist
Copy link
Contributor Author

I'll see what I can do but can't promise anything in the near future

@MadLittleMods MadLittleMods added Z-Community-PR Issue is solved by a community member's PR T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems labels Jun 2, 2022
@langleyd langleyd closed this Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Defect Bugs, crashes, hangs, vulnerabilities, or other reported problems Z-Community-PR Issue is solved by a community member's PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants