Skip to content

feat(portal): show domain name on project cards #898

Merged
TilmanHaupt merged 6 commits into
mainfrom
til-projectview
Jun 11, 2026
Merged

feat(portal): show domain name on project cards #898
TilmanHaupt merged 6 commits into
mainfrom
til-projectview

Conversation

@TilmanHaupt

@TilmanHaupt TilmanHaupt commented Jun 10, 2026

Copy link
Copy Markdown
Member

Summary

Closes #893

Redesigns the project card layout to show the domain name above the project name, with description truncated to 2 lines. Domain names are resolved by fetching auth/domains in parallel with auth/projects so there is no added latency.

Changes Made

  • ProjectCardView.tsx — new card layout: domain name (small, muted) → project name (h5) → description (2-line clamp, only when present). Replaced ContentHeading with a plain h5 so Juno's global heading styles apply automatically.
  • projectRouter.tsgetAuthProjects now fetches auth/projects and auth/domains in parallel via Promise.all, builds a domain_id → name map, and attaches domain_name to each project.
  • Project schema — added domain_name: z.string().optional() to projectSchema.

Testing Instructions

  1. pnpm i
  2. pnpm run test
  3. Open the projects overview — each card should show the domain name (e.g. Default) above the project name.

Notes

auth/domains is fetched via callIdentityAPI (direct HTTP with the auth token) rather than getUserInfo because the projects overview runs with an unscoped token — unscoped tokens have no service catalog, so getUserInfo's openstackSession.service("identity") returns undefined and the domain fetch silently fails.

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.

Summary by CodeRabbit

  • New Features

    • Project cards now display domain names alongside project information
    • Automatically falls back to domain ID when domain name is unavailable, then displays "Unknown domain"
    • Updated project card layout with improved visual hierarchy
  • Localization

    • Added "Unknown domain" translation support for English and German locales

@TilmanHaupt TilmanHaupt changed the title feat(portal): show domain name on project cards feat(portal): show domain name on project cards Jun 10, 2026
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@TilmanHaupt, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 35 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 66f91379-ba5e-4221-82fe-3f3254423233

📥 Commits

Reviewing files that changed from the base of the PR and between 14efe8c and 569916f.

📒 Files selected for processing (5)
  • packages/aurora/src/locales/de/messages.po
  • packages/aurora/src/locales/de/messages.ts
  • packages/aurora/src/locales/en/messages.po
  • packages/aurora/src/locales/en/messages.ts
  • packages/aurora/src/server/Project/routers/projectRouter.ts
📝 Walkthrough

Walkthrough

Project cards now display domain names by fetching identity domains concurrently with projects on the server, enriching responses with resolved names, and rendering with fallback to domain ID or translated "Unknown domain" on the client.

Changes

Project Card Domain Display Feature

Layer / File(s) Summary
Project schema extension
packages/aurora/src/server/Project/types/models.ts
projectSchema adds optional domain_name: string field to hold resolved domain names.
Server-side domain enrichment
packages/aurora/src/server/Project/routers/projectRouter.ts, packages/aurora/src/server/Project/routers/projectRouter.test.ts
getAuthProjects fetches auth/domains concurrently with projects, builds a domain ID→name map, and enriches each project with resolved domain_name. Tests verify successful enrichment, missing-domain fallback, missing-session rejection, and graceful failure when domains API errors.
Client-side UI and tests
packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.tsx, packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.test.tsx
Component renders domain label with fallback chain (domain_name → domain_id → translated "Unknown domain"), displays project name as plain h5, and conditionally shows description. Tests verify domain rendering, fallback behavior, and description omission when absent.
Localization
packages/aurora/src/locales/en/messages.po, packages/aurora/src/locales/de/messages.po
Added "Unknown domain" translation entries for English and German locales.
Release notes
.changeset/full-signs-cheat.md
Changeset documents minor version bump and domain name display feature using new Juno heading system.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested labels

aurora-portal

Suggested reviewers

  • andypf
  • mark-karnaukh-extern-sap

Poem

🐰 With whiskers twitched and nose held high,
Projects now wear their domains nigh!
From API mists to cards so bright,
Domain names dance in styled light.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: displaying domain names on project cards, which is the primary objective of this PR.
Description check ✅ Passed The description covers all required sections: Summary with issue reference, Changes Made (with file-level details), Testing Instructions, Notes on implementation, and Checklist. Most sections are complete and informative.
Linked Issues check ✅ Passed The PR successfully implements the visual redesign shown in issue #893 by updating ProjectCardView to display domain names above project names, matching the linked issue's objective.
Out of Scope Changes check ✅ Passed All changes are directly related to the domain-name display feature: UI updates, backend domain fetching, schema updates, tests, and localization strings. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch til-projectview

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 and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the projects overview cards to display each project’s domain name (resolved from Keystone) above the project name, and adjusts the card layout to clamp descriptions to two lines. It also extends the server-side Project schema/response to include an optional domain_name derived from auth/domains.

Changes:

  • Add domain_name to the Project schema and attach it server-side by fetching auth/projects and auth/domains.
  • Redesign project cards to render domain label → project name (h5) → optional 2-line-clamped description.
  • Add a changeset to release the feature as a minor version bump.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/aurora/src/server/Project/types/models.ts Extends the Project Zod schema with optional domain_name.
packages/aurora/src/server/Project/routers/projectRouter.ts Fetches domains alongside projects and enriches projects with domain_name.
packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.tsx Updates card layout to display domain label and clamp description.
.changeset/full-signs-cheat.md Declares a minor changeset for the feature.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/aurora/src/server/Project/routers/projectRouter.ts
Comment thread packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.tsx Outdated
Comment thread packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.tsx Outdated
…domain fallback

- domains fetch is now best-effort: failure yields empty map, projects still return
- guard .json() parse against invalid JSON responses
- render <Trans>Unknown domain</Trans> when neither domain_name nor domain_id is available
- update tests to cover domains-fetch failure and unknown-domain fallback

@andypf andypf left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Like it, keep working on it

Comment thread packages/aurora/src/server/Project/routers/projectRouter.ts
@TilmanHaupt TilmanHaupt marked this pull request as ready for review June 11, 2026 12:16
@TilmanHaupt TilmanHaupt requested a review from a team as a code owner June 11, 2026 12:16
# Conflicts:
#	packages/aurora/src/locales/de/messages.ts
#	packages/aurora/src/locales/en/messages.ts

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.test.tsx (1)

67-78: ⚡ Quick win

Add coverage for the third fallback branch (Unknown domain).

Line 67 covers domain_id fallback, but there’s no test for when both domain_name and domain_id are missing. Please add one assertion for the localized "Unknown domain" path to fully cover the new fallback chain.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.test.tsx`
around lines 67 - 78, Add a new test for ProjectCardView that simulates the
third fallback by rendering a project with both domain_name and domain_id set to
undefined and asserting the localized "Unknown domain" text is rendered; reuse
the I18nProvider/i18n and pattern from the existing test ("falls back to
domain_id when domain_name is missing") but create a projectLike variable such
as [{ ...projects[0], domain_name: undefined, domain_id: undefined }] and in the
waitFor assert screen.getByText(/Unknown domain|localized string/) or the exact
i18n key’s resolved string to cover the `Unknown domain` fallback branch in
ProjectCardView.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.changeset/full-signs-cheat.md:
- Line 5: The changeset message incorrectly says a "new juno heading system" was
used; update the description to accurately reflect the implementation in
ProjectCardView.tsx by stating that ContentHeading was replaced with a plain h5
element and that the change shows domain name on project cards by fetching
auth/domains (remove any mention of a Juno heading component). Ensure the text
references the actual behavior (replaced ContentHeading -> h5 and fetch
auth/domains to display domain) so it matches the code.

In `@packages/aurora/src/locales/de/messages.po`:
- Around line 3112-3113: The PO entry for msgid "Unknown domain" has an empty
msgstr; update the locale file (packages/aurora/src/locales/de/messages.po) by
filling msgstr for the msgid "Unknown domain" with the German translation (e.g.,
"Unbekannte Domain") so German users see the localized string instead of the
English fallback.

In `@packages/aurora/src/server/Project/routers/projectRouter.ts`:
- Around line 116-119: The parsed domainsResponse is not runtime-validated like
projectsResponseSchema, so create a domainsResponseSchema (e.g., z.object({
domains: z.array(z.object({ id: z.string(), name: z.string() })) })) and use
domainsResponseSchema.safeParse(domainsData) before constructing domainMap; if
safeParse fails, treat domainsData as null/empty (same fallback behavior as
projects parsing) and only map validated items to build domainMap from the
parsed.data.domains to ensure domain_name values are safe.

---

Nitpick comments:
In
`@packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.test.tsx`:
- Around line 67-78: Add a new test for ProjectCardView that simulates the third
fallback by rendering a project with both domain_name and domain_id set to
undefined and asserting the localized "Unknown domain" text is rendered; reuse
the I18nProvider/i18n and pattern from the existing test ("falls back to
domain_id when domain_name is missing") but create a projectLike variable such
as [{ ...projects[0], domain_name: undefined, domain_id: undefined }] and in the
waitFor assert screen.getByText(/Unknown domain|localized string/) or the exact
i18n key’s resolved string to cover the `Unknown domain` fallback branch in
ProjectCardView.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: aa597158-b0cd-426b-87c0-01a1ac29ac66

📥 Commits

Reviewing files that changed from the base of the PR and between 296e2ff and 14efe8c.

📒 Files selected for processing (10)
  • .changeset/full-signs-cheat.md
  • packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.test.tsx
  • packages/aurora/src/client/routes/_auth/projects/-components/ProjectCardView.tsx
  • packages/aurora/src/locales/de/messages.po
  • packages/aurora/src/locales/de/messages.ts
  • packages/aurora/src/locales/en/messages.po
  • packages/aurora/src/locales/en/messages.ts
  • packages/aurora/src/server/Project/routers/projectRouter.test.ts
  • packages/aurora/src/server/Project/routers/projectRouter.ts
  • packages/aurora/src/server/Project/types/models.ts

Comment thread .changeset/full-signs-cheat.md
Comment thread packages/aurora/src/locales/de/messages.po
Comment thread packages/aurora/src/server/Project/routers/projectRouter.ts
@TilmanHaupt TilmanHaupt merged commit fc1bc08 into main Jun 11, 2026
21 checks passed
@TilmanHaupt TilmanHaupt deleted the til-projectview branch June 11, 2026 12:44
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.

[Feature](context): new ProjectView

5 participants