Repository navigation
Ads: they come with the welcome pages' lists, not every page - #429
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58a09809c9
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| %w[latest top].include?(topic_list.filter.to_s) && topic_list.category.blank? && | ||
| topic_list.tags.blank? |
There was a problem hiding this comment.
Include ads for every configured homepage list
When default_homepage is a valid topic-list route such as hot, new, or unread, onWelcomeRoute() treats it as a welcome page, but this predicate only attaches jt_lines to latest and top. On a fresh session the homepage response therefore leaves listed empty and the welcome ad never renders; include every supported homepage filter and cover a non-latest homepage in the request/system specs.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| include_condition: -> { DiscourseJtechAds.enabled? && DiscourseJtechAds.welcome_list?(object) }, | ||
| ) { DiscourseJtechAds.payload(scope) } |
There was a problem hiding this comment.
Avoid serializing the payload twice on Categories
For /categories_and_latest.json and /categories_and_top.json, the response contains both an unscoped topic_list and a top-level category_list. Both serializer conditions added here are therefore true, so the full ad payload is emitted under both lists (and a signed-in user's vote lookup is performed twice). Ensure that combined Categories responses carry jt_lines on only one of their child lists.
Useful? React with 👍 / 👎.
The ads were in the site data every page preloads: 26 KB on prod, on topic pages too, which never show them. They now come inside the lists the welcome area's pages are built from: the unscoped Latest (and Top) topic list, which is also the homepage's and the Categories page's topics, and the top-level category list. Still no request of their own for a blocker to drop; a blocker that dropped them would drop the list. In the browser every path that turns such a response into a list goes through core's topic-list-topics-from or category-list-attributes value transformer, before the page renders, so the welcome area has them as it draws: no shift while they arrive. Arriving on a topic page and going home fetches them with Latest's list. A page served before this still reads them from its site data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs
the-curious-2025/jtech-ad-remover was taken off GitHub (404), so the clone asked for a login and failed every run. With nothing to check against the run now says so in its summary and passes; when the repository is public again the check runs as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs
8c58991 to
e3e1aee
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8c589913d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if ! git clone --depth 1 https://github.com/the-curious-2025/jtech-ad-remover.git ad-remover; then | ||
| echo "found=false" >> $GITHUB_OUTPUT | ||
| echo "The ad remover's repository isn't public any more; nothing to check." >> $GITHUB_STEP_SUMMARY | ||
| exit 0 |
There was a problem hiding this comment.
Fail on clone errors unrelated to repository absence
In the ad-remover-check.yml workflow, this branch treats every nonzero git clone result as proof that the repository is no longer public. DNS, TLS, rate-limit, disk, or runner-network failures therefore set found=false, skip every verification step, and leave the scheduled job green, potentially disabling the monitor indefinitely without an alert. Only the expected repository-unavailable case should be suppressed; unexpected clone failures should still fail the job.
Useful? React with 👍 / 👎.
Summary
The ads (
site.jt_lines) were in the site data that every page preloads: 26 KB on prod, on every page, topic pages included, though they only show in the welcome area (Home, Latest, Categories, unscoped). They now come inside those pages' own lists:categories_and_latest);categories_and_top;There's still no request of their own for a blocker or the remover extension to drop; dropping them would mean dropping the topic list. In the browser, every path that turns such a response into a list passes through core's
topic-list-topics-fromorcategory-list-attributesvalue transformer, and that happens before the page renders. So the welcome area has the ads as it draws, with no layout shift. Arriving on a topic page and then going home brings them with Latest's list. Pages served before the deploy still read them from their site data.Affected module(s)
Module affected: Ads.
Test plan
spec/requests/ads_spec.rb: the ads come in /latest, /categories, /categories_and_latest and /top, and are absent from /site.json, a category's list, subcategories and a topic page; all existing audience, vote and preview specs pass.spec/system/ads_spec.rb, new:spec/system/ads_remover_spec.rb(the remover extension): passes.Checklist
pnpm lintis cleanbundle exec rubocopis cleanconfig/locales/server.en.ymlorclient.en.yml(none)🤖 Generated with Claude Code
https://claude.ai/code/session_01BUGDaR7qv2d8CuVp7UGSTs