From 5ce21f079bdc0b469664e4766367e22cc41cc16a Mon Sep 17 00:00:00 2001 From: Zach Manson Date: Sun, 8 Mar 2026 22:04:56 +1100 Subject: [PATCH 1/5] Add option to adjust column widths --- src/app.css | 3 ++ src/components/columns.jsx | 13 ++++++++ src/pages/settings.jsx | 62 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 78 insertions(+) diff --git a/src/app.css b/src/app.css index 8cf9a1f4db..9f2c76fed1 100644 --- a/src/app.css +++ b/src/app.css @@ -2759,6 +2759,9 @@ ul.link-list li a .icon { -1px 0 var(--bg-color), -2px 0 var(--drop-shadow-color), -3px 0 var(--bg-color); + + transition: flex-basis 0.3s ease-in-out; + &:dir(rtl) { box-shadow: 1px 0 var(--bg-color), diff --git a/src/components/columns.jsx b/src/components/columns.jsx index 6f2ced3425..2a17a9c14d 100644 --- a/src/components/columns.jsx +++ b/src/components/columns.jsx @@ -1,6 +1,8 @@ import { useLingui } from '@lingui/react/macro'; +import { useLayoutEffect } from 'preact/hooks'; import { useHotkeys } from 'react-hotkeys-hook'; import { useSnapshot } from 'valtio'; +import store from '../utils/store'; import AccountStatuses from '../pages/account-statuses'; import Bookmarks from '../pages/bookmarks'; @@ -32,6 +34,17 @@ function Columns() { console.debug('RENDER Columns', shortcuts); + useLayoutEffect(() => { + const columnSize = store.local.get('columnSize'); + if (!columnSize) return; + const col = document.getElementById('columns'); + if (col) { + col.style.setProperty('--column-size', `${columnSize}px`); + } else { + console.warn('Failed to set column size: #columns not found'); + } + }, []); + const components = shortcuts.map((shortcut) => { if (!shortcut) return null; const { type, ...params } = shortcut; diff --git a/src/pages/settings.jsx b/src/pages/settings.jsx index 4ae49a9a7e..d4c0c11976 100644 --- a/src/pages/settings.jsx +++ b/src/pages/settings.jsx @@ -30,6 +30,11 @@ import states from '../utils/states'; import store from '../utils/store'; import { getAPIVersions, getVapidKey } from '../utils/store-utils'; +const DEFAULT_COLUMN_WIDTH = 360; +const SMALLEST_COLUMN_WIDTH = 360; +const LARGEST_COLUMN_WIDTH = 600; +const COLUMN_WIDTHS = [360, 400, 440, 480, 520, 560, 600]; + const DEFAULT_TEXT_SIZE = 16; const TEXT_SIZES = [14, 15, 16, 17, 18, 19, 20]; const SMALLEST_TEXT_SIZE = TEXT_SIZES[0]; @@ -60,6 +65,7 @@ function Settings({ onClose }) { const systemTargetLanguage = getTranslateTargetLanguage(); const systemTargetLanguageText = localeCode2Text(systemTargetLanguage); const currentTextSize = store.local.get('textSize') || DEFAULT_TEXT_SIZE; + const currentColumnSize = store.local.get('columnSize') || DEFAULT_COLUMN_WIDTH; const [prefs, setPrefs] = useState(getPreferences()); const { masto, authenticated, instance } = api(); @@ -226,6 +232,15 @@ function Settings({ onClose }) { +
  • +
    + +
    + +
  • +