Skip to content

fix(settings): show project full name in settings sidebar ProjectSelector - #2674

Open
Sebastian-ubs wants to merge 3 commits into
paranext:mainfrom
Sebastian-ubs:fix/settings-sidebar-project-full-name
Open

fix(settings): show project full name in settings sidebar ProjectSelector#2674
Sebastian-ubs wants to merge 3 commits into
paranext:mainfrom
Sebastian-ubs:fix/settings-sidebar-project-full-name

Conversation

@Sebastian-ubs

@Sebastian-ubs Sebastian-ubs commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

The settings sidebar's <ProjectSelector> was rendering each project as a single-line row (shortName only). Every other <ProjectSelector> consumer in the app (manage-books, checks side panel) shows a two-line row: short name over a muted full name. This PR aligns the settings sidebar with that pattern.

Root cause

SettingsSidebar accepts a public ProjectInfo shape with a single projectName string. Its internal adapter mirrored that string into both shortName and fullName on the ProjectSelectorProject, which trips ProjectSelector's fullName === shortName de-dup rule (present to avoid rendering the same string twice) — so the second line was correctly suppressed. That behaviour is right for callers that genuinely only have one name; the settings sidebar isn't one of them.

Fix, at the source

  • Extend SettingsSidebar.ProjectInfo with an optional projectFullName. The adapter now uses projectFullName ?? projectName for fullName. When callers upgrade to supply it, rows render two lines. When they don't, the de-dup rule still collapses to a single line — no visual regression.
  • settings-tab.component.tsx — the only in-repo consumer of SettingsSidebar — replaces its single-setting getProjectName helper with getProjectNames, which fetches platform.name and platform.fullName in parallel from the platform.base PDP. This mirrors the pattern in extensions/src/platform-scripture/src/checks-side-panel.web-view.tsx:43-48. Empty platform.fullName is collapsed to undefined so projects without one still render single-line.

Test plan

  • Open the settings tab in-app with a project that has distinct platform.name and platform.fullName (e.g. any manage-books-visible standard project). Confirm the sidebar's project picker rows now show short name over full name.
  • Open the same tab with a legacy project that has no platform.fullName set (or an empty one). Confirm the row still renders as a single line (short name only).
  • npm run typecheck:core — clean.
  • npm --workspace lib/platform-bible-react run lint — clean.
  • npm --workspace lib/platform-bible-react run test -- --run src/stories/advanced/settings/settings-sidebar.stories.tsx — 6 story smoke-tests pass.

Scope

This PR only touches the settings-tab / SettingsSidebar path. Consumers of SettingsSidebar outside this repo (if any) don't need to change — projectFullName is optional and the fallback preserves prior behaviour.

AI-assisted.


This change is Reviewable

before:
image

after:
image

…lector

The settings sidebar's <ProjectSelector> was adapting its ProjectInfo
input by mirroring `projectName` into both `shortName` and `fullName`
(see the compromise comment on settings-sidebar.component.tsx). That
tripped the selector's `fullName === shortName` de-dup rule and rows
rendered a single line, unlike every other <ProjectSelector> in the app
(manage-books, checks side panel), which query `platform.fullName`
alongside `platform.name` and pass both through.

Fix at the source:

* Extend the SettingsSidebar public `ProjectInfo` shape with an optional
  `projectFullName`. When present it feeds the selector's `fullName`;
  when absent the adapter still mirrors `projectName` so the de-dup rule
  keeps single-line rendering (no visual regression for consumers who
  don't upgrade).
* settings-tab.component.tsx (the only in-repo caller) replaces its
  single-setting `getProjectName` helper with a `getProjectNames` that
  fetches `platform.name` and `platform.fullName` in parallel — mirroring
  `checks-side-panel.web-view.tsx:43-48`. Empty `platform.fullName` is
  collapsed to undefined so legacy projects still render a single line.

Co-authored-by: Claude <noreply@anthropic.com>
Sebastian-ubs and others added 2 commits August 13, 2026 19:54
The settings sidebar's <ProjectSelector> now sets
`triggerLabelFormat="shortNameAndFullName"`, matching the manage-books
wide sidebar. Legacy projects (empty `platform.fullName`) still
collapse to shortName-only via the selector's de-dup rule, so no
visual regression there.

Story updates so the layouts are visible in Storybook:

* settings-sidebar.stories.tsx: sampleProjects now carries distinct
  `projectName` (short) + `projectFullName` (long). Without both, the
  de-dup rule flattens the trigger and rows to a single line.
* project-selector.stories.tsx: added `ShortNameTriggerLabel` at the
  same 320px width as `WideTriggerLabel` for a side-by-side compare.

Includes the platform-bible-react dist rebuild so the renderer picks
up the new ProjectInfo shape.

Co-authored-by: Claude <noreply@anthropic.com>
Two legacy-project fixture stories now lead the single-project region:

* `ShortNameTriggerLabel` — `triggerLabelFormat="shortName"` with
  `fullName` mirrored to `shortName`, so both trigger and popover rows
  collapse to a single line.
* `ShortNameTriggerLabelNoScrollGroups` — same fixtures with
  `openTabs={[]}`, suppressing the scroll-group chips and rendering
  every row muted (the "not open anywhere" state).

`SingleProject` and `WideTriggerLabel` follow so the docs read
short → short-plain → default → wide.

Co-authored-by: Claude <noreply@anthropic.com>
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