Repository navigation
feat(api): return a profile row's server title in profile section settings - #1900
Conversation
…tings getProfileSectionSettings only returned the effective title, so the profile Home rows screen could not show that a row was renamed or offer the original name back. The v2 response now adds default_title, the administrator's own title for each admin row (empty for rows the profile built). The field is additive; the frozen v1 settings body is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The current
Automated check: Macroscope check run agent (gpt-6-luna). No validation was performed. Posted via Macroscope — v1 validation impact |
…ch' into feat/api-profile-section-default-title
|
Changed the PR body to |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1fd17e92d9
ℹ️ 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".
| ID string `json:"id" example:"s-continue-watching"` | ||
| SectionType string `json:"section_type" doc:"The recipe; the set is extensible" example:"continue_watching"` | ||
| Title string `json:"title" doc:"The title this profile sees: its own title override, or the administrator's title" example:"Continue Watching"` | ||
| DefaultTitle string `json:"default_title" doc:"The administrator's title for this row; title shows it unless the profile saved a title override. Empty for a section the profile built" example:"Continue Watching"` |
There was a problem hiding this comment.
Advertise default-title support through a capability
Adding default_title without extending a profile-sections capability leaves newer clients without the required support signal when they connect to an older server or a mixed-version cluster. Such clients must infer support from field presence or the server version/digest before enabling rename/reset behavior, even though repository policy requires new client-visible features to expose a capability endpoint; add an explicit capability field and keep it false or absent on implementations that cannot return the title.
AGENTS.md reference: AGENTS.md:L146-L150
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not adding a capability for this. default_title is an extra read-only field on an existing response, not optional behavior a client sends. It is serialized on every row (no omitempty), so its presence is the support signal: an older server omits it, and a client then just doesn't show "Renamed from" or offer the original name. Restoring the name saves an empty title override, which older servers already accept, so nothing new is sent to a server that lacks the field. The contract's capability-document rule covers optional domains and optional request behavior, and the v2 contract is not locked yet. Dismissed on #1913 (follow-up for late findings).
…at/api-profile-section-default-title # Conflicts: # contracts/api/v2/fixtures/get_system_info_ok.json
The #1615 approvals came in with the feat/collections-revamp merge. This branch's contract diff against that base no longer contains those removals, so the contract check reports every approval as stale. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…at/api-profile-section-default-title # Conflicts: # contracts/api/v2/fixtures/get_system_info_ok.json
…at/api-profile-section-default-title # Conflicts: # contracts/api/v2/fixtures/get_system_info_ok.json
Problem
Related issue: #1137
Validation tasks: none
Stacked on #1898. Merge that first; this PR targets its branch.
Settings > Home Screen cannot tell a profile which rows it renamed.
getProfileSectionSettingsreturns only the title the profile sees, so a client cannot show "Renamed from Continue Watching" or offer the original name back. The Home rows redesign needs both on the profile's Home Screen settings.This PR adds
default_titleto each item fromGET /api/v2/profile/sections/settings. It holds the administrator's own title for the row and is empty for a row the profile built.titlekeeps its meaning: the title the profile sees.Approach
sections.ResolveForSettingskeeps the admin section's stored title next to the profile's effective one.Resolve, which builds Home, is unchanged. The newResolvedSectionfield is never serialized, because v1 and Home response bodies embed that struct. v1/profile/sections/settingsbuilds its own response and is unchanged.titleoverride already falls back to the admin title./api/v2only. The OpenAPI document, fixtures (including the contract digest in the system-info fixture), generated web types, and the migration ledger note are regenerated. The hand-written webSettingsSectionEntrytype gets an optionaldefault_titlefor the follow-up Home Screen change; nothing reads it yet.docs/architecture/api-contract.md, which already describes the profile sections contract. Nodocs/*-api.mdfile covers these routes.Validation
default_title. They also check that the field never reachesResolvedSectionJSON and assert the exact v2 response body. Pass.default_titlefollows the admin rename and the profile's own name stays. Pass. The resolver and DB tests fail with the new fill line removed.go build ./...,gofmt,go vet, andmake lint-changedagainst the base branch: clean.go testforinternal/sectionsandinternal/apiv2(includingTestCommittedArtifactMatchesRouter) against a migrated database: pass.go test ./internal/api/handlers/...against a migrated database: the new test passes.TestAdminSubtitleListPageDBandTestCatalogTransferPersistsJobsAndSignedLinkfail locally on timestamp comparisons. They fail the same way at the base commit, and this diff does not touch them.make verify-apiv2-openapi,verify-apiv2-fixtures,verify-apiv2-web-types,verify-migration-ledger,verify-route-inventory,verify-scenario-catalogs, andverify-local-paths: current.verify-apiv2-fixtures-siblingsskipped the Apple and Android copies because those repos were not checked out.make verify-apiv2-contractagainst the base branch: one info-level change (response-required-property-addedongetProfileSectionSettings), nothing breaking.format:check,tsc -b, build,budget:check, andmake test-web: pass.Risks
titleanddefault_titlediffer even though nobody on the profile chose a name. The field reports the stored data correctly. The web change that reads it has to decide how to present these rows. Saving an empty title or resetting the profile's overrides clears the copy.default_titleis the stored admin title. While a theme is active, Home shows the theme's name instead. The settingstitlealready returns the stored title for these rows, anddefault_titledoes the same.Checklist
AI Disclosure
api-contract.mdrather than adocs/*-api.mdfile; that is recorded under Approach.🤖 Generated with Claude Code
Note
Add administrator
default_titleto profile section settings APIgetProfileSectionSettingsnow returns each row's administrator title asdefault_titlealongside the profile-visibletitle; profile-built rows get an emptydefault_title.ResolvedSection.DefaultTitlefrom the administrator section's title before applying profile overrides, so a profile rename changes onlyTitle. The new field isjson:"-"in types.go, so v1ResolvedSectionJSON is unchanged.default_titlestring; contract consumers must accept the new field.Macroscope summarized d23fecc.