diff --git a/app/javascript/mastodon/components/router.tsx b/app/javascript/mastodon/components/router.tsx
index 1dc1d45083..1c251d6abc 100644
--- a/app/javascript/mastodon/components/router.tsx
+++ b/app/javascript/mastodon/components/router.tsx
@@ -17,6 +17,9 @@ import { isDevelopment } from 'mastodon/utils/environment';
interface MastodonLocationState {
fromMastodon?: boolean;
mastodonModalKey?: string;
+ // Prevent the rightmost column in advanced UI from scrolling
+ // into view on location changes
+ preventMultiColumnAutoScroll?: string;
}
export type LocationState = MastodonLocationState | null | undefined;
diff --git a/app/javascript/mastodon/features/status/index.jsx b/app/javascript/mastodon/features/status/index.jsx
index 77e8af4b67..a94c94492d 100644
--- a/app/javascript/mastodon/features/status/index.jsx
+++ b/app/javascript/mastodon/features/status/index.jsx
@@ -255,7 +255,12 @@ class Status extends ImmutablePureComponent {
const { dispatch, history } = this.props;
const handleDeleteSuccess = () => {
- history.push('/');
+ history.push('/', {
+ // Preventing the default "scroll to right" on
+ // location change in advanced UI to avoid conflict
+ // with the composer being focused
+ preventMultiColumnAutoScroll: true
+ });
};
if (!deleteModal) {
diff --git a/app/javascript/mastodon/features/ui/index.jsx b/app/javascript/mastodon/features/ui/index.jsx
index 55bc8f9901..47fe6ff0cc 100644
--- a/app/javascript/mastodon/features/ui/index.jsx
+++ b/app/javascript/mastodon/features/ui/index.jsx
@@ -136,7 +136,9 @@ class SwitchingColumnsArea extends PureComponent {
}
handleChildrenContentChange() {
- if (!this.props.singleColumn) {
+ const {preventMultiColumnAutoScroll} = this.props.location.state ?? {};
+
+ if (!this.props.singleColumn && !preventMultiColumnAutoScroll) {
const isRtlLayout = document.getElementsByTagName('body')[0]
?.classList.contains('rtl');
const modifier = isRtlLayout ? -1 : 1;
@@ -156,24 +158,23 @@ class SwitchingColumnsArea extends PureComponent {
const { signedIn } = this.props.identity;
const pathName = this.props.location.pathname;
- let redirect;
-
+ let rootRedirect;
if (signedIn) {
if (forceOnboarding) {
- redirect = ;
+ rootRedirect = '/start';
} else if (singleColumn) {
- redirect = ;
+ rootRedirect = '/home';
} else {
- redirect = ;
+ rootRedirect = '/deck/getting-started';
}
} else if (singleUserMode && owner && initialState?.accounts[owner]) {
- redirect = ;
+ rootRedirect = `/@${initialState.accounts[owner].username}`;
} else if (trendsEnabled && landingPage === 'trends') {
- redirect = ;
+ rootRedirect = '/explore';
} else if (localLiveFeedAccess === 'public' && landingPage === 'local_feed') {
- redirect = ;
+ rootRedirect = '/public/local';
} else {
- redirect = ;
+ rootRedirect = '/about';
}
const profileRedesignRoutes = [];
@@ -194,7 +195,7 @@ class SwitchingColumnsArea extends PureComponent {
- {redirect}
+
{singleColumn ? : null}
{singleColumn && pathName.startsWith('/deck/') ? : null}