Repository navigation
Kudos and sharing on blog posts and Curiosity Feed entries - #263
Merged
Merged
Conversation
github-actions
Bot
force-pushed
the
blog-kudos
branch
2 times, most recently
from
October 26, 2026 02:19
f96eca6 to
307b721
Compare
- /api/kudos takes `post-<slug>` ids: a plain slug (the dev.to mirror's rule) for a post the deployed site has, checked by its prerendered /blog/<slug>/_payload.json (200, no redirects; kept for 10 minutes) before its first kudos - components/KudosButton.vue: one button for the About card, the end of each post and each feed entry; useKudos keeps one shared set of counts - Security tests for post ids (KUDOS_POST_IDS), the existence check and its cache; accessibility tests for a post and the feed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS
↗ Share next to the kudos: the device's share sheet with the post's title and link, or the link copied where there's no share sheet, with a "Link copied" status for screen readers. utils/share.js is unit-tested; the copy path is checked in the browser with axe. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS
github-actions
Bot
force-pushed
the
blog-kudos
branch
from
October 26, 2026 02:47
307b721 to
21bb17c
Compare
Merged
# Conflicts: # tests/security/payloads.mjs
Kudos keep both: post ids with the existence check, and the same-origin check, per-connection counting and daily sweep. The XP line keeps the glossary terms and the kudos button. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS
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.
Summary
Blog posts and Curiosity Feed entries now get two buttons:
/api/kudosfunction and Netlify Blobs counts, and the same once-a-day limit.Related Issue
Follows #262 (XP kudos) and #267. Hansel's requests: "Add same to blogs and articles" and "Allow a share function too".
Changes Made
netlify/functions/kudos.mjs:post-<slug>.SLUGinscripts/lib/devto.mjs), so there are no dots, slashes or capitals./blog/<slug>/_payload.jsonmust answer 200, with redirects not followed.DEPLOY_URL, elseURL). The answer is kept in memory for 10 minutes.components/KudosButton.vue:composables/useKudos.js: one shared set of counts for the whole app (useState). Each page keeps them live while its buttons are on screen.components/ShareButton.vue+utils/share.js: ↗ Share.navigator.sharewith the title and the post's full link. Closing the sheet isn't an error.pages/blog/[slug].vue): "Enjoyed this post? 👏 n ↗ Share" at the end of each post. Share shows even where kudos can't (a local preview).pages/blog/feed/index.vue): 👏 and ↗ Share under each entry. The entry's link is its own/blog/<slug>page.tests/security/kudos.test.mjs:KUDOS_POST_IDSinpayloads.mjs) are refused before the site is asked about them;These sit alongside Kudos: tighten counting #267's tests.
tests/app/share.test.mjs: share sheet, closed sheet, copy fallback, and failure without throwing.tests/e2e/a11y.spec.mjs:payloads.mjskeep both sides.How to Test
npm test: 345 pass.npm run generate.PLAYWRIGHT_CHROMIUM_PATH=/opt/pw-browsers/chromium npx playwright test tests/e2e/a11y.spec.mjs -g "Kudos|About card|/blog" --project="Pixel 7" --project="Galaxy Tab S9 landscape": 16 pass.post-hello-worldreturned 200 andpost-no-such-postreturned 404./blog/hello-worldand on the feed's first entry counted./blog/feed.Additional Notes
Permissions-Policy.🤖 Generated with Claude Code
https://claude.ai/code/session_01Nginuw5wmUjUSkmQB1J3pS