diff --git a/CHANGELOG.md b/CHANGELOG.md index c507c76b94..3ef31cad29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,16 @@ --> +## November 30, 2026 + +📢 https://mastodon.social/@cheeaun/117705055901143346 + +- 💾 "Bookmarks" renamed to "Saved Posts" +- 🙈 Wellbeing: hide post and profile metrics +- 🔤 Display options: lowercase timeline post text, show username instead of display name +- ⏰ Time format setting (auto, 12-hour, 24-hour) +- 🐛 Bug fixes + ## October 5, 2026 📢 https://mastodon.social/@cheeaun/117388840265015008 diff --git a/README.md b/README.md index 4dcac821ac..ed9fa90518 100644 --- a/README.md +++ b/README.md @@ -336,7 +336,6 @@ These are self-hosted by other wonderful folks. - [phanpy.vmst.io](https://phanpy.vmst.io/) by [@vmstan@vmst.io](https://vmst.io/@vmstan) - [phanpy.linuxusers.in](https://phanpy.linuxusers.in) by [@dharmik@linuxusers.in](https://linuxusers.in/dharmik) - [phanpy.blablalinux.be](https://phanpy.blablalinux.be) by [@blablalinux@mastodon.blablalinux.be](https://mastodon.blablalinux.be/@blablalinux) -- [fedi.woodpeckersnest.space](https://fedi.woodpeckersnest.space) by [@roughnecks@mastodon.social](https://mastodon.social/@roughnecks) > Note: Add yours by creating a pull request. @@ -553,7 +552,7 @@ All design files are in the [`design`](design/) folder.
(A.Mason)
- 2646 words + 2702 words
pl diff --git a/src/components/collection-add-account.jsx b/src/components/collection-add-account.jsx index 5da50eda94..2aa7e98365 100644 --- a/src/components/collection-add-account.jsx +++ b/src/components/collection-add-account.jsx @@ -9,6 +9,7 @@ import { api } from '../utils/api'; import { canAccountBeAdded, canAccountBeAddedByFollowers, + getCollectionLimits, } from '../utils/collections'; import { fetchRelationships } from '../utils/relationships'; import showToast from '../utils/show-toast'; @@ -33,6 +34,8 @@ function CollectionAddAccount({ }) { const { t } = useLingui(); const { masto } = api({ instance }); + const { maxItems } = getCollectionLimits(); + const isFull = existingAccountIds.size >= maxItems; const [uiState, setUIState] = useState('default'); const [accounts, setAccounts] = useState([]); const [relationshipsMap, setRelationshipsMap] = useState({}); @@ -79,7 +82,7 @@ function CollectionAddAccount({ }, []); const handleAdd = (account) => { - if (addingIds.has(account.id)) return; + if (isFull || addingIds.has(account.id)) return; setAddingIds((prev) => new Set([...prev, account.id])); (async () => { try { @@ -147,6 +150,7 @@ function CollectionAddAccount({ type="search" class="block" placeholder={t`Search accounts`} + disabled={isFull} onInput={(e) => { const { value } = e.target; debouncedLoadAccounts(value); @@ -189,7 +193,7 @@ function CollectionAddAccount({ {' '} + + Max {maxItems} accounts - + {showAddAccount && ( @{username}" msgid "Last updated: " msgstr "Last updated: " -#: src/components/collection-manage-accounts.jsx:89 +#: src/components/collection-manage-accounts.jsx:91 msgid "@{username} removed from collection" msgstr "@{username} removed from collection" -#: src/components/collection-manage-accounts.jsx:93 +#: src/components/collection-manage-accounts.jsx:95 msgid "Unable to remove account" msgstr "Unable to remove account" -#: src/components/collection-manage-accounts.jsx:115 +#: src/components/collection-manage-accounts.jsx:118 #: src/pages/collection.jsx:409 msgid "Manage accounts" msgstr "Manage accounts" -#: src/components/collection-manage-accounts.jsx:134 +#: src/components/collection-manage-accounts.jsx:137 msgid "Pending" msgstr "Pending" -#: src/components/collection-manage-accounts.jsx:141 +#: src/components/collection-manage-accounts.jsx:144 msgid "Remove <0>{username} from this collection?" msgstr "Remove <0>{username} from this collection?" -#: src/components/collection-manage-accounts.jsx:161 +#: src/components/collection-manage-accounts.jsx:164 #: src/components/edit-profile-sheet.jsx:473 #: src/components/edit-profile-sheet.jsx:565 #: src/pages/list.jsx:388 msgid "Remove…" msgstr "" -#: src/components/collection-manage-accounts.jsx:175 +#: src/components/collection-manage-accounts.jsx:180 #: src/pages/collection.jsx:650 msgid "Add account" msgstr "Add account" +#: src/components/collection-manage-accounts.jsx:184 +msgid "Max {maxItems} accounts" +msgstr "Max {maxItems} accounts" + #: src/components/columns.jsx:29 #: src/components/nav-menu.jsx:189 #: src/components/shortcuts-settings.jsx:145 diff --git a/src/pages/sandbox.jsx b/src/pages/sandbox.jsx index 5f3448ab8a..be2140e571 100644 --- a/src/pages/sandbox.jsx +++ b/src/pages/sandbox.jsx @@ -82,6 +82,8 @@ const MOCK_STATUS = ({ toggles = {} } = {}) => { const hashtagsContent = `

This is a test status with hashtags.

Hashtags should be formatted and clickable.

`; const mentionsContent = `

This is a test status with mentions. Hello @cheeaun and @test! What do you think about this @another_user?

Mentions should be highlighted and clickable.

`; const mathContent = `

This is a test status with mathematical expressions. Here's an inline formula \\( E = mc^2 \\) and a display formula:

\\[ \\frac{\\left(n!\\right)^2}{2}\\sum _{k=0}^m\\frac{1}{n-k}{n-k \\choose k}^2 \\]

The MathBlock component should detect and offer to render these LaTeX expressions.

`; + const codeContent = `

This is a test status with inline code and a code block:

const foo = 'bar';
+console.log(foo);
`; const base = { // Random ID to un-memoize Status @@ -112,7 +114,9 @@ const MOCK_STATUS = ({ toggles = {} } = {}) => { ? mentionsContent : contentType === 'math' ? mathContent - : shortContent + : contentType === 'code' + ? codeContent + : shortContent : '', visibility: toggles.visibility || 'public', createdAt: new Date().toISOString(), @@ -1481,6 +1485,18 @@ export default function Sandbox() { With math +
  • + +
  • diff --git a/src/utils/collections.js b/src/utils/collections.js index fc6ea3ee17..f18d9d7513 100644 --- a/src/utils/collections.js +++ b/src/utils/collections.js @@ -1,11 +1,29 @@ -import { getAPIVersions } from './store-utils'; +import { getAPIVersions, getCurrentInstanceConfiguration } from './store-utils'; export const COLLECTIONS_LIMIT = 80; +const DEFAULT_COLLECTION_LIMITS = { + maxItems: 25, + maxNameLength: 40, + maxDescriptionLength: 100, +}; + export function isSupported() { return getAPIVersions()?.mastodon >= 10; } +export function getCollectionLimits() { + const collections = getCurrentInstanceConfiguration()?.collections; + return { + maxItems: collections?.maxItems ?? DEFAULT_COLLECTION_LIMITS.maxItems, + maxNameLength: + collections?.maxNameLength ?? DEFAULT_COLLECTION_LIMITS.maxNameLength, + maxDescriptionLength: + collections?.maxDescriptionLength ?? + DEFAULT_COLLECTION_LIMITS.maxDescriptionLength, + }; +} + export function canAccountBeAdded(account) { return ['automatic', 'manual'].includes( account?.featureApproval?.currentUser, diff --git a/src/utils/is-same-url.js b/src/utils/is-same-url.js index 88964559f6..fa16cf6afe 100644 --- a/src/utils/is-same-url.js +++ b/src/utils/is-same-url.js @@ -1,14 +1,15 @@ -function normalizeURL(url) { +function normalizeURL(url, { search = false } = {}) { const parsed = URL.parse(url); if (!parsed) return url; const origin = parsed.origin; const pathname = parsed.pathname.replace(/\/$/, '') || '/'; + if (!search) return origin + pathname; parsed.searchParams.sort(); return origin + pathname + parsed.search; } -export default function isSameURL(a, b) { +export default function isSameURL(a, b, { search = false } = {}) { if (!a || !b) return false; if (a === b) return true; - return normalizeURL(a) === normalizeURL(b); + return normalizeURL(a, { search }) === normalizeURL(b, { search }); } diff --git a/tests/e2e/collection-card.spec.js b/tests/e2e/collection-card.spec.js new file mode 100644 index 0000000000..e9b5c94704 --- /dev/null +++ b/tests/e2e/collection-card.spec.js @@ -0,0 +1,47 @@ +// @ts-check +import { + createStatus, + expect, + openStatus, + setupApp, + test, +} from './fixtures.js'; + +const COLLECTION_URL = 'https://example.com/collections/1'; +const COLLECTION_URL_WITH_QUERY = `${COLLECTION_URL}?sort=alphabetical`; + +const COLLECTION = { + id: '2', + url: COLLECTION_URL, + name: 'Example Collection', + description: 'Lorem ipsum', + account_id: '3', + items: [], +}; + +test('shows the collection card when the post card URL differs by query', async ({ + page, +}) => { + const status = createStatus({ + id: '200', + content: `

    ${COLLECTION_URL_WITH_QUERY}

    `, + }); + status.card = { + url: COLLECTION_URL_WITH_QUERY, + title: 'Example Collection', + description: 'Lorem ipsum', + type: 'link', + provider_name: 'example.com', + provider_url: 'https://example.com', + }; + status.tagged_collections = [COLLECTION]; + + await setupApp(page, { + 'v1/statuses/200': status, + 'v1/statuses/200/context': { ancestors: [], descendants: [] }, + }); + await openStatus(page, '200'); + + await expect(page.locator('.collection-card')).toHaveCount(1); + await expect(page.locator('.card.link')).toHaveCount(0); +});