Skip to content

Add the ZO version number to the footer#3052

Merged
nguyentvan7 merged 1 commit into
frzyc:masterfrom
failchon:failchon/zzz/add-version-number
Sep 16, 2025
Merged

Add the ZO version number to the footer#3052
nguyentvan7 merged 1 commit into
frzyc:masterfrom
failchon:failchon/zzz/add-version-number

Conversation

@failchon

@failchon failchon commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

Describe your changes

  • Add the ZO version number to the footer

Issue or discord link

Testing/validation

image

Checklist before requesting a review (leave this PR as draft if any part of this list is not done.)

  • I have commented my code in hard-to understand areas.
  • I have made corresponding changes to README or wiki.
  • For front-end changes, I have updated the corresponding English translations.
  • I have run yarn run mini-ci locally to validate format and lint.
  • If I have added a new library or app, I have updated the deployment scripts to ignore changes as needed

Summary by CodeRabbit

  • New Features
    • Footer now uses localization for text.
    • Added a rights disclaimer in the footer.
    • Version display is localized and includes a link to the corresponding release, opening in a new tab.
  • Style
    • Adjusted footer layout: right-aligned caption and added spacing to the version link.
  • Chores
    • Updated build configuration to source the app version from the app’s package metadata.
  • Localization
    • Added new translation keys for the rights disclaimer and app version.

@coderabbitai

coderabbitai Bot commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Footer 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

Cohort / File(s) Summary
Footer i18n + version
apps/zzz-frontend/src/app/Footer.tsx
Integrates i18n (Trans/useTranslation), declares global __VERSION__, replaces hardcoded build info with ui:rightsDisclaimer and ui:appVersion using { version: __VERSION__ }, updates link target and minor styling, removes commit-hash logic.
Build config version define
apps/zzz-frontend/vite.config.mts
Changes package.json import to ./package.json; __VERSION__ now sourced from app-local package.json.
Localization assets
libs/zzz/localization/assets/locales/en/ui.json
Adds rightsDisclaimer and appVersion keys; adjusts punctuation; no logic 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)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

Suggested labels

ZO

Suggested reviewers

  • nguyentvan7
  • frzyc

Poem

Night shift again, coffee at pity 90, eyes aglow—
Footer whispers versions only owls should know.
Strings transmute with i18n’s gentle art,
Vite forges VERSION like a limited banner start.
Click the link, new tab rolls—no refills, just flow.
Ship it before the dailies reset, let’s go!

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Pre-merge checks

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed Title "Add the ZO version number to the footer" succinctly and accurately describes the primary change in this PR (adding the app/version display to the footer). It is concise, specific, and easy for reviewers to scan. I'm bleary-eyed but this one reads fine.
Description Check ✅ Passed Somnia here, bleary-eyed and clutching my last gacha roll: the PR description matches the repository template and includes a concise change summary, an issue reference (fix #2938), and a testing screenshot, so the main required sections are present and on-topic. The checklist section exists but all items are unchecked, notably the "updated English translations" box which is relevant given the localization files changed. Because the description is otherwise clear and targeted, I consider this mostly complete and mark the check as a pass while flagging the unchecked checklist for follow-up.

@github-actions

github-actions Bot commented Sep 16, 2025

Copy link
Copy Markdown
Contributor

[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

@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: 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 components prop 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 or components prop would be safer.


43-51: Style nit: prefer MUI Link or sx over inline style.

For consistency with MUI theming, consider <Link> with sx={{ ml: 0.5, color: 'inherit' }} instead of raw <a style={{ ... }}>.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ec80999 and 9df1bac.

📒 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 define usage; TS will be happy.

@failchon failchon marked this pull request as draft September 16, 2025 10:28
@failchon failchon marked this pull request as ready for review September 16, 2025 10:32
@failchon failchon marked this pull request as draft September 16, 2025 10:36
@failchon failchon marked this pull request as ready for review September 16, 2025 11:10
@failchon

Copy link
Copy Markdown
Contributor Author

I think this change should also affect #2940

@nguyentvan7 nguyentvan7 merged commit 21f4652 into frzyc:master Sep 16, 2025
7 checks passed
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.

ZO: Add the ZO version number to the footer

2 participants