Settings UI for the long-form composition strategy#42
Merged
pfefferle merged 2 commits intoadd/long-form-teaser-threadfrom Apr 29, 2026
Merged
Settings UI for the long-form composition strategy#42pfefferle merged 2 commits intoadd/long-form-teaser-threadfrom
pfefferle merged 2 commits intoadd/long-form-teaser-threadfrom
Conversation
Exposes the `atmosphere_long_form_composition` filter as a radio-group setting in the Publishing section: link-card (default), truncate-link, or teaser-thread. The setting seeds the filter at priority 1 so any downstream filter at the default priority can still override it per post. Sanitize callback rejects unknown values, falling back to the default.
kraftbj
approved these changes
Apr 28, 2026
Contributor
kraftbj
left a comment
There was a problem hiding this comment.
Reviewed. None of these strike me as blockers — leaving them as suggestions for a follow-up.
- Extract the strategy slug list to `Atmosphere::LONG_FORM_STRATEGIES` and reference it from the REST enum, sanitize allowlist, and the render iteration. Translatable labels live in a small private helper keyed off the same constant. - Move the seed callback to a named static method, `Atmosphere::seed_long_form_composition()`, so production wiring and tests can register the same callable. - Log invalid stored values via `error_log()` (rate-limited to once per hour with a transient) so operators can spot config drift — matches the `error_log` convention in `Transformer\Post` for silent strategy downgrades. - Test class now re-registers the seed in `set_up()` and clears it in `tear_down()` so isolation no longer depends on alphabetical ordering of test classes that call `remove_all_filters()`.
Contributor
|
Thanks! Looks good from here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on top of #34. Targeting that branch so the setting is testable end-to-end alongside the strategies. Re-target to trunk once #34 lands.
Proposed changes
atmosphere_long_form_composition. REST schema enumerates the three valid values; sanitize callback falls back to the default for unknown / non-string input.Atmosphere::init()registers a low-priority (priority 1) filter that seedsatmosphere_long_form_compositionfrom the option, leaving the default-priority filter slot open for downstream per-post overrides (FOSSE, custom plugins, etc.).Other information
Testing instructions
app.bsky.feed.postrecords land withreplyrefs.add_filter( 'atmosphere_long_form_composition', fn() => 'truncate-link' );in a small test plugin while the setting is Teaser thread. Confirm the filter wins.update_option( 'atmosphere_long_form_composition', 'bogus' )). Confirm publishing falls back to link-card.composer lintandnpm run env-testpass (5 new tests, 143 total).