Skip to content

feat(templates): add product-you-asked template - #427

Open
Saumyajaiswal9794 wants to merge 1 commit into
codercops:devfrom
Saumyajaiswal9794:feat/you-asked-template
Open

Saumyajaiswal9794 wants to merge 1 commit into
codercops:devfrom
Saumyajaiswal9794:feat/you-asked-template

Conversation

@Saumyajaiswal9794

Copy link
Copy Markdown
Contributor

Description

Adds the product-you-asked template (src/templates/product/you-asked.ts) for posts announcing a feature users asked for: a request card with a vote box and the quoted request, a "Shipped in vX" pill, the title and the site name.

  • Re-exported in src/templates/product/index.ts and registered in the product block of registry.ts
  • Tests in tests/templates/you-asked.test.ts

Closes #402

Screenshots

PNGs exported from the editor with Download PNG (1200x630).

Defaults

og-product-you-asked (3)

Light background

og-product-you-asked (2)

Long text

og-product-you-asked (5)

All optional fields empty

og-product-you-asked (6)

How I Tested This

  • npm run check: 0 errors
  • npm run test: all tests pass, except agenda.test.ts, which times out on a cold run on my Windows machine and passes when run alone (unrelated to this change)
  • Ran npm run dev and checked the template at /create/product:
    • blank or whitespace request hides the whole card; pill and title move up
    • blank votes hides the vote box; request takes the full card width
    • vote label only shows with a count
    • blank version gives "Shipped"
    • long title shrinks, then truncates; long request is capped at two lines; long vote count truncates without stretching the box
    • light background (#FFFFFF / #111111): pill, border and vote count stay readable

AI Assistance

I used an AI coding agent in VS Code (GitHub Copilot / Auto mode) to generate the template and its tests, based on the issue spec and the existing templates in the repo (waitlist.ts, discussion.ts). I used Claude to help write the prompt for the agent and for git/PR guidance. I reviewed the generated code, ran npm run check and npm run test, and tested every acceptance criterion manually in the editor.

@anurag629 anurag629 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hey @Saumyajaiswal9794, nice work, the card does what #402 asks: a blank request hides it and the pill and title move up, the vote label only shows with a count, a blank version gives "Shipped", and a long vote count truncates without stretching the box. The pill, border and count read fine on the light background too.

A few things before I can merge:

  1. In the long preview the pill wraps onto three lines across the whole card, because version isn't truncated (src/templates/product/you-asked.ts:63) and the pill span at :198 can wrap. Please truncate the version (24 characters is plenty) and keep the pill on one line with whiteSpace: 'nowrap', overflow: 'hidden' and textOverflow: 'ellipsis'.
  2. The site name wraps onto three lines in the long preview too. Truncate it the way Waitlist does (src/templates/product/waitlist.ts:51 cuts it at 40) and keep the span at :229 on one line. Please add a test for the long version and the long site name.
  3. A long vote label wraps onto a second line inside the vote box (:116). The same whiteSpace: 'nowrap' and textOverflow: 'ellipsis' keeps it on one line under the count.
  4. Small one: registry.ts is missing the space in productWaitlist,productYouAsked,, and src/templates/product/index.ts lost the newline at the end of the file.

Everything else looks good.

This branch has not been deployed

No deployments
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.

Add the You Asked product template (product-you-asked)

2 participants