Skip to content

feat(api): accept a description when creating a personal collection - #1888

Merged
Quick104 merged 4 commits into
feat/collections-revampfrom
feat/api-personal-create-description
Oct 4, 2026
Merged

Quick104 merged 4 commits into
feat/collections-revampfrom
feat/api-personal-create-description

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #192
Validation tasks: none

A profile can't give a personal collection a description when it creates one. POST /api/v2/collections has no description member, so a client has to create the collection and then send a PATCH to set it. The redesigned collection editor shows Description at create time for every collection, so the create call needs to accept it.

This adds an optional description to createCollection and a create_description capability flag that clients can check before sending it.

Approach

  • PersonalCollectionCreate gets an optional description. Leaving it out stores an empty description, as today. null answers 422, like the other optional create members.
  • The handler's create request struct is shared with the frozen /api/v1/collections create. The new field is tagged json:"-" there and only the v2 adapter sets it, so v1 still ignores description in both JSON and multipart bodies. The store already accepted a description, so there is no migration.
  • getCollectionCapabilities reports create_description when the acting account's user store keeps descriptions. Stores report this through CollectionFeatures: the Postgres store does, the SQLite store has no description column and doesn't. On a store without support, a create with a non-empty description answers 501 capability_unsupported (now declared on createCollection) instead of dropping it. PersonalCollectionCreate refuses unknown members, so an older server rejects description; clients should check the flag first.
  • docs/catalog-api.md documents the field next to the other personal collection capability notes.
  • The OpenAPI document, fixtures, system-info digest and web types are regenerated. The two new fixtures are added at the end of the fixture list, so no existing fixture's request id changes.

No web code sends the field yet; the editor uses it in a later PR. jellycompat needs no change, since BoxSets read stored collections. The user manual doesn't describe API fields and needs no change. The matching silo-apple and silo-android follow-up (send description on create when create_description is true) is not filed yet.

Validation

  • Go: build, gofmt, vet and make lint-changed against feat/collections-revamp are clean; make test-go passes.
  • DB-backed collection tests in handlers, apiv2 and userstore pass on a freshly migrated database. They cover create with and without a description, the v1 create ignoring it, and Collections — Server #193 S2 isolation for a new collection: another profile on the account gets 404 on read and update of a private collection, a profile it is shared with can read it but gets 403 on update, and another login gets 404.
  • A SQLite-store handler test covers the refused create, the plain create, and the unreported feature; an apiv2 test covers the capability following the store.
  • Contract: verify-apiv2-openapi, verify-apiv2-contract (three additive changes, none breaking), verify-apiv2-fixtures, verify-apiv2-web-types, verify-route-inventory, verify-migration-ledger and TestCommittedArtifactMatchesRouter pass.
  • Web: lint, format:check, build, budget:check, tsc -b and make test-web pass.
  • make verify-local-paths passes.
  • Running the whole handlers package against a database also fails TestAdminSubtitleListPageDB and TestCatalogTransferPersistsJobsAndSignedLink. Both fail the same way on feat/collections-revamp and don't touch collections.

Risks

  • Additive only. Shipped clients don't send description and ignore the new capability member. /api/v1 requests and responses are unchanged.
  • Description length isn't limited on create, the same as on update today.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (in T3 Code)
  • Tool(s): Claude Code subagents (implementer, independent reviewer)
  • Model(s): claude-opus-5-5[1m]
  • Involvement: Fully AI-generated, human review pending
  • Adversarial review: An independent reviewer subagent read the full diff, reran the new tests, and reverted each production change on its own (the store passthrough, the v1 json:"-" tag, the v2 copy and capability flag) to confirm a test fails for each. It also reran the contract and local-path checks in a clean checkout. It found no problems and noted that create doesn't limit description length, matching update. Nothing changed as a result.

🤖 Generated with Claude Code

Note

Add optional description to v2 personal collection creation

The v2 createCollection endpoint now accepts an optional non-null description string. GET /api/v2/collections/capabilities reports a new create_description boolean, sourced from the new userstore.CollectionFeatures.Description flag, which the PostgreSQL store sets to true. SQLite stores reject a non-empty description with 501 and leave no collection behind; an omitted description stays empty and works on all stores. Adds contract fixtures, generated TypeScript schema updates, and PostgreSQL/SQLite integration coverage in collections_create_description_test.go. Risk: create_description is required in CollectionCapabilities responses, and v1 JSON and multipart create paths deliberately ignore the new Description field on handlers.PersonalCollectionCreateRequest — check personal_collections.go and collections.go when auditing.

Macroscope summarized 51d3805.

The new collection editor saves a description with the collection it
creates. Until now /api/v2 createCollection rejected the member, so a
client had to create first and PATCH the description afterwards.

createCollection takes an optional description, and the collection
capabilities report create_description so clients can detect it. The
shared handler request carries the field as json:"-", so the frozen
/api/v1 create still ignores a description in JSON and multipart bodies.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 98916e74-c334-4334-ab16-96cf4bbdf21c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 4, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-04T17:08:05.052630Z 51d3805 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 12125ad416

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/apiv2/personal_collections.go Outdated
// PersonalCollectionCreate is the createCollection body.
type PersonalCollectionCreate struct {
Name string `json:"name" minLength:"1" example:"Rainy days"`
Description *string `json:"description,omitempty" nullable:"false" doc:"Empty when omitted. Accepted when getCollectionCapabilities reports create_description" example:"For wet afternoons"`

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge File the required client follow-ups

This introduces a client-visible create field, but the commit states that the matching silo-apple and silo-android work has not been filed. File or land both follow-ups before shipping; otherwise the first-party clients cannot use the new capability and the repository's completion gate for API changes remains unmet.

AGENTS.md reference: AGENTS.md:L146-L152

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No code change for this one. It's a tracking item, not a defect in the diff: the field is optional and gated behind create_description, so shipped clients keep working without it. The PR body already says the silo-apple and silo-android follow-ups aren't filed yet. This PR merges into feat/collections-revamp, not main, so those issues will be filed, with maintainer sign-off, before the collections stack ships to main.

Brings in login-wide personal collection sharing (#1875), the scrobble
lock fix (#1887), and the import owner-access fix (#1874).

Conflict resolution keeps both sides: the capabilities test expects
login_sharing and create_description, the fixture list keeps
collection_order_foreign_id before this branch's appended cases, and the
create-description DB test no longer sets the removed AllowedProfileIDs.
The OpenAPI document, fixtures, and web types are regenerated.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f4897a8b8e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/apiv2/personal_collections.go Outdated
CollectionSortPreferences: v.CollectionSortPreferences,
EffectiveCollectionSort: v.EffectiveCollectionSort,
SortPreferenceKinds: NonNil(v.SortPreferenceKinds),
CreateDescription: true,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not advertise create descriptions on SQLite

When userdb.backend=sqlite, this unconditionally reports support, but internal/userdb/collections.go's CreateCollection neither inserts input.Description nor includes it in the returned collection. A client following the capability therefore sends a description, receives a 201 response with an empty description, and later reads back an empty value, silently losing the user's input. Persist descriptions in the SQLite schema/store or report this capability only when the active store supports it.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 51d3805. Stores now report description support through CollectionFeatures (Postgres yes, SQLite no), create_description follows the acting account's store, and a create with a description on a store without support answers 501 capability_unsupported instead of dropping it.

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown

The current Validation tasks: line overstates this diff's impact. #193 S2 is recorded as Pass on build 1012, but the exercised create flow is unchanged when description is omitted (it remains empty); the member, edit, and profile-access behavior is unchanged. #193 S7 remains Not run, and this diff does not change the sharing behavior tracked by #1615.

Suggested replacement:
Validation tasks: none

Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed.

Posted via Macroscope — v1 validation impact

Quick104 and others added 2 commits October 4, 2026 10:56
…rged

An approval lives only on the pull request that needs it. The #1615
removals merged into feat/collections-revamp with #1875, so these entries
now match no change and fail the contract gate. The record stays in the
file's history; the final merge into main carries them again.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The SQLite user store has no description column, so a description sent on
create was dropped while getCollectionCapabilities still reported
create_description. Stores now report description support through
CollectionFeatures: Postgres reports it, SQLite does not. The capability
follows the acting account's store, and a create carrying a description on
a store without support answers 501 capability_unsupported, now declared on
createCollection.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@Quick104

Quick104 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Changed the Validation tasks: line to none: creates without a description and the #193 S2 isolation behavior are unchanged, and #193 S7 sharing isn't touched.

@Quick104
Quick104 merged commit 60969be into feat/collections-revamp Oct 4, 2026
16 checks passed
@Quick104
Quick104 deleted the feat/api-personal-create-description branch October 4, 2026 17:24
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.

1 participant