fix(ui): prevent flexbox height explosion in right sidebar

This commit is contained in:
yiling
2026-05-26 16:10:56 +08:00
parent 41f0b9d80c
commit ffc6922db2
2 changed files with 13 additions and 13 deletions
@@ -298,7 +298,7 @@ export function FileViewerRightSidebar({
}
return (
<div className="bg-background h-full">
<div className="bg-background h-full flex flex-col overflow-hidden">
{/* Lightbox */}
{viewingAttachment && viewingAttachment.mediaType?.startsWith('image/') && (
<div
@@ -319,8 +319,8 @@ export function FileViewerRightSidebar({
</div>
</div>
)}
<Tabs defaultValue="comments" className="p-4 h-full flex flex-col px-2">
<TabsList className="w-full">
<Tabs defaultValue="comments" className="p-4 flex-1 flex flex-col px-2 min-h-0">
<TabsList className="w-full shrink-0">
<TabsTrigger value="comments" className="flex-1">
Comments
</TabsTrigger>
@@ -328,7 +328,7 @@ export function FileViewerRightSidebar({
Fields
</TabsTrigger>
</TabsList>
<TabsContent value="comments" className="flex-1 flex flex-col overflow-auto mt-4">
<TabsContent value="comments" className="flex-1 flex flex-col overflow-hidden min-h-0 mt-4">
<ScrollArea className="flex-1 px-4">
<div className="space-y-4">
{comments.map((comment) => (
@@ -360,7 +360,7 @@ export function FileViewerRightSidebar({
</div>
</ScrollArea>
{(!readOnly || isPublic) && (
<div className="mt-4">
<div className="mt-4 shrink-0">
<GuestIdentityPopup
isOpen={isGuestPopupOpen}
onClose={() => setIsGuestPopupOpen(false)}
@@ -380,7 +380,7 @@ export function FileViewerRightSidebar({
</div>
)}
</TabsContent>
<TabsContent value="fields" className="flex-1 flex flex-col overflow-hidden mt-4">
<TabsContent value="fields" className="flex-1 flex flex-col overflow-hidden min-h-0 mt-4">
<ScrollArea className="flex-1 px-4">
{sortedFields && sortedFields.length > 0 && (
<div className="space-y-4 pb-4">
@@ -1,5 +1,3 @@
import { InferRequestType, InferResponseType } from 'hono/client'
import { useMutation } from '@tanstack/react-query'
import { client } from '@/ui/api/client'
import { FileViewer } from '@/ui/components/file-viewer'
import { FileViewerLeftSidebar } from '@/ui/components/file-viewer-left-sidebar'
@@ -7,15 +5,17 @@ import { FileViewerRightSidebar } from '@/ui/components/file-viewer-right-sideba
import { ResizeHandle } from '@/ui/components/resize-handle'
import { useMemberStore } from '@/ui/stores/members'
import { useTeamContextStore } from '@/ui/stores/team-context'
import { useUiStore } from '@/ui/stores/ui'
import { useTopNavStore } from '@/ui/stores/top-nav'
import { useUiStore } from '@/ui/stores/ui'
import { type Annotation } from '@/ui/types'
import { useMutation } from '@tanstack/react-query'
import { InferRequestType, InferResponseType } from 'hono/client'
import type { AssetInfo, CommentInfo } from '@/dtos/asset'
import { keepPreviousData, useQuery, useQueryClient } from '@tanstack/react-query'
import { createFileRoute, useNavigate } from '@tanstack/react-router'
import { Loader2 } from 'lucide-react'
import { useEffect, useState, useRef } from 'react'
import type { CommentInfo, AssetInfo } from '@/dtos/asset'
import { useEffect, useRef, useState } from 'react'
import type Player from 'video.js/dist/types/player'
function FileViewPage() {
@@ -210,8 +210,8 @@ function FileViewPage() {
}
return (
<div className="flex flex-1 flex-col bg-background">
<div className="flex flex-1 overflow-hidden">
<div className="h-full flex flex-1 flex-col bg-background">
<div className="h-full flex flex-1 overflow-hidden">
{!isLeftSidebarCollapsed && (
<>
<div style={{ width: leftSidebarWidth }} className="flex-shrink-0">