Skip to content

Add kv.list() pagination playground example#2760

Merged
reynaldichernando merged 3 commits intoHeyPuter:mainfrom
tmchow:feat/2755-kv-list-playground
Apr 3, 2026
Merged

Add kv.list() pagination playground example#2760
reynaldichernando merged 3 commits intoHeyPuter:mainfrom
tmchow:feat/2755-kv-list-playground

Conversation

@tmchow
Copy link
Copy Markdown
Contributor

@tmchow tmchow commented Apr 2, 2026

Summary

Added an interactive playground example for puter.kv.list() that shows cursor-based pagination in action. Also updated the docs to wire the existing pagination code snippet to the playground.

Changes

New file: src/docs/src/playground/examples/kv-list.html

  • Creates 6 sample key-value pairs
  • Paginates through them 2 at a time using cursor-based pagination
  • Shows each page with keys and values
  • Cleans up sample data at the end

Updated: src/docs/src/KV/list.md

  • Changed the pagination example code fence from html (static snippet) to html;kv-list (playground-linked), matching the pattern used by other examples in the docs

Testing

The example follows the same pattern as existing playground examples (kv-incr.html, kv-del.html, etc.) and uses the documented puter.kv.list() API with limit and cursor options.

Fixes #2755

This contribution was developed with AI assistance (Claude Code).

Create an interactive playground example for kv.list() that
demonstrates cursor-based pagination with sample data (6 items,
2 per page). Also wire the pagination docs example to the playground
by changing the code fence from plain html to html;kv-list.

Fixes HeyPuter#2755
Copy link
Copy Markdown
Member

@reynaldichernando reynaldichernando left a comment

Choose a reason for hiding this comment

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

hi @tmchow thank you for the changes,
i've left some review on your PR
also, make sure to add the new example in the examples.js entry (you can find other docs for this)

Comment thread src/docs/src/KV/list.md Outdated
Comment thread src/docs/src/playground/examples/kv-list.html
@tmchow
Copy link
Copy Markdown
Contributor Author

tmchow commented Apr 3, 2026

Fixed in the latest push:

  • Restored the inline code example in list.md
  • Reverted kv-list.html to the original basic list example
  • Created a new kv-list-pagination.html for the cursor/limit playground demo
  • Registered the new example in examples.js

Copy link
Copy Markdown
Member

@reynaldichernando reynaldichernando left a comment

Choose a reason for hiding this comment

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

thank you for the updates!
i've made minor changes to improve readability, but this is already lookin good

@reynaldichernando reynaldichernando merged commit e23df0b into HeyPuter:main Apr 3, 2026
@tmchow
Copy link
Copy Markdown
Contributor Author

tmchow commented Apr 4, 2026

Thanks for the review and merge, @reynaldichernando.

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.

Improve puter.kv.list() paginate with cursor example + playground

2 participants