From c5f1ce95ecd35b89764e5dde917b80d48b18eed6 Mon Sep 17 00:00:00 2001 From: preetham Date: Thu, 12 Feb 2026 00:52:28 +0530 Subject: [PATCH] fix(frontend): make dev footer version link to commit (fixes #3892) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Footer version is now always a clickable link - Production: links to release tag (unchanged) - Non-production with dash in RELEASE_VERSION: links to commit (e.g. 24.2.10-12c25c5 → /commit/12c25c5) - Non-production without dash: falls back to release tag URL - Added unit tests for Version Link Behavior Co-authored-by: Cursor --- .../__tests__/unit/components/Footer.test.tsx | 49 +++++++++++++++++++ frontend/src/components/Footer.tsx | 22 ++++----- 2 files changed, 60 insertions(+), 11 deletions(-) diff --git a/frontend/__tests__/unit/components/Footer.test.tsx b/frontend/__tests__/unit/components/Footer.test.tsx index 234daa3553..1187804509 100644 --- a/frontend/__tests__/unit/components/Footer.test.tsx +++ b/frontend/__tests__/unit/components/Footer.test.tsx @@ -275,6 +275,55 @@ describe('Footer', () => { }) }) + describe('Version Link Behavior', () => { + let originalEnvironment: string + let originalReleaseVersion: string + let envModule: typeof import('utils/env.client') + + beforeEach(() => { + jest.clearAllMocks() + envModule = jest.requireMock('utils/env.client') + originalEnvironment = envModule.ENVIRONMENT + originalReleaseVersion = envModule.RELEASE_VERSION + }) + + afterEach(() => { + if (envModule) { + envModule.ENVIRONMENT = originalEnvironment + envModule.RELEASE_VERSION = originalReleaseVersion + } + }) + + test('renders version as commit link in non-production environment', () => { + envModule.ENVIRONMENT = 'staging' + envModule.RELEASE_VERSION = '24.2.10-12c25c5' + + const { container } = render(