Skip to content

Bookmarks in DB - API - #413

Open
Bohreromir wants to merge 8 commits into
mainfrom
feat-277-bookmarks-api
Open

Bohreromir wants to merge 8 commits into
mainfrom
feat-277-bookmarks-api

Conversation

@Bohreromir

@Bohreromir Bohreromir commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Description

Docs

Release note

Checklist

Author

  • AI review done, findings addressed
  • Tests added or updated
  • Changelog updated (if the repo keeps one)

Reviewer

  • Useful comments and logging
  • Docs added or updated per the style guide

Acceptance

  • Check for release notes and docs

Cap name (40), environment (100), URL (2048) and product id (64) in the
bookmark form schema, and set matching maxlength on the dialog inputs so
the form cannot submit values the upcoming bookmarks API rejects.
Add a user_bookmarks table (migration 0004) and a /api/bookmarks REST API
(GET/POST, PATCH/DELETE by id) scoped to the signed-in user. Requests
without a user, e.g. with OIDC disabled, are answered with 401. Operations
are counted in dashboard_bookmarks_total.

The dashboard still uses localStorage; switching it to the API follows.
@Bohreromir
Bohreromir added this pull request to stack #415 October 27, 2026 14:03
@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 66.43% 9013 / 13567
🔵 Statements 65.24% 12112 / 18564
🔵 Functions 67.09% 2893 / 4312
🔵 Branches 56.69% 5185 / 9146
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/lib/components/dashboard/AddBookmarkModal.svelte 94.89% 81.13% 94.33% 97.01% 118, 186, 185, 255-256, 254, 196, 276
src/lib/dashboard/product-ids.ts 100% 100% 100% 100%
src/lib/dashboard/products.ts 53.33% 100% 41.66% 50% 68-134
src/lib/dashboard/types.ts 100% 100% 100% 100%
src/lib/server/auth-utils.ts 100% 100% 100% 100%
src/lib/server/metrics.ts 100% 100% 100% 100%
src/lib/server/schema.ts 40% 100% 0% 40% 33-36, 52-66, 80-92, 111
src/lib/server/dashboard/bookmarks-db.ts 100% 100% 100% 100%
src/routes/(app)/api/bookmarks/+server.ts 83.33% 100% 100% 81.81% 16-17, 31-32
src/routes/(app)/api/bookmarks/[id]/+server.ts 88.23% 100% 100% 87.09% 27-28, 51-52
Generated in workflow #1176 for commit 81ccfcf by the Vitest Coverage Report Action

New bookmarks must name a known product; stored ones keep any non-empty id and show unknown ones as a custom link. Malformed bookmark ids are rejected with 400 like other id routes, and environments are trimmed.
Creating a bookmark beyond the limit is rejected with 409, so the list that every page loads stays small.
@Bohreromir Bohreromir self-assigned this Oct 27, 2026
@Bohreromir Bohreromir moved this to Development: Waiting for Review in Stackable Engineering Oct 27, 2026
@Bohreromir
Bohreromir marked this pull request as ready for review October 27, 2026 15:49
@Bohreromir Bohreromir linked an issue Oct 27, 2026 that may be closed by this pull request
1 task
@dervoeti dervoeti moved this from Development: Waiting for Review to Development: In Review in Stackable Engineering Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Development: In Review

Development

Successfully merging this pull request may close these issues.

Migrate bookmarks from localStorage to DB

2 participants