Skip to content

Commit c1ab3e1

Browse files
mfrachetclaude
andauthored
feat(playground-ui): add view transitions to internal sidebar links (#12358)
Enables smooth view transitions when navigating between pages via the sidebar. Internal links (non-http URLs) now automatically get `viewTransition: true` passed to React Router's Link component, while external links continue to open in new tabs. ```tsx // Before: internal links had no transition const linkParams = link?.url?.startsWith('http') ? { target: '_blank', rel: 'noreferrer' } : {}; // After: internal links get view transitions const isExternal = link?.url?.startsWith('http'); const linkParams = isExternal ? { target: '_blank', rel: 'noreferrer' } : { viewTransition: true }; ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added smooth view transitions to sidebar navigation links for a more polished, seamless experience during page navigation. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 6b38687 commit c1ab3e1

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

.changeset/upset-cameras-beg.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@mastra/playground-ui': patch
3+
---
4+
5+
Added view transitions to internal sidebar navigation links for smoother page transitions

packages/playground-ui/src/ds/components/MainSidebar/main-sidebar-nav-link.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ export function MainSidebarNavLink({
3232
const { Link } = useLinkComponent();
3333
const isCollapsed = state === 'collapsed';
3434
const isFeatured = link?.variant === 'featured';
35-
const linkParams = link?.url?.startsWith('http') ? { target: '_blank', rel: 'noreferrer' } : {};
35+
const isExternal = link?.url?.startsWith('http');
36+
const linkParams = isExternal ? { target: '_blank', rel: 'noreferrer' } : {};
3637

3738
return (
3839
<li

packages/playground/src/components/ui/app-sidebar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ const mainNavigation: NavSection[] = [
4848
name: 'Processors',
4949
url: '/processors',
5050
icon: <Cpu />,
51+
isOnMastraPlatform: false,
5152
},
5253
{
5354
name: 'MCP Servers',

packages/playground/src/lib/framework.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { LinkComponent, LinkComponentProps } from '@mastra/playground-ui';
55
export const Link: LinkComponent = forwardRef<HTMLAnchorElement, LinkComponentProps>(
66
({ children, href, ...props }, ref) => {
77
return (
8-
<RouterLink ref={ref} to={href} {...props}>
8+
<RouterLink ref={ref} to={href} viewTransition {...props}>
99
{children}
1010
</RouterLink>
1111
);

0 commit comments

Comments
 (0)