Typeahead for community selection on large instances #126

Open
opened 2026-08-02 18:18:27 +02:00 by myrmidex · 1 comment
Owner

Summary

Channel creation populates a select from GET /api/v3/community/list?type_=Local&limit=50, cached 24h per instance. That works for a self-hosted instance with a handful of communities — belgae.social has 5 — but the endpoint is paginated and a large instance has thousands. The select would be unusable and the cached payload large.

Proposal

Replace the select with a typeahead that queries as the user types, hitting the instance's community search rather than fetching everything up front.

Worth reconsidering the caching strategy at the same time: the 24h per-instance cache suits a small fixed list, but short-lived per-query caching may fit a search-driven UI better.

Priority

Not urgent. This only bites if FFR is pointed at a large public instance; the current approach is adequate for the self-hosted case it was built for.

Notes

  • Discovered while implementing community selection in #123 "Concurrent publish attempts create duplicate Lemmy posts".
  • Related: #114 "Validate channel name exists on the instance when creating a channel" — selecting from a list fetched from the instance satisfies that ticket by construction, so #114 may be closable once the select lands. Worth confirming rather than assuming.
  • No milestone — backlog.
## Summary Channel creation populates a select from `GET /api/v3/community/list?type_=Local&limit=50`, cached 24h per instance. That works for a self-hosted instance with a handful of communities — `belgae.social` has 5 — but the endpoint is paginated and a large instance has thousands. The select would be unusable and the cached payload large. ## Proposal Replace the select with a typeahead that queries as the user types, hitting the instance's community search rather than fetching everything up front. Worth reconsidering the caching strategy at the same time: the 24h per-instance cache suits a small fixed list, but short-lived per-query caching may fit a search-driven UI better. ## Priority Not urgent. This only bites if FFR is pointed at a large public instance; the current approach is adequate for the self-hosted case it was built for. ## Notes - Discovered while implementing community selection in #123 "Concurrent publish attempts create duplicate Lemmy posts". - Related: #114 "Validate channel name exists on the instance when creating a channel" — selecting from a list fetched from the instance satisfies that ticket by construction, so #114 may be closable once the select lands. Worth confirming rather than assuming. - No milestone — backlog.
myrmidex added the
enhancement
label 2026-08-02 18:18:27 +02:00
Author
Owner

Confirmed: the select landed; #114 is satisfied by construction.

Committed on release/v1.3.7 as 114 - Select channel communities from the instance instead of typing a slug. The community can no longer be typed, so a non-existent one can't be entered. channel_id now stores the numeric community id (name keeps the slug). #114 was already closed — no state change needed.

Unchanged and still accurate here: the limit=50 cap and the 24h CommunityDirectory cache.

One addition: an unreachable instance now returns a distinct error instead of the misleading "That community does not exist on the selected instance". Worth preserving if the typeahead replaces this fetch path.

**Confirmed: the select landed; #114 is satisfied by construction.** Committed on `release/v1.3.7` as `114 - Select channel communities from the instance instead of typing a slug`. The community can no longer be typed, so a non-existent one can't be entered. `channel_id` now stores the numeric community id (`name` keeps the slug). #114 was already closed — no state change needed. Unchanged and still accurate here: the `limit=50` cap and the 24h `CommunityDirectory` cache. One addition: an unreachable instance now returns a distinct error instead of the misleading "That community does not exist on the selected instance". Worth preserving if the typeahead replaces this fetch path.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lvl0/fedi-feed-router#126
No description provided.