Skip to content

Conversation

@MananTank
Copy link
Member

@MananTank MananTank commented Oct 24, 2024

Problem solved

Short description of the bug fixed or feature added


PR-Codex overview

This PR introduces a new redirect functionality in the middleware for handling requests to /team/~/..., redirecting them to the first team's slug.

Detailed summary

  • Added a check for the path starting with team and ~.
  • Implemented a call to getTeams() to retrieve the list of teams.
  • Redirects to the first team's slug if available.
  • Maintains existing functionality for other paths.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2024

⚠️ No Changeset found

Latest commit: 7185364

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

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 24, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

@vercel vercel bot temporarily deployed to Preview – wallet-ui October 24, 2024 11:46 Inactive
@vercel
Copy link

vercel bot commented Oct 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 28, 2024 6:48pm
3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs-v2 ⬜️ Skipped (Inspect) Oct 28, 2024 6:48pm
thirdweb_playground ⬜️ Skipped (Inspect) Oct 28, 2024 6:48pm
wallet-ui ⬜️ Skipped (Inspect) Oct 28, 2024 6:48pm

@vercel vercel bot temporarily deployed to Preview – docs-v2 October 24, 2024 11:46 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 24, 2024 11:46 Inactive
@MananTank MananTank marked this pull request as ready for review October 24, 2024 11:46
Copy link
Member Author

MananTank commented Oct 24, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @MananTank and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added the Dashboard Involves changes to the Dashboard. label Oct 24, 2024
@MananTank MananTank force-pushed the 10-24-redirect__team___._to__team__first-team-slug__ branch from 80c6d2e to d288f46 Compare October 24, 2024 11:48
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 24, 2024 11:48 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 24, 2024 11:48 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 24, 2024 11:48 Inactive
@MananTank MananTank force-pushed the 10-24-redirect__team___._to__team__first-team-slug__ branch from d288f46 to 98e26da Compare October 24, 2024 11:48
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 24, 2024 11:48 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 24, 2024 11:48 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 24, 2024 11:48 Inactive
@codecov
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 45.30%. Comparing base (efc8bb7) to head (7185364).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5158   +/-   ##
=======================================
  Coverage   45.30%   45.30%           
=======================================
  Files        1067     1067           
  Lines       55304    55304           
  Branches     3970     3970           
=======================================
  Hits        25054    25054           
  Misses      29557    29557           
  Partials      693      693           
Flag Coverage Δ *Carryforward flag
legacy_packages 65.68% <ø> (ø) Carriedforward from efc8bb7
packages 40.31% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 42.9 KB (0%) 859 ms (0%) 1.8 s (+15.96% 🔺) 2.7 s
thirdweb (cjs) 102.73 KB (0%) 2.1 s (0%) 3.2 s (+14.82% 🔺) 5.2 s
thirdweb (minimal + tree-shaking) 4.84 KB (0%) 97 ms (0%) 189 ms (+209.46% 🔺) 286 ms
thirdweb/chains (tree-shaking) 498 B (0%) 10 ms (0%) 90 ms (+301.45% 🔺) 100 ms
thirdweb/react (minimal + tree-shaking) 17.34 KB (0%) 347 ms (0%) 357 ms (+38.49% 🔺) 704 ms

}
}

// redirect /team/~/... to /team/<first_team_slug>/...
Copy link
Member

Choose a reason for hiding this comment

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

why can't this just be /team? why do we need the extra /~ in there?

Copy link
Member Author

@MananTank MananTank Oct 28, 2024

Choose a reason for hiding this comment

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

If we want to have /team/ instead of /team/~/

  • That breaks the usual format - it should be /team/<team-slug>/<...otherSlugs>
  • We'll have to determine if otherSlugs[0] is not a valid team slug and then insert the first team's slug before them

Copy link
Member

Choose a reason for hiding this comment

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

I see you want to allow the deep-linking to something inside the default team - okay

Comment on lines +100 to +101
// TODO - need an API to get the first team to avoid fetching all teams
const teams = await getTeams();
Copy link
Member

Choose a reason for hiding this comment

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

yeah we need a getDefaultTeam

Copy link
Member

Choose a reason for hiding this comment

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

not a blocker however

@MananTank MananTank requested a review from jnsdls October 28, 2024 17:35
}
}

// redirect /team/~/... to /team/<first_team_slug>/...
Copy link
Member

Choose a reason for hiding this comment

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

I see you want to allow the deep-linking to something inside the default team - okay

@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 28, 2024

Merge activity

@MananTank MananTank changed the base branch from 10-24-move_engine_page_components_to_app_router_folder_in_teams_layout to graphite-base/5158 October 28, 2024 18:12
@graphite-app graphite-app bot changed the base branch from graphite-base/5158 to main October 28, 2024 18:36
## Problem solved

Short description of the bug fixed or feature added

<!-- start pr-codex -->

---

## PR-Codex overview
This PR adds functionality to redirect requests from `/team/~/...` to `/team/<first_team_slug>/...`, enhancing user navigation by ensuring that users are directed to the first team's slug instead of a placeholder.

### Detailed summary
- Added a check for the path starting with `team` and `~`.
- Implemented a call to `getTeams()` to retrieve the list of teams.
- If a team exists, modified the path to use the first team's slug.
- Redirects the request to the new path format.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
@MananTank MananTank force-pushed the 10-24-redirect__team___._to__team__first-team-slug__ branch from 98e26da to 7185364 Compare October 28, 2024 18:37
@vercel vercel bot temporarily deployed to Preview – docs-v2 October 28, 2024 18:37 Inactive
@vercel vercel bot temporarily deployed to Preview – wallet-ui October 28, 2024 18:37 Inactive
@vercel vercel bot temporarily deployed to Preview – thirdweb_playground October 28, 2024 18:37 Inactive
@graphite-app graphite-app bot merged commit 7185364 into main Oct 28, 2024
31 checks passed
@graphite-app graphite-app bot deleted the 10-24-redirect__team___._to__team__first-team-slug__ branch October 28, 2024 18:48
@vercel vercel bot temporarily deployed to Production – wallet-ui October 28, 2024 18:48 Inactive
@vercel vercel bot temporarily deployed to Production – thirdweb_playground October 28, 2024 18:48 Inactive
@vercel vercel bot temporarily deployed to Production – docs-v2 October 28, 2024 18:48 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dashboard Involves changes to the Dashboard.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants