Skip to content

fix: navigate back to previous page instead of hardcoded AI Tagging route#1327

Merged
rohan-pandeyy merged 3 commits into
AOSSIE-Org:mainfrom
akshajtiwari:back-button-route-fix
Jun 18, 2026
Merged

fix: navigate back to previous page instead of hardcoded AI Tagging route#1327
rohan-pandeyy merged 3 commits into
AOSSIE-Org:mainfrom
akshajtiwari:back-button-route-fix

Conversation

@akshajtiwari

@akshajtiwari akshajtiwari commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Addressed Issues:

Fixes #1328

Screenshots/Recordings:

TODO: If applicable, add screenshots or recordings that demonstrate the interface before and after the changes.

Additional Notes:

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: N/A

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

Summary by CodeRabbit

  • Bug Fixes
    • Updated the “Back” button on the PersonImages page to navigate one step back in browser history.
    • Changed the button label from “Back to AI Tagging” to “Back” for clearer intent.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

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

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

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ 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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f4cc0275-7e83-498f-a251-e42ef379c37c

📥 Commits

Reviewing files that changed from the base of the PR and between 479995b and 8b2d491.

📒 Files selected for processing (1)
  • frontend/src/pages/PersonImages/PersonImages.tsx

Walkthrough

The PersonImages page's "Back" button is updated to navigate one step back in browser history using navigate(-1) instead of routing directly to /${ROUTES.AI}. The button label is also shortened from "Back to AI Tagging" to "Back".

Changes

Back Button Behavior Update

Layer / File(s) Summary
Back button handler and label
frontend/src/pages/PersonImages/PersonImages.tsx
Click handler changed from navigate(\/${ROUTES.AI}`)tonavigate(-1)`; button text changed from "Back to AI Tagging" to "Back".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Suggested labels

TypeScript/JavaScript

Poem

🐇 Hippity-hop, back I go,
No fixed route, just history's flow.
One step behind, wherever I've been,
The button now knows where I was seen.
Short and sweet, just "Back" will do! 🌿

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: replacing hardcoded AI Tagging navigation with browser history navigation.
Linked Issues check ✅ Passed The code changes directly address issue #1328 by replacing the hardcoded navigate call with navigate(-1) for proper browser history navigation.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the back button behavior as specified in issue #1328; no out-of-scope modifications 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

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.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ No issue was linked in the PR description.
Please make sure to link an issue (e.g., 'Fixes #issue_number')

@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.

🧹 Nitpick comments (1)
frontend/src/pages/PersonImages/PersonImages.tsx (1)

90-95: ⚡ Quick win

Add a regression test for history-back behavior.

This behavior change is core to the bug fix, so it should be explicitly asserted in frontend/src/pages/__tests__/PersonImages.test.tsx (click Back, verify navigation goes to previous history entry rather than AI route).

As per coding guidelines, "Ensure that test code is automated, comprehensive, and follows testing best practices" and "Verify that all critical functionality is covered by tests."

🤖 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 `@frontend/src/pages/PersonImages/PersonImages.tsx` around lines 90 - 95, The
PersonImages component's Back button now uses navigate(-1) to go back in browser
history, but this critical behavior change lacks test coverage. Add a new test
case in the PersonImages.test.tsx file that renders the PersonImages component,
simulates a click on the Back button (identified by the ArrowLeft icon and
"Back" text), and verifies that the navigate function was called with the
argument -1 to ensure the history-back behavior is working as expected and
prevent regressions.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@frontend/src/pages/PersonImages/PersonImages.tsx`:
- Around line 90-95: The PersonImages component's Back button now uses
navigate(-1) to go back in browser history, but this critical behavior change
lacks test coverage. Add a new test case in the PersonImages.test.tsx file that
renders the PersonImages component, simulates a click on the Back button
(identified by the ArrowLeft icon and "Back" text), and verifies that the
navigate function was called with the argument -1 to ensure the history-back
behavior is working as expected and prevent regressions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4d878a2b-4935-41b3-98f3-c6479676b08f

📥 Commits

Reviewing files that changed from the base of the PR and between 2723339 and 2e22eed.

📒 Files selected for processing (1)
  • frontend/src/pages/PersonImages/PersonImages.tsx

@rohan-pandeyy rohan-pandeyy left a comment

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.

Nice!

@rohan-pandeyy rohan-pandeyy merged commit f93f050 into AOSSIE-Org:main Jun 18, 2026
9 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.

BUG: Back button on Person Images page always navigates to AI Tagging, ignoring actual entry point

2 participants