Add the ZO version number to the footer#3052
Conversation
WalkthroughFooter now uses i18n to display a rights disclaimer and an app version line sourced from a global VERSION defined via Vite. Vite config reads version from apps/zzz-frontend/package.json. English locale adds ui:rightsDisclaimer and ui:appVersion strings. Previous commit-hash build text is removed. Changes
Sequence Diagram(s)sequenceDiagram
participant App
participant Footer
participant i18n as i18n(ui)
participant Vite as __VERSION__
participant Browser as Browser
App->>Footer: Render
Footer->>i18n: t('rightsDisclaimer'), Trans('appVersion', {version})
Note over Footer,i18n: Localized strings resolve
Footer->>Vite: Read __VERSION__
Footer->>Browser: Render link (current version or releases)
Browser-->>Footer: Opens in new tab (noreferrer)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing touches
🧪 Generate unit tests
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. 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 Pre-merge checks❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
|
|
[zzz-frontend] [Tue Sep 16 10:20:44 UTC 2025] - Deployed 2c53758 to https://genshin-optimizer-prs.github.io/pr/3052/zzz-frontend (Takes 3-5 minutes after this completes to be available) [Tue Sep 16 18:53:09 UTC 2025] - Deleted deployment |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (6)
libs/zzz/localization/assets/locales/en/ui.json (1)
15-15: Trans index brittleness (use of <1> placeholder).Double‑check your react‑i18next version’s indexing. Numeric placeholders can be touchy; if the component order changes or the lib expects <0>, text won’t map. Consider named tags or passing components via the
componentsprop to avoid index drift.apps/zzz-frontend/src/app/Footer.tsx (5)
52-52: Bug: link renders “[object Object]” in fallback.The anchor child is an object, so if the translation key is missing you’ll see “[object Object]”. Render the string version directly.
Apply:
- {{ version: __VERSION__ } as any} + {__VERSION__}
44-47: Guard against undefined envs to avoid “undefined/releases”.If NX_URL_GITHUB_GO isn’t set, the href becomes “undefined/releases”.
Apply:
- href={ - process.env.NX_URL_GITHUB_GO_CURRENT_VERSION || - `${process.env.NX_URL_GITHUB_GO}/releases` - } + href={ + (process.env.NX_URL_GITHUB_GO_CURRENT_VERSION ?? + (process.env.NX_URL_GITHUB_GO + ? `${process.env.NX_URL_GITHUB_GO}/releases` + : '#')) + }Optional: if no URL, render plain text instead of a link.
14-14: Optional: compute href once for clarity.Small readability tweak so I don’t fat‑finger envs at 3am banner farming.
Apply:
const { t } = useTranslation('ui') + const releaseUrl = + process.env.NX_URL_GITHUB_GO_CURRENT_VERSION ?? + (process.env.NX_URL_GITHUB_GO + ? `${process.env.NX_URL_GITHUB_GO}/releases` + : undefined)Then use
href={releaseUrl ?? '#'}.
37-41: Trans mapping: verify index alignment with locale string.Your locale uses
<1>{{version}}</1>. Ensure this matches Trans’s component indexing in your version of react‑i18next; otherwise the link wrapper might not be applied. Named tags orcomponentsprop would be safer.
43-51: Style nit: prefer MUI Link or sx over inline style.For consistency with MUI theming, consider
<Link>withsx={{ ml: 0.5, color: 'inherit' }}instead of raw<a style={{ ... }}>.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
apps/zzz-frontend/src/app/Footer.tsx(3 hunks)apps/zzz-frontend/vite.config.mts(1 hunks)libs/zzz/localization/assets/locales/en/ui.json(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: lint
- GitHub Check: gen-file
- GitHub Check: typecheck
- GitHub Check: test
🔇 Additional comments (3)
apps/zzz-frontend/vite.config.mts (1)
9-9: Confirm version source switch (root → app-local).You’re now reading version from apps/zzz-frontend/package.json. If “ZO version” is intended to reflect the overall workspace/release tag (root package.json), this could drift. Intentional?
If you meant root, revert to:
-import pkg from './package.json' assert { type: 'json' } +import pkg from '../../package.json' assert { type: 'json' }libs/zzz/localization/assets/locales/en/ui.json (1)
14-15: New i18n strings look good.Keys and copy read fine; no JSON issues. My sleep debt approves.
apps/zzz-frontend/src/app/Footer.tsx (1)
5-5: Ambient VERSION decl is appropriate.Matches Vite
defineusage; TS will be happy.
|
I think this change should also affect #2940 |
Describe your changes
Issue or discord link
Testing/validation
Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)
yarn run mini-cilocally to validate format and lint.Summary by CodeRabbit