Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(app): keep settings section actions in their own column

Hampus067496d53025
diff --git a/fluxer_app/src/features/app/components/dialogs/shared/SettingsModalLayout.module.css b/fluxer_app/src/features/app/components/dialogs/shared/SettingsModalLayout.module.css
index 0fdce8fac..f3d1b6ce9 100644
--- a/fluxer_app/src/features/app/components/dialogs/shared/SettingsModalLayout.module.css
+++ b/fluxer_app/src/features/app/components/dialogs/shared/SettingsModalLayout.module.css
@@ -21,7 +21,6 @@
--settings-selected-color: var(--text-primary);
--settings-sidebar-highlight: var(--text-primary);
--settings-sidebar-selected-background: var(--settings-selected-background);
- --settings-sidebar-selected-border-color: var(--settings-selected-border-color);
--settings-danger-text: color-mix(in srgb, var(--status-danger) 78%, var(--text-primary) 22%);
--settings-danger-background: color-mix(in srgb, var(--status-danger) 6%, var(--surface-interactive-hover-bg));
--settings-danger-border-color: color-mix(in srgb, var(--status-danger) 32%, transparent);
@@ -95,7 +94,7 @@
.desktopSidebar {
flex: 0 0 clamp(15.75rem, 24svw, 20rem);
display: flex;
- border-right: 0.0625rem solid var(--settings-border-color);
+ border-inline-end: 0.0625rem solid var(--settings-border-color);
background: var(--settings-surface-background);
overflow: hidden;
position: relative;
@@ -296,7 +295,7 @@
-webkit-tap-highlight-color: transparent;
width: 100%;
min-height: 2.125rem;
- text-align: left;
+ text-align: start;
box-sizing: border-box;
transition: none;
}
@@ -353,7 +352,7 @@
.externalTabIcon {
flex-shrink: 0;
- margin-left: auto;
+ margin-inline-start: auto;
color: var(--text-tertiary);
}
@@ -542,9 +541,9 @@
display: flex;
flex-direction: column;
gap: 0.125rem;
- margin-left: var(--settings-sidebar-subtree-line-x);
- margin-right: 0;
- padding-left: var(--settings-sidebar-subtree-content-gap);
+ margin-inline-start: var(--settings-sidebar-subtree-line-x);
+ margin-inline-end: 0;
+ padding-inline-start: var(--settings-sidebar-subtree-content-gap);
position: relative;
overflow: hidden;
min-height: 0;
@@ -561,7 +560,7 @@
.sidebarSubItems::after {
content: '';
position: absolute;
- left: 0;
+ inset-inline-start: 0;
top: 0;
bottom: 0;
width: var(--settings-sidebar-subtree-line-width);
@@ -572,7 +571,7 @@
.sidebarSubItems::before {
content: '';
position: absolute;
- left: 0;
+ inset-inline-start: 0;
top: var(--active-top, 0);
height: var(--active-height, 0);
width: var(--settings-sidebar-subtree-line-width);
@@ -610,7 +609,7 @@
-webkit-tap-highlight-color: transparent;
width: 100%;
min-height: 1.875rem;
- text-align: left;
+ text-align: start;
position: relative;
z-index: 2;
box-sizing: border-box;
diff --git a/fluxer_app/src/features/app/components/dialogs/shared/SettingsModalLayout.tsx b/fluxer_app/src/features/app/components/dialogs/shared/SettingsModalLayout.tsx
index 322a95dca..29bfafd43 100644
--- a/fluxer_app/src/features/app/components/dialogs/shared/SettingsModalLayout.tsx
+++ b/fluxer_app/src/features/app/components/dialogs/shared/SettingsModalLayout.tsx
@@ -7,6 +7,7 @@ import {remFromPx} from '@app/features/theme/layout/RemFromPx';
import {NotificationDot} from '@app/features/ui/components/NotificationDot';
import {Scroller, type ScrollerHandle} from '@app/features/ui/components/Scroller';
import FocusRing from '@app/features/ui/focus_ring/FocusRing';
+import {CaretRightIcon} from '@app/features/ui/icons/DirectionalIcons';
import {
handleSettingsTreeKeyDown,
type SettingsModalSidebarItemProps,
@@ -16,7 +17,6 @@ import {
} from '@app/features/user/utils/SettingsModalLayoutUtils';
import {msg} from '@lingui/core/macro';
import {useLingui} from '@lingui/react/macro';
-import {CaretRightIcon} from '@phosphor-icons/react';
import {clsx} from 'clsx';
import {observer} from 'mobx-react-lite';
import React, {useCallback, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef, useState} from 'react';
@@ -253,6 +253,7 @@ export const SettingsModalSidebarCategory: React.FC<{children: React.ReactNode}>
<SidebarCategoryContext.Provider value={contextValue}>
<section
className={styles.sidebarCategory}
+ role="group"
aria-labelledby={titleId ?? undefined}
data-flx="app.settings-modal-layout.settings-modal-sidebar-category.sidebar-category"
>
@@ -271,6 +272,7 @@ export const SettingsModalSidebarCategoryTitle: React.FC<{children: React.ReactN
return (
<h2
id={titleId}
+ role="none"
className={styles.sidebarCategoryTitle}
data-flx="app.settings-modal-layout.settings-modal-sidebar-category-title.sidebar-category-title"
>
diff --git a/fluxer_app/src/features/app/components/dialogs/shared/SettingsSection.module.css b/fluxer_app/src/features/app/components/dialogs/shared/SettingsSection.module.css
index 7f245b427..428a042b3 100644
--- a/fluxer_app/src/features/app/components/dialogs/shared/SettingsSection.module.css
+++ b/fluxer_app/src/features/app/components/dialogs/shared/SettingsSection.module.css
@@ -21,6 +21,24 @@
min-width: 0;
}
+.sectionHeaderWithActions {
+ flex-direction: row;
+ flex-wrap: wrap;
+ align-items: flex-start;
+ gap: var(--spacing-2) var(--spacing-6);
+}
+
+.sectionHeaderText {
+ display: flex;
+ flex-direction: column;
+ gap: var(--spacing-1);
+ min-width: 0;
+}
+
+.sectionHeaderWithActions .sectionHeaderText {
+ flex: 1 1 20rem;
+}
+
.sectionTitleRow {
display: flex;
align-items: center;
@@ -37,7 +55,7 @@
align-items: center;
justify-content: flex-end;
gap: var(--spacing-2);
- margin-left: auto;
+ margin-inline-start: auto;
}
.sectionTitle {
diff --git a/fluxer_app/src/features/app/components/dialogs/shared/SettingsSection.tsx b/fluxer_app/src/features/app/components/dialogs/shared/SettingsSection.tsx
index 878abe8c3..39fe5161b 100644
--- a/fluxer_app/src/features/app/components/dialogs/shared/SettingsSection.tsx
+++ b/fluxer_app/src/features/app/components/dialogs/shared/SettingsSection.tsx
@@ -76,22 +76,27 @@ export const SettingsSection: React.FC<SettingsSectionProps> = ({
}
return (
<section id={id} className={clsx(styles.section, className)} data-flx="app.settings-section.section">
- <div className={styles.sectionHeader} data-flx="app.settings-section.section-header">
- <div className={styles.sectionTitleRow} data-flx="app.settings-section.section-title-row">
- <h3 className={styles.sectionTitle} data-flx="app.settings-section.section-title">
- {title}
- </h3>
- {linkButton}
- {actions ? (
- <div className={styles.sectionActions} data-flx="app.settings-section.section-actions">
- {actions}
- </div>
+ <div
+ className={clsx(styles.sectionHeader, actions && styles.sectionHeaderWithActions)}
+ data-flx="app.settings-section.section-header"
+ >
+ <div className={styles.sectionHeaderText} data-flx="app.settings-section.section-header-text">
+ <div className={styles.sectionTitleRow} data-flx="app.settings-section.section-title-row">
+ <h3 className={styles.sectionTitle} data-flx="app.settings-section.section-title">
+ {title}
+ </h3>
+ {linkButton}
+ </div>
+ {description ? (
+ <p className={styles.sectionDescription} data-flx="app.settings-section.section-description">
+ {description}
+ </p>
) : null}
</div>
- {description ? (
- <p className={styles.sectionDescription} data-flx="app.settings-section.section-description">
- {description}
- </p>
+ {actions ? (
+ <div className={styles.sectionActions} data-flx="app.settings-section.section-actions">
+ {actions}
+ </div>
) : null}
</div>
<div className={styles.sectionContent} data-flx="app.settings-section.section-content">