Skip to content

feat(index): add copy button to snippet cards - #12

Open
KTQ0912 wants to merge 2 commits into
byteofhoney:mainfrom
KTQ0912:fix/issue-10-copy-all
Open

feat(index): add copy button to snippet cards#12
KTQ0912 wants to merge 2 commits into
byteofhoney:mainfrom
KTQ0912:fix/issue-10-copy-all

Conversation

@KTQ0912

@KTQ0912 KTQ0912 commented Jul 25, 2026

Copy link
Copy Markdown

Closes #10

What changed

  • Adds a copy button to each snippet card on the index page
  • Reuses similar copy feedback behavior from the detail page
  • Prevents navigation from the card when copying

Files

  • app/templates/index.html: add card copy button
  • app/static/style.css: copy button styles + copied state
  • app/static/main.js: copyCardCode() helper with clipboard fallback

KTQ0912 added 2 commits July 25, 2026 16:07
- Button copies the snippet code directly from the card
- Uses same feedback style as existing copy button on detail page
- Prevents navigation on click to satisfy acceptance criteria

Related to byteofhoney#10
- Add hidden copy source block so copyCardCode can read snippet code
- Keeps copy button behavior robust on index page
@byteofhoney

Copy link
Copy Markdown
Owner

The copy functionality itself works great!
But there's a layout bug: the .card-code-hidden div isn't actually hidden, since there's no CSS rule for that class in style.css. Right now it's showing full code on every card instead of staying invisible. Can you add .card-code-hidden { display: none; } to style.css? Once that's in, I think this is good to merge.

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.

"Copy All" button on snippet cards

2 participants