Skip to content

feat(api): return a profile row's server title in profile section settings - #1900

Merged
Quick104 merged 6 commits into
feat/collections-revampfrom
feat/api-profile-section-default-title
Oct 4, 2026
Merged

Quick104 merged 6 commits into
feat/collections-revampfrom
feat/api-profile-section-default-title

Conversation

@Quick104

@Quick104 Quick104 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

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. getProfileSectionSettings returns 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_title to each item from GET /api/v2/profile/sections/settings. It holds the administrator's own title for the row and is empty for a row the profile built. title keeps its meaning: the title the profile sees.

Approach

  • sections.ResolveForSettings keeps the admin section's stored title next to the profile's effective one. Resolve, which builds Home, is unchanged. The new ResolvedSection field is never serialized, because v1 and Home response bodies embed that struct. v1 /profile/sections/settings builds its own response and is unchanged.
  • Restoring the original name needs no new write: saving an empty title override already falls back to the admin title.
  • The change is /api/v2 only. 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 web SettingsSectionEntry type gets an optional default_title for the follow-up Home Screen change; nothing reads it yet.
  • The field is documented in docs/architecture/api-contract.md, which already describes the profile sections contract. No docs/*-api.md file covers these routes.
  • This PR has no UI, so none of the redesign's deviations from the approved mockups apply here.
  • No silo-apple, silo-android, or jellycompat follow-up is needed. The field is additive, and the Jellyfin surface has no equivalent settings read.

Validation

  • Go unit and handler tests cover three cases: a renamed row returns both titles, an untouched row returns its title twice, and a profile-built row has an empty default_title. They also check that the field never reaches ResolvedSection JSON and assert the exact v2 response body. Pass.
  • A DB test runs through the real section repository and the Postgres profile store. After an admin renames a row the profile already renamed, default_title follows 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, and make lint-changed against the base branch: clean.
  • go test for internal/sections and internal/apiv2 (including TestCommittedArtifactMatchesRouter) against a migrated database: pass.
  • go test ./internal/api/handlers/... against a migrated database: the new test passes. TestAdminSubtitleListPageDB and TestCatalogTransferPersistsJobsAndSignedLink fail 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, and verify-local-paths: current. verify-apiv2-fixtures-siblings skipped the Apple and Android copies because those repos were not checked out.
  • make verify-apiv2-contract against the base branch: one info-level change (response-required-property-added on getProfileSectionSettings), nothing breaking.
  • Web lint, format:check, tsc -b, build, budget:check, and make test-web: pass.
  • No validated case is affected. Curated home sections — Server #1140 C2 reads this route, but it has no recorded result, and this PR adds a response field without changing the order saves or authorization that case checks.

Risks

  • Profiles that saved Home Screen settings before this change carry a copy of every admin row's title in their overrides, because the web saved the full entry for every row. After an administrator renames such a row, title and default_title differ 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.
  • For seasonal rows, default_title is the stored admin title. While a theme is active, Home shows the theme's name instead. The settings title already returns the stored title for these rows, and default_title does the same.

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 checked the diff against the planned scope and both callers of the settings resolver (v1 and v2). It reran the resolver, handler, and DB tests, confirmed they fail without the fill line, and reran the contract checks. It approved with two notes, and neither needed a code change. First, titles pinned by older saves will look like renames after an admin rename; that is recorded under Risks for the web change that reads the field. Second, the field is documented in api-contract.md rather than a docs/*-api.md file; that is recorded under Approach.

🤖 Generated with Claude Code

Note

Add administrator default_title to profile section settings API

  • getProfileSectionSettings now returns each row's administrator title as default_title alongside the profile-visible title; profile-built rows get an empty default_title.
  • resolver.go seeds ResolvedSection.DefaultTitle from the administrator section's title before applying profile overrides, so a profile rename changes only Title. The new field is json:"-" in types.go, so v1 ResolvedSection JSON is unchanged.
  • Updates the OpenAPI contract, fixtures, generated schema, and web types.ts typing.
  • Behavioral Change: v2 profile section settings responses gain a required default_title string; contract consumers must accept the new field.

Macroscope summarized d23fecc.

…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]>
@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: c5175b65-5a41-4e2d-8acf-7f9361395979

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-04T18:00:46.037845Z d23fecc 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.

@macroscopeapp

macroscopeapp Bot commented Oct 4, 2026

Copy link
Copy Markdown

The current Validation tasks: reaches #1140 C2 line does not identify a recorded result this PR changes: #1140 C2 and the other linked Curated home sections cases are all Not run. The PR adds default_title to the v2 settings response but leaves C2's order persistence and direct-update authorization behavior unchanged. Please replace the line with:

Validation tasks: none

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
@Quick104

Quick104 commented Oct 4, 2026

Copy link
Copy Markdown
Contributor Author

Changed the PR body to Validation tasks: none: #1140 C2 has no recorded result, and this PR does not change the order saves or authorization it checks.

@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: 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"`

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 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 👍 / 👎.

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.

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).

Base automatically changed from feat/home-rows-profile-rule-switch to feat/collections-revamp October 4, 2026 15:02
Quick104 and others added 4 commits October 4, 2026 13:05
…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
@Quick104
Quick104 merged commit 26ed81c into feat/collections-revamp Oct 4, 2026
15 checks passed
@Quick104
Quick104 deleted the feat/api-profile-section-default-title branch October 4, 2026 18:18
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