Skip to content

feat: add Go back action to NotFound page with safe fallback#38583

Open
gauravsingh001-cyber wants to merge 4 commits intoRocketChat:developfrom
gauravsingh001-cyber:feat/notfound-go-back-action
Open

feat: add Go back action to NotFound page with safe fallback#38583
gauravsingh001-cyber wants to merge 4 commits intoRocketChat:developfrom
gauravsingh001-cyber:feat/notfound-go-back-action

Conversation

@gauravsingh001-cyber
Copy link
Copy Markdown
Contributor

@gauravsingh001-cyber gauravsingh001-cyber commented Feb 10, 2026

Proposed changes

This PR adds a Go back action to the NotFound page.

  • Allows users to return to the previous page when navigation history exists
  • Falls back safely to /home when the page is accessed directly
  • Improves UX by preventing dead-end navigation on NotFound routes

Issue(s)

Closes #38581

Steps to test or reproduce

  1. Navigate to any internal route
  2. Open a non-existing route to trigger the NotFound page
  3. Click Go back → should return to the previous page
  4. Open a NotFound route directly via URL
  5. Click Go back → should redirect to /home

Further comments

UI-only change. No breaking behavior.

AfterChange

1stPR.mp4

Summary by CodeRabbit

  • New Features
    • Added a "Go Back" action on the error page to navigate back in history (falls back to Home when needed).
    • Kept the existing Home action.
    • Improved action layout and spacing for clearer, more accessible navigation.

@gauravsingh001-cyber gauravsingh001-cyber requested a review from a team as a code owner February 10, 2026 13:36
@dionisio-bot
Copy link
Copy Markdown
Contributor

dionisio-bot bot commented Feb 10, 2026

Looks like this PR is not ready to merge, because of the following issues:

  • This PR is missing the 'stat: QA assured' label
  • This PR is missing the required milestone or project

Please fix the issues and try again

If you have any trouble, please check the PR guidelines

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 10, 2026

⚠️ No Changeset found

Latest commit: ee884c5

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Feb 10, 2026

CLA assistant check
All committers have signed the CLA.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 10, 2026

Walkthrough

NotFoundState adds a new "Go back" action that navigates back via router.navigate(-1). The UI now includes a "Go_back" button alongside the existing "Homepage" action; import and JSX formatting were restructured. No exported/public signatures changed.

Changes

Cohort / File(s) Summary
NotFoundState navigation & UI
apps/meteor/client/components/NotFoundState.tsx
Reformatted import/JSX layout; added handleGoBackClick which calls router.navigate(-1) and a new "Go_back" action button next to the existing "Homepage" action. No public API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

I hopped upon a missing page with whiskers all a-quiver,
A tiny "Go back" paw to nudge the path you were delivered.
If home you still prefer, that button stays in sight —
Hop safe, return, or onward roam; the rabbit guards the night. 🐰

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding a 'Go back' action to the NotFound page with a safe fallback mechanism, which directly matches the primary objective of the PR.
Linked Issues check ✅ Passed The implementation successfully addresses all coding requirements from issue #38581: adds a Go back button alongside the Homepage button, uses router.navigate(-1) for in-app navigation with safe fallback behavior as required.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue objective. The PR includes import formatting and UI adjustments needed to add the Go back functionality; no unrelated modifications detected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


No actionable comments were generated in the recent review. 🎉

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c409f8e and ee884c5.

📒 Files selected for processing (1)
  • apps/meteor/client/components/NotFoundState.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/meteor/client/components/NotFoundState.tsx

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/meteor/client/components/NotFoundState.tsx`:
- Around line 27-34: The guard using window.history.length in handleGoBackClick
is unreliable and can send users outside the app; replace it by tracking in-app
navigation state and using that instead: add a ref/flag (e.g., in a
component-level ref or a shared router hook) that is set on route changes and
check that flag inside handleGoBackClick to decide between calling
window.history.back() and router.navigate('/home'); update any route-change
listener or use the router's navigation/canGoBack API if available to maintain
the flag so handleGoBackClick only calls history.back() for internal
navigations.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7045358 and 6bfcd4b.

📒 Files selected for processing (1)
  • apps/meteor/client/components/NotFoundState.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/components/NotFoundState.tsx
🧠 Learnings (1)
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.

Applied to files:

  • apps/meteor/client/components/NotFoundState.tsx
⏰ 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). (1)
  • GitHub Check: cubic · AI code reviewer
🔇 Additional comments (3)
apps/meteor/client/components/NotFoundState.tsx (3)

1-9: Imports look good.

Reformatted to multi-line; no functional changes. The added StatesAction and StatesActions imports align with their usage below.


45-47: Existing Homepage action preserved — LGTM.


49-51: ⚠️ Potential issue | 🔴 Critical

Add Go_back translation key to i18n files.

The t('Go_back') translation key is missing from the i18n resource files. The key Homepage (used on line 46) exists in en.i18n.json, but Go_back (line 50) does not, which will cause it to render the raw key string instead of a translated button label. Add the Go_back key to all language files.

⛔ Skipped due to learnings
Learnt from: d-gubert
Repo: RocketChat/Rocket.Chat PR: 37547
File: packages/i18n/src/locales/en.i18n.json:634-634
Timestamp: 2025-11-19T12:32:29.696Z
Learning: Repo: RocketChat/Rocket.Chat
Context: i18n workflow
Learning: In this repository, new translation keys should be added to packages/i18n/src/locales/en.i18n.json only; other locale files are populated via the external translation pipeline and/or fall back to English. Do not request adding the same key to all locale files in future reviews.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread apps/meteor/client/components/NotFoundState.tsx Outdated
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/meteor/client/components/NotFoundState.tsx">

<violation number="1" location="apps/meteor/client/components/NotFoundState.tsx:29">
P2: `window.history.length > 1` is not a reliable guard for in-app back navigation. The `history.length` property counts all session history entries including those from external origins, meaning users arriving from external sites would be navigated out of the app entirely when clicking "Go back". Additionally, some browsers initialize `history.length` at values > 1 for new tabs.

Consider using `document.referrer` to check if the user came from within the app, or track in-app navigation state separately.</violation>
</file>

Since this is your first cubic review, here's how it works:

  • cubic automatically reviews your code and comments on bugs and improvements
  • Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
  • Add one-off context when rerunning by tagging @cubic-dev-ai with guidance or docs links (including llms.txt)
  • Ask questions if you need clarification on any suggestion

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/meteor/client/components/NotFoundState.tsx Outdated
@gauravsingh001-cyber
Copy link
Copy Markdown
Contributor Author

⚠️ No Changeset found

Latest commit: 6bfcd4b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

This is a UI-only change on the NotFound page and does not require a version bump.
No changeset is needed for this PR.

@gauravsingh001-cyber
Copy link
Copy Markdown
Contributor Author

Actionable comments posted: 1

🤖 Fix all issues with AI agents

In `@apps/meteor/client/components/NotFoundState.tsx`:
- Around line 27-34: The guard using window.history.length in handleGoBackClick
is unreliable and can send users outside the app; replace it by tracking in-app
navigation state and using that instead: add a ref/flag (e.g., in a
component-level ref or a shared router hook) that is set on route changes and
check that flag inside handleGoBackClick to decide between calling
window.history.back() and router.navigate('/home'); update any route-change
listener or use the router's navigation/canGoBack API if available to maintain
the flag so handleGoBackClick only calls history.back() for internal
navigations.

📜 Review details

Thanks for the review!
I’ve updated the logic to avoid external navigation and ensured safe in-app fallback behavior.
Looking forward to your feedback.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@apps/meteor/client/components/NotFoundState.tsx`:
- Around line 27-37: The function handleGoBackClick is mis-indented outside the
component body; move and indent it to match handleGoHomeClick inside the
NotFoundState component so both handlers are defined at the same indentation
level (use the same tab/space style as handleGoHomeClick). Ensure the references
to document.referrer, window.location.origin, window.history.back(), and
router.navigate('/home') remain unchanged and that handleGoBackClick is placed
alongside handleGoHomeClick within the component scope.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6bfcd4b and fd27f06.

📒 Files selected for processing (1)
  • apps/meteor/client/components/NotFoundState.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/components/NotFoundState.tsx
🧠 Learnings (1)
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.

Applied to files:

  • apps/meteor/client/components/NotFoundState.tsx
⏰ 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). (1)
  • GitHub Check: cubic · AI code reviewer
🔇 Additional comments (2)
apps/meteor/client/components/NotFoundState.tsx (2)

49-55: New "Go back" action alongside "Homepage" looks good.

Both actions are clearly presented and the existing Homepage behavior is preserved.


28-36: document.referrer can be empty or suppressed even for in-app navigations.

document.referrer is cleared on manual address-bar entry, bookmarks, and when a strict Referrer-Policy (e.g. no-referrer) is active. The router from @rocket.chat/ui-contexts does not expose a canGoBack flag or navigation history stack. The current implementation with its fallback to /home is the safest approach for handling this case.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment on lines +27 to +37
const handleGoBackClick = () => {
const isInternalReferrer =
document.referrer &&
document.referrer.startsWith(window.location.origin);

if (isInternalReferrer) {
window.history.back();
} else {
router.navigate('/home');
}
};
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.

⚠️ Potential issue | 🟡 Minor

Inconsistent indentation — handleGoBackClick is not indented inside the component body.

handleGoHomeClick (lines 23–25) is indented with a tab inside the component, but handleGoBackClick starts at column 0. This looks like a copy-paste artifact.

Proposed fix
-const handleGoBackClick = () => {
-  const isInternalReferrer =
-    document.referrer &&
-    document.referrer.startsWith(window.location.origin);
-
-  if (isInternalReferrer) {
-    window.history.back();
-  } else {
-    router.navigate('/home');
-  }
-};
+	const handleGoBackClick = () => {
+		const isInternalReferrer =
+			document.referrer &&
+			document.referrer.startsWith(window.location.origin);
+
+		if (isInternalReferrer) {
+			window.history.back();
+		} else {
+			router.navigate('/home');
+		}
+	};
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const handleGoBackClick = () => {
const isInternalReferrer =
document.referrer &&
document.referrer.startsWith(window.location.origin);
if (isInternalReferrer) {
window.history.back();
} else {
router.navigate('/home');
}
};
const handleGoBackClick = () => {
const isInternalReferrer =
document.referrer &&
document.referrer.startsWith(window.location.origin);
if (isInternalReferrer) {
window.history.back();
} else {
router.navigate('/home');
}
};
🤖 Prompt for AI Agents
In `@apps/meteor/client/components/NotFoundState.tsx` around lines 27 - 37, The
function handleGoBackClick is mis-indented outside the component body; move and
indent it to match handleGoHomeClick inside the NotFoundState component so both
handlers are defined at the same indentation level (use the same tab/space style
as handleGoHomeClick). Ensure the references to document.referrer,
window.location.origin, window.history.back(), and router.navigate('/home')
remain unchanged and that handleGoBackClick is placed alongside
handleGoHomeClick within the component scope.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/meteor/client/components/NotFoundState.tsx">

<violation number="1" location="apps/meteor/client/components/NotFoundState.tsx:28">
P2: Using document.referrer to gate history.back() breaks SPA navigation: referrer isn’t updated by client-side routing, so the button often falls back to /home even when there is a valid history stack. Also, without checking history length, opening an internal link in a new tab (referrer present, history length 1) calls history.back() and does nothing, leaving a dead button.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

Comment thread apps/meteor/client/components/NotFoundState.tsx Outdated
Comment on lines +28 to +33
const isInternalReferrer =
document.referrer &&
document.referrer.startsWith(window.location.origin);

if (isInternalReferrer) {
window.history.back();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm quite sure you can get this from the router

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion!

Good point — I’ve updated the implementation to rely on router-based navigation instead of using document.referrer / browser history, to better align with SPA navigation behavior.

Please let me know if this approach looks good now.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@apps/meteor/client/components/NotFoundState.tsx`:
- Around line 28-32: The conditional using router.canGoBack?.() and
router.back() is invalid because RouterContextValue doesn't expose those
methods; replace this logic by calling router.navigate(-1) for back navigation
(i.e., use router.navigate with a negative delta) and remove the optional
chaining, or alternatively add a proper canGoBack boolean and back() method to
the RouterContextValue implementation and types so you can conditionally disable
the button; update the NotFoundState component to use router.navigate(-1) (or
the new canGoBack/back API) and adjust any type definitions for
RouterContextValue accordingly.
- Around line 50-52: The button in NotFoundState.tsx uses the i18n key "Go_back"
(rendered inside StatesAction with onClick handler handleGoBackClick) which is
missing from the locale files; add "Go_back": "Go back" to each translation JSON
(e.g., en.i18n.json and other locale files) so the token resolves to a localized
label instead of displaying the raw key.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd27f06 and c409f8e.

📒 Files selected for processing (1)
  • apps/meteor/client/components/NotFoundState.tsx
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js}

📄 CodeRabbit inference engine (.cursor/rules/playwright.mdc)

**/*.{ts,tsx,js}: Write concise, technical TypeScript/JavaScript with accurate typing in Playwright tests
Avoid code comments in the implementation

Files:

  • apps/meteor/client/components/NotFoundState.tsx
🧠 Learnings (1)
📚 Learning: 2025-11-17T15:07:13.273Z
Learnt from: gabriellsh
Repo: RocketChat/Rocket.Chat PR: 37398
File: packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx:357-363
Timestamp: 2025-11-17T15:07:13.273Z
Learning: In packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx, IconElement is a presentational, non-actionable element that does not require wrapping in AppIdProvider, similar to plain_text and mrkdwn renderers. Only actionable elements (those with actions, actionId, or interactive behavior) should be wrapped in AppIdProvider.

Applied to files:

  • apps/meteor/client/components/NotFoundState.tsx
⏰ 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). (1)
  • GitHub Check: cubic · AI code reviewer
🔇 Additional comments (2)
apps/meteor/client/components/NotFoundState.tsx (2)

1-9: LGTM — import reformatting is clean.


46-52: Good UX addition — dual navigation actions.

The "Go back" + "Homepage" pairing follows standard NotFound page patterns and addresses the PR objective well. The router.canGoBack?.() approach (assuming it exists on the router) is a proper fix over the earlier window.history.length approach, as it avoids navigating users outside the app.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread apps/meteor/client/components/NotFoundState.tsx Outdated
Comment on lines +50 to +52
<StatesAction onClick={handleGoBackClick}>
{t('Go_back')}
</StatesAction>
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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if Go_back translation key exists
echo "=== Searching for Go_back in i18n/translation files ==="
rg -n 'Go_back' -g '*.json' -g '*.i18n' -g '*.yml' -g '*.yaml' | head -30

echo ""
echo "=== Also check .ts/.tsx for any dynamic key registration ==="
rg -n 'Go_back' -g '*.ts' -g '*.tsx' | head -30

echo ""
echo "=== Check for common i18n directory structures ==="
fd -t f -e json | grep -i 'i18n\|translation\|locale\|lang' | head -20

Repository: RocketChat/Rocket.Chat

Length of output: 1014


🏁 Script executed:

#!/bin/bash
# Find main app i18n/translation directories
echo "=== Search for i18n files in apps/meteor ==="
fd -t f \( -name '*.json' -o -name '*.yml' -o -name '*.yaml' \) | grep -E 'apps/meteor.*i18n|apps/meteor.*translation|apps/meteor.*locale|apps/meteor.*lang' | head -20

echo ""
echo "=== Check root-level i18n structures ==="
find . -maxdepth 3 -type d \( -name 'i18n' -o -name 'translations' -o -name 'locales' \) 2>/dev/null | head -20

echo ""
echo "=== Search for Go_back across entire repo without file type restriction ==="
rg -n 'Go_back' --type-add 'translation:*.json' --type translation 2>/dev/null || rg -n 'Go_back' 2>/dev/null | head -30

echo ""
echo "=== Check how t() function is defined/imported ==="
rg -n "import.*from.*i18n\|from.*translate" apps/meteor/client/components/NotFoundState.tsx -A 2 -B 2

Repository: RocketChat/Rocket.Chat

Length of output: 618


🏁 Script executed:

#!/bin/bash
# Explore packages/i18n structure
echo "=== Files in packages/i18n ==="
ls -la packages/i18n/ | head -20

echo ""
echo "=== Search for Go_back in packages/i18n ==="
rg 'Go_back' packages/i18n/ 2>/dev/null || echo "No matches found for Go_back"

echo ""
echo "=== Count translation files ==="
find packages/i18n -type f -name '*.json' | wc -l

echo ""
echo "=== Sample translation file to understand structure ==="
find packages/i18n -type f -name '*.json' | head -1 | xargs head -50

echo ""
echo "=== Check import in NotFoundState.tsx ==="
head -30 apps/meteor/client/components/NotFoundState.tsx | rg "import|useTranslation"

Repository: RocketChat/Rocket.Chat

Length of output: 1195


🏁 Script executed:

#!/bin/bash
# Explore packages/i18n/src structure
echo "=== Files in packages/i18n/src ==="
ls -la packages/i18n/src/ | head -20

echo ""
echo "=== Look for translation JSON files ==="
find packages/i18n/src -name '*.json' | head -10

echo ""
echo "=== Search for Go_back in packages/i18n/src ==="
rg 'Go_back' packages/i18n/src/ 2>/dev/null || echo "No matches found for Go_back in packages/i18n/src"

echo ""
echo "=== Sample of first translation file ==="
find packages/i18n/src -name '*.json' -type f | head -1 | xargs head -100

Repository: RocketChat/Rocket.Chat

Length of output: 9303


🏁 Script executed:

#!/bin/bash
# Search for Go_back in all locale files
echo "=== Search for Go_back in all .i18n.json files ==="
rg '"Go_back"' packages/i18n/src/locales/ || echo "No 'Go_back' key found"

echo ""
echo "=== Search for go_back (case insensitive) ==="
rg -i 'go.back' packages/i18n/src/locales/ | head -20

echo ""
echo "=== Check en.i18n.json (English) for the key ==="
if [ -f "packages/i18n/src/locales/en.i18n.json" ]; then
  rg 'Go_back' packages/i18n/src/locales/en.i18n.json || echo "Not found in English"
  echo "=== Nearby keys in en.i18n.json ==="
  rg -B2 -A2 '"Go' packages/i18n/src/locales/en.i18n.json
else
  echo "en.i18n.json not found, listing available locale files:"
  ls packages/i18n/src/locales/ | head -20
fi

Repository: RocketChat/Rocket.Chat

Length of output: 5647


The Go_back i18n key is missing from translation files.

The key used at line 51 does not exist in any of the translation files in packages/i18n/src/locales/. The button will render the raw key string Go_back instead of a localized label. Add the key to the translation files (e.g., en.i18n.json): "Go_back": "Go back".

🤖 Prompt for AI Agents
In `@apps/meteor/client/components/NotFoundState.tsx` around lines 50 - 52, The
button in NotFoundState.tsx uses the i18n key "Go_back" (rendered inside
StatesAction with onClick handler handleGoBackClick) which is missing from the
locale files; add "Go_back": "Go back" to each translation JSON (e.g.,
en.i18n.json and other locale files) so the token resolves to a localized label
instead of displaying the raw key.

Comment on lines +28 to +29
const handleGoBackClick = () => {
router.navigate(-1);
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This way fails when there is no history; it returns to the previous website instead of going home.

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.

Please Add ‘Go back’ action to NotFound page for improved navigation

4 participants