Skip to content

Conversation

@timothyfroehlich
Copy link
Owner

This change implements a filter persistence mechanism for the Issues page, ensuring that a user's search filters are preserved when navigating away and back to the page. It updates both the "Back to Issues" link and the sidebar navigation to use the stored filters from localStorage.

Fixes #856


PR created automatically by Jules for task 3579861091940212631 started by @timothyfroehlich

This commit introduces a filter persistence mechanism for the Issues page.

Key changes:
- Search filters are now stored in `localStorage` whenever they are updated.
- The "Back to Issues" link on the Issue Detail page now uses the stored filters to return the user to their previous view.
- The "Issues" link in the sidebar also uses the stored filters.

This change improves the user experience by preventing the loss of filter context when navigating between the Issues list and detail pages.

Co-authored-by: timothyfroehlich <5819722+timothyfroehlich@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI review requested due to automatic review settings January 29, 2026 03:14
@vercel
Copy link

vercel bot commented Jan 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
pin-point Error Error Jan 29, 2026 3:16am

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR implements filter persistence for the Issues page using localStorage, allowing users to return to their last-used filter state when navigating back from issue detail pages or via the sidebar. The implementation stores the full issues page path (including query parameters) whenever filters change and uses this stored path for navigation links.

Changes:

  • Adds a new useIssueLink hook that retrieves the last used issues path from localStorage
  • Updates the sidebar "Issues" link to use the persisted path
  • Replaces the hardcoded "Back to Issues" link with a new component that uses the persisted path
  • Modifies useSearchFilters to store the path on every filter update

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/hooks/use-issue-link.ts New hook providing localStorage-based persistence for issues page path, with proper error handling and hydration-safe implementation
src/hooks/use-search-filters.ts Integrates path storage into the existing filter update logic
src/components/layout/Sidebar.tsx Updates Issues navigation link to use persisted path from useIssueLink hook
src/components/issues/BackToIssuesLink.tsx New client component that replaces hardcoded back link with dynamic persisted path
src/app/(app)/m/[initials]/i/[issueNumber]/page.tsx Replaces inline back link with BackToIssuesLink component

}): React.JSX.Element => {
const isActive = pathname === item.href;
const href = item.href === "/issues" ? issuesLink : item.href;
const isActive = pathname === href;
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The isActive check will not work correctly when issuesLink contains query parameters. The pathname from usePathname() returns only the path (e.g., "/issues") without query parameters, but href may contain query parameters (e.g., "/issues?status=new"). This means the Issues link will never show as active when filters are present.

Consider comparing only the path portion of href, or checking if pathname starts with the base path for the Issues route.

Suggested change
const isActive = pathname === href;
const hrefPath = href.split("?")[0];
const isActive = pathname === hrefPath;

Copilot uses AI. Check for mistakes.

router.push(`${pathname}?${params.toString()}`);
const newPath = `${pathname}?${params.toString()}`;
storeLastIssuesPath(newPath);
Copy link

Copilot AI Jan 29, 2026

Choose a reason for hiding this comment

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

The storeLastIssuesPath function is called unconditionally on every filter update, regardless of the current pathname. This means that if useSearchFilters is used on other pages in the future, it could incorrectly store non-issues paths.

Consider checking the pathname before storing: only call storeLastIssuesPath when pathname starts with "/issues".

Suggested change
storeLastIssuesPath(newPath);
if (pathname.startsWith("/issues")) {
storeLastIssuesPath(newPath);
}

Copilot uses AI. Check for mistakes.
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.

UX: Preserve last search filters when navigating back to Issues

2 participants