Skip to content

Room list: edit or remove custom sections#33283

Open
florianduros wants to merge 12 commits intodevelopfrom
florianduros/edit-remove-sections
Open

Room list: edit or remove custom sections#33283
florianduros wants to merge 12 commits intodevelopfrom
florianduros/edit-remove-sections

Conversation

@florianduros
Copy link
Copy Markdown
Member

@florianduros florianduros commented Apr 23, 2026

Closes #32457

Add actions to be able to edit or remove the custom sections. A new menu is introduced in the section header on each custom sections.

Screen.Recording.2026-04-23.at.16.43.20.mov

@@ -14,6 +14,11 @@ import DialogButtons from "../elements/DialogButtons";
import { _t } from "../../../languageHandler";
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(Since you don't have a screenshot, design feedback will end up here 😄 )

Image

https://www.figma.com/design/qurBlLqjf3mRNpyZ1ffamm/ER-213---Sections?node-id=214-25270&t=pLsVx9P23XBqQBY6-4

The padding looks off for the middle text.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Padding around the title is EW default. Compound and EW have different dialog designs and until we decide to update the dialog styles this kind of differences will exist imo

*/

.mx_RemoveSectionDialog {
color: var(--cpd-color-text-primary);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You don't have one for CreateSectionDialog. Presumably this is an archaic bug we're fixing, can you leave a comment?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread apps/web/src/components/views/dialogs/RemoveSectionDialog.tsx Outdated
hasCancel={true}
>
<Text as="span">{_t("remove_section_dialog|confirmation")}</Text>
<Text as="span">{_t("remove_section_dialog|description")}</Text>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ooi, is there a reason for the two spans rather than combining into one?

Copy link
Copy Markdown
Member Author

@florianduros florianduros Apr 24, 2026

Choose a reason for hiding this comment

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

To have the same formatting than in figma. You prefer to put a <br /> in the translation?

Comment thread apps/web/src/components/views/dialogs/CreateSectionDialog.tsx Outdated
<Form.Label> {_t("create_section_dialog|label")}</Form.Label>
<Form.TextControl onChange={(evt) => setValue(evt.target.value)} required={true} />
<Form.TextControl
value={value}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fwiw, in my testing I could insert whitetext before or after my section name and it would not be rendered in the list but accepted by this dialog

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good catch

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

<Form.TextControl onChange={(evt) => setValue(evt.target.value)} required={true} />
<Form.TextControl
value={value}
onChange={(evt) => setValue(evt.target.value)}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also noting it's possible to have duplicate section names

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep that is totally possible

}

/**
* Edits an existing custom section by showing a dialog to the user to enter the new section name. If the user confirms, it updates the section data in the settings.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Holy line length batman (it would be helpful if this was kept to around 120 chars per line so it was easier to read)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

There is no currently formating rules enforcing it

*/
export async function deleteSection(tag: string): Promise<void> {
const sectionData = SettingsStore.getValue("RoomList.CustomSectionData") || {};
if (!sectionData[tag]) return;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this warn or throw, seems like there is an application bug if we get to this stage?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Comment thread apps/web/src/stores/room-list-v3/section.ts Outdated
Copy link
Copy Markdown

@gaelledel gaelledel left a comment

Choose a reason for hiding this comment

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

If a section is empty, we still display "The chats in this section will still be available in your chats list." from the confirmation modal.
See below:
Image

So if the section is empty, could we instead have
Title: Remove section?
Body: Are you sure you want to remove this section?

On contrary if the section contains at least one room, then we can display
Title: Remove section?
Body: Are you sure you want to remove this section? The chats in this section will still be available in your chats list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Enhancement T-Feature Request to add a new feature which does not exist right now

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Room list: sections - P6 edit or remove sections

4 participants