Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/app/support/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ export default function UserSupportChatPage() {
const project = projectIdParam ? projectById : (slugParam ? projectBySlug : projectById)
// Use the project's UUID when only a slug is provided, or fall back to projectId from URL/ticket
const effectiveProjectId = project?.project_id || projectId || ""
const projectPageHref = project?.slug
? `/support/${encodeURIComponent(project.slug)}`
: effectiveProjectId
? `/support?project=${encodeURIComponent(effectiveProjectId)}`
: undefined
const projectName = project?.name ?? "Support"
const organizationName = hasSLA ? projectName : null
const freeHelpRemaining: string | null = null
Expand Down Expand Up @@ -592,7 +597,7 @@ export default function UserSupportChatPage() {

return (
<div className="flex flex-1 min-h-0 overflow-hidden bg-bg-subtle">
<Sidebar />
<Sidebar projectPageHref={projectPageHref} />

<TicketChat
headerTitle={`Ticket with ${projectName}`}
Expand Down Expand Up @@ -765,7 +770,7 @@ export default function UserSupportChatPage() {
<h3 className="mb-3 uppercase" style={{ fontSize: '11px', letterSpacing: '0.05em', color: 'rgba(0,0,0,0.5)', fontWeight: 500 }}>Active tickets ({activeTicketsCount})</h3>
<div className={`-ml-5 -mr-4 ${activeTicketsSidebar.length > 1 ? "max-h-72 overflow-y-auto" : ""}`}>
{activeTicketsSidebar.length === 0 ? (
<p className="text-[13px] text-muted-foreground px-3">No active tickets</p>
<p className="text-[13px] text-muted-foreground pl-5 pr-4">No active tickets</p>
) : (
activeTicketsSidebar.map((item) => (
<Link
Expand Down
18 changes: 17 additions & 1 deletion src/components/layout/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import { useUser } from "@/contexts/user-context"

interface SidebarProps {
className?: string
/** When provided, renders a discrete "See project page" external link above the bottom items. */
projectPageHref?: string
}

interface NavigationItem {
Expand All @@ -38,7 +40,7 @@ const FlaticonIcon = ({ iconClass, className }: { iconClass: string; className?:
)
}

export function Sidebar({ className }: SidebarProps) {
export function Sidebar({ className, projectPageHref }: SidebarProps) {
const pathname = usePathname()
// The Sidebar is mounted per-page (not in a shared layout), so its state
// is wiped on every navigation. Derive the initially-expanded parent from
Expand Down Expand Up @@ -411,6 +413,20 @@ export function Sidebar({ className }: SidebarProps) {
</nav>

<div className="px-3 py-2.5 border-t border-sidebar-border space-y-0.5 shrink-0">
{projectPageHref && (
<a
href={projectPageHref}
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-3 px-3 py-2.5 min-h-[40px] rounded-md text-xs font-medium text-muted-foreground hover:text-sidebar-foreground hover:bg-bg-subtle cursor-pointer transition-colors"
title={isCollapsed ? "See project page" : undefined}
>
<span className="flex h-5 w-5 shrink-0 items-center justify-center">
<FlaticonIcon iconClass="fi-rr-browser" />
</span>
{!isCollapsed && "See project page"}
</a>
)}
{bottomItems.map((item) => {
const isActive = item.href !== "#" && pathname === item.href
const className = `flex items-center gap-3 px-3 py-2.5 min-h-[40px] text-sm font-medium rounded-md cursor-pointer transition-colors ${
Expand Down