Skip to content

[WEB-4363]: Analytics tab improvements#7248

Merged
sriramveeraghanta merged 2 commits intopreviewfrom
analytics-tab-improvements
Jun 24, 2025
Merged

[WEB-4363]: Analytics tab improvements#7248
sriramveeraghanta merged 2 commits intopreviewfrom
analytics-tab-improvements

Conversation

@JayashTripathy
Copy link
Member

@JayashTripathy JayashTripathy commented Jun 20, 2025

Description

  • added tabs in the path params instead of search params
  • added a bit of padding int tabs

Type of Change

  • Improvement (change that would cause existing functionality to not work as expected)

Screenshots and Media (if applicable)

Media

Before After
image image

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 20, 2025

Walkthrough

This update refactors analytics tab navigation by shifting tab state from URL query parameters to route parameters. The layout component is renamed for clarity, and a permanent redirect is added to route analytics root paths to the overview tab. Tab navigation logic and styling receive targeted adjustments.

Changes

File(s) Change Summary
web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/layout.tsx Renamed default export from WorkspaceAnalyticsLayout to WorkspaceAnalyticsTabLayout; cleaned imports.
web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx Refactored tab routing to use route parameters instead of query strings; updated component signature and tab styling.
web/next.config.js Added a permanent redirect from /[workspaceSlug]/analytics to /[workspaceSlug]/analytics/overview.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant NextJS_Router
    participant AnalyticsPage

    User->>Browser: Navigates to /[workspaceSlug]/analytics
    Browser->>NextJS_Router: Request /[workspaceSlug]/analytics
    NextJS_Router-->>Browser: Redirect to /[workspaceSlug]/analytics/overview
    Browser->>NextJS_Router: Request /[workspaceSlug]/analytics/overview
    NextJS_Router->>AnalyticsPage: Render with tabId = "overview"
    AnalyticsPage->>Browser: Render tab content for "overview"
    User->>AnalyticsPage: Clicks another tab
    AnalyticsPage->>NextJS_Router: Push /[workspaceSlug]/analytics/[newTabId]
    NextJS_Router->>AnalyticsPage: Render with tabId = [newTabId]
    AnalyticsPage->>Browser: Render tab content for [newTabId]
Loading

Suggested labels

🌐frontend, 🌟improvement, ready_to_merge

Suggested reviewers

  • aaryan610
  • prateekshourya29

Poem

In the warren of routes, a new path appears,
Analytics tabs now switch with fewer fears.
No more query strings to chase or rewrite,
Just clean URLs hopping left and right!
With a redirect set and a layout renamed,
This code, dear friends, is smartly reframed.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@makeplane
Copy link

makeplane bot commented Jun 20, 2025

Pull Request Linked with Plane Work Items

Comment Automatically Generated by Plane

Copy link
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: 0

🧹 Nitpick comments (1)
web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx (1)

5-5: Remove unused useSearchParams import.

Since the component now uses route parameters instead of search parameters, the useSearchParams import is no longer needed.

-import { useRouter, useSearchParams } from "next/navigation";
+import { useRouter } from "next/navigation";
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7045a1f and 6ba67a0.

📒 Files selected for processing (3)
  • web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/layout.tsx (1 hunks)
  • web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx (2 hunks)
  • web/next.config.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (6)
web/next.config.js (1)

56-60: LGTM! Redirect configuration supports the new route-based tab navigation.

The redirect rule correctly routes analytics root paths to the overview tab, aligning with the shift from query parameters to route parameters for analytics tab navigation.

web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/layout.tsx (1)

6-6: Good semantic improvement with the component rename.

Renaming from WorkspaceAnalyticsLayout to WorkspaceAnalyticsTabLayout better reflects the component's role in the new tab-focused routing structure.

web/app/(all)/[workspaceSlug]/(projects)/analytics/[tabId]/page.tsx (4)

19-28: Well-structured props typing for the new route-based navigation.

The Props interface correctly types the tabId parameter from Next.js app router params, and the destructuring logic cleanly extracts the tabId for use in the component.


64-64: Router navigation properly updated for route-based tabs.

The navigation correctly builds the route path using workspace slug and tab key, replacing the previous query parameter approach.


68-70: Memoization and default tab logic correctly updated.

The dependencies now include currentWorkspace?.slug since navigation depends on it, and the defaultTab logic properly uses the tabId from route parameters.


85-87: Good styling refinements for the tab components.

The updates to tabListClassName, addition of tabClassName, and padding changes in tabPanelClassName improve the visual presentation of the analytics tabs.

@sriramveeraghanta sriramveeraghanta merged commit 22a9d48 into preview Jun 24, 2025
5 of 6 checks passed
@sriramveeraghanta sriramveeraghanta deleted the analytics-tab-improvements branch June 24, 2025 08:47
lifeiscontent pushed a commit that referenced this pull request Aug 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants