Skip to content

Add Active Tab to URL as Search Param (e.g. ?tab=files) #15

Description

@vikas-saini-7

Description

Currently, Code Collab room/{roomId} has multiple tabs like Files, Chat, and Settings, etc.
But the active tab is not reflected in the URL. This issue proposes syncing the active tab with a tab search parameter, like:
/room/{roomId}?tab=files

Why is this feature useful?

  • Improves shareability: users can send links that open directly to a specific tab
  • Improves UX: refresh doesn’t reset the active tab
  • Helps with deep linking and future bookmarking
  • A standard pattern used in web apps with multiple views

How could it work?

  • Use useSearchParams() (Next.js App Router)
  • When a user switches tabs, update the tab query param (e.g. ?tab=chat)
  • On initial load, check the tab param and activate the correct tab
  • If no tab is found in the URL, default to the files tab

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions