Skip to content

Unfeature post tool for moderators - #2167

Open
Oaphi wants to merge 14 commits into
developfrom
0valt/2165/post-unfeaturing
Open

Oaphi wants to merge 14 commits into
developfrom
0valt/2165/post-unfeaturing

Conversation

@Oaphi

@Oaphi Oaphi commented Oct 18, 2026 •

Copy link
Copy Markdown
Member

closes #2165

2026-10-18_20-19 2026-10-18_20-26

Some important notes:

  1. Cache is not cleared automaticall (as with the "feature" tool) - do not forget to run Rails.cache.clear if you want to see the result immediately. We should add an option to do so immediately, but it is outside the scope of this PR.
  2. There's a new test-only [well-known] dependency: minitest-stub_any_instance. If one uses our dockerized setup, unless you want to rebuild, use --user root when connecting to uwsgi containers to run bundle install.
  3. We do not have a way to delete pinned links (which would be a more appropriate way of "unfeaturing" the post in my view), so the tool only deactivates any active pinned link for the post.

No se puede reabrir esta publicación ahora mismo. Inténtelo de nuevo más tarde.
no_edit_changes: >
Ningún cambio ha sido salvado porque usted no ha editado la publicación.
post_has_been_featured: >

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know Spanish and refuse to use genai-in-a-trenchcoat services for "translation", so if anyone can help creating es.pinned_links.yml and adjusting es.posts.yml, it'd be appreciated.

@codecov

codecov Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.15%. Comparing base (36a1eb3) to head (7248bb4).

Additional details and impacted files
Components Coverage Δ
controllers 77.94% <100.00%> (+0.04%) ⬆️
helpers 85.62% <ø> (ø)
jobs 79.93% <ø> (ø)
models 93.55% <100.00%> (+0.04%) ⬆️
tasks 61.11% <ø> (ø)
scripts ∅ <ø> (∅)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Oaphi
Oaphi requested review from ArtOfCode- and cellio October 18, 2026 19:30
@cellio

cellio commented Oct 18, 2026

Copy link
Copy Markdown
Member
  1. We do not have a way to delete pinned links (which would be a more appropriate way of "unfeaturing" the post in my view), so the tool only deactivates any active pinned link for the post.

Unfeaturing today (from the mod tools) changes the active state rather than deleting the record. This should do the same thing (and I infer it does) -- it's just another path to that tool. An argument for keeping it this way is that we can view historical events and that can be useful. ("Have we featured this already?" "Where was that post a fellow mod featured last year that this one is a followup to?" "We have an annual event.")

@Oaphi

Oaphi commented Oct 18, 2026

Copy link
Copy Markdown
Member Author
  1. We do not have a way to delete pinned links (which would be a more appropriate way of "unfeaturing" the post in my view), so the tool only deactivates any active pinned link for the post.

Unfeaturing today (from the mod tools) changes the active state rather than deleting the record. This should do the same thing (and I infer it does) -- it's just another path to that tool. An argument for keeping it this way is that we can view historical events and that can be useful. ("Have we featured this already?" "Where was that post a fellow mod featured last year that this one is a followup to?" "We have an annual event.")

Not disagreeing per se, it's just that this is more of a job for the audit log provided we prettify the raw attribute dump and expose the mod-level events to moderators. Currently, every click on the "feature" tool produces a fresh new pinned link (and a corresponding log), which can result in lists like this:

2026-10-18_23-33

I'd say that, ideally, we should have a check that prevents creation of identical pinned links for a given post (and allow ones with different start / end options through) when featuring a post + delete those pinned links upon unfeaturing.

All that said, yup, the tool's behavior as implemented is the same as simply making a pinned link inactive. The only difference is that it makes all of them inactive at once as I think it's expected that unfeaturing a post would disable all of them (note that it is only about the "current" ones - upcoming should not be affected).

@cellio

cellio commented Oct 19, 2026

Copy link
Copy Markdown
Member

Oh! I didn't realize it was doing that. Yes, I agree -- at some point (not now) we should make this more robust.

@Oaphi

Oaphi commented Oct 19, 2026

Copy link
Copy Markdown
Member Author

note that it is only about the "current" ones - upcoming should not be affected

Actually, that's not true by the looks of it. I guess it can be beneficial to leave upcoming ones active when unfeaturing (that needs to be explictly stated so as the acting user is informed). What do you think, @cellio?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Un-feature from post tools menu

2 participants