支持收藏链接分页导出 - #116
Merged
Merged
支持收藏链接分页导出#116
Conversation
This was referenced Sep 8, 2026
Merged
Labs is a card on the settings page: features still being tried out,
off by default, switch stored server-side per user.
- sr_user_lab_feature (user_id, feature, enabled, created_at, updated_at);
no row means off. Migration adds the table and its two indexes.
- LabRepo: listByUser / isEnabled / upsert on the Postgres client.
- LabService: registry is an overridable method (empty here so a
self-hosted build sees no change); status active reads the switch,
graduated is on for everyone, retired is off for everyone.
assertUrlAllowed() throws LAB_FEATURE_DISABLED when a URL needs a
feature the user has not turned on; gatedFeatureForUrl() is the hook a
hosted backend overrides to say which URLs are gated.
- LAB_FEATURE_DISABLED (400) carries the feature's display name in the
localized message (zh / en / es), so clients show it as-is.
- GET /v1/user/labs returns { features: [{ key, status, enabled, enabled_at }] }.
- POST /v1/user/setting/enable|disable with key "lab:<feature>" flips
the switch; UserService takes LabService.
- Regenerated router and DI.
Claude-Session: https://claude.ai/code/session_01Xg119Pyy2B2UQQddrxw5Dv
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
DGuang21
previously approved these changes
Sep 9, 2026
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.
新增需要登录的
GET /v1/bookmark/export。每页最多返回 500 条收藏及游标,覆盖归档、快捷链接和抓取失败的条目,排除回收站,保留标签来源与独立的已读/归档/加星状态。查询从会话确定账号,书签和标签均按账号过滤。按收藏 ID 升序读取,首次请求固定 ID 上限;新增条目不进入本次导出,删除不会导致后续页跳项。响应禁止缓存,无数据库迁移。
验证:通过托管后端的 46 项相关测试(其中导出 8 项),包括真实路由的未登录和过期会话、账号隔离、分页增删及页间元数据变化;变更文件 lint 通过。完整后端类型检查仍有 24 条既有错误,导出代码无类型错误。数据库测试使用内存替身,未验证真实账号端到端导出。
合并共享 API 后更新托管后端并先发布接口,再发布网页。
关联 PR: