Merge pull request #149 from shumaiOne/fix-sidebar-overflow

fix(webui): truncate long folder, collection, and share link names in sidebar
This commit is contained in:
Yiling-J
2026-06-22 15:46:18 +08:00
committed by GitHub
5 changed files with 29 additions and 12 deletions
+3
View File
@@ -134,6 +134,9 @@ AWS_ENDPOINT_URL_S3=http://localhost
#### Step 6: Run Shumai #### Step 6: Run Shumai
> [!IMPORTANT]
> **For Bun Users:** Since the published package binaries contain a `#!/usr/bin/env node` shebang, running the global command directly (e.g., `shumai`) will execute under Node.js. If you installed with Bun and want to run under the Bun runtime, you must prefix all commands with `bun run --bun` (e.g., `bun run --bun shumai`, `bun run --bun shumai -d`, `bun run --bun shumai stop`).
Start the application from your workspace folder: Start the application from your workspace folder:
```bash ```bash
+3
View File
@@ -26,6 +26,9 @@ export SHUMAI_API_KEY="your-developer-api-token"
## Usage ## Usage
> [!IMPORTANT]
> **For Bun Users:** Since the package binary contains a `#!/usr/bin/env node` shebang, running `shumai-cli` directly will run under Node.js. If you wish to run it using Bun, prefix the command with `bun run --bun` (e.g., `bun run --bun shumai-cli project ls`).
Run `shumai-cli` or query specific commands: Run `shumai-cli` or query specific commands:
```bash ```bash
+3
View File
@@ -80,3 +80,6 @@ Run this on your sandboxed agent execution nodes (requires sandbox dependencies
npm install -g @shumai-one/shumai-agent npm install -g @shumai-one/shumai-agent
shumai-agent shumai-agent
``` ```
> [!IMPORTANT]
> **For Bun Users:** Since the worker package binaries contain a `#!/usr/bin/env node` shebang, running `shumai-transcode` or `shumai-agent` directly will run under Node.js. If you wish to run them using Bun, prefix the commands with `bun run --bun` (e.g., `bun run --bun shumai-transcode` or `bun run --bun shumai-agent`).
+5
View File
@@ -72,9 +72,14 @@ To handle media processing and security isolation, the host machine must have th
AWS_ENDPOINT_URL_S3=http://localhost AWS_ENDPOINT_URL_S3=http://localhost
``` ```
4. **Start Shumai**: 4. **Start Shumai**:
> [!IMPORTANT]
> **For Bun Users:** Since the published package binaries contain a `#!/usr/bin/env node` shebang, running `shumai` directly will execute under Node.js. If you installed using Bun and want to run it under the Bun runtime, prefix the command with `bun run --bun` (e.g., `bun run --bun shumai`).
```bash ```bash
shumai shumai
``` ```
Open your browser to `http://localhost:3000`. Open your browser to `http://localhost:3000`.
--- ---
+15 -12
View File
@@ -469,7 +469,7 @@ export function FolderTree({
<ScrollArea <ScrollArea
className={cn( className={cn(
'flex-1 min-h-0 transition-all duration-300 ease-in-out', 'flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!',
isAssetsExpanded isAssetsExpanded
? 'opacity-100 visible pointer-events-auto' ? 'opacity-100 visible pointer-events-auto'
: 'opacity-0 invisible pointer-events-none h-0', : 'opacity-0 invisible pointer-events-none h-0',
@@ -569,7 +569,7 @@ export function FolderTree({
<ScrollArea <ScrollArea
className={cn( className={cn(
'flex-1 min-h-0 transition-all duration-300 ease-in-out', 'flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!',
isCollectionsExpanded isCollectionsExpanded
? 'opacity-100 visible pointer-events-auto' ? 'opacity-100 visible pointer-events-auto'
: 'opacity-0 invisible pointer-events-none h-0', : 'opacity-0 invisible pointer-events-none h-0',
@@ -599,7 +599,7 @@ export function FolderTree({
<div <div
key={collection.id} key={collection.id}
className={cn( className={cn(
'group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground', 'group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0',
isColActive && 'bg-sidebar-accent text-sidebar-accent-foreground font-medium', isColActive && 'bg-sidebar-accent text-sidebar-accent-foreground font-medium',
)} )}
onClick={() => onClick={() =>
@@ -620,7 +620,7 @@ export function FolderTree({
{canEdit && ( {canEdit && (
<div <div
className="opacity-0 group-hover:opacity-100 transition-opacity" className="opacity-0 group-hover:opacity-100 transition-opacity shrink-0"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<DropdownMenu modal={false}> <DropdownMenu modal={false}>
@@ -705,7 +705,7 @@ export function FolderTree({
<ScrollArea <ScrollArea
className={cn( className={cn(
'flex-1 min-h-0 transition-all duration-300 ease-in-out', 'flex-1 min-h-0 transition-all duration-300 ease-in-out [&>div>div]:block!',
isSharesExpanded isSharesExpanded
? 'opacity-100 visible pointer-events-auto' ? 'opacity-100 visible pointer-events-auto'
: 'opacity-0 invisible pointer-events-none h-0', : 'opacity-0 invisible pointer-events-none h-0',
@@ -958,7 +958,7 @@ function ShareLinkItem({
<div <div
ref={setDroppableRef} ref={setDroppableRef}
className={cn( className={cn(
'group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground', 'group flex cursor-pointer items-center justify-between rounded-md px-2 py-1 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0',
isActive && 'bg-sidebar-accent text-sidebar-accent-foreground font-medium', isActive && 'bg-sidebar-accent text-sidebar-accent-foreground font-medium',
isOver && isValidDropTarget && 'bg-sidebar-accent ring-2 ring-primary ring-inset', isOver && isValidDropTarget && 'bg-sidebar-accent ring-2 ring-primary ring-inset',
)} )}
@@ -978,7 +978,7 @@ function ShareLinkItem({
{canEdit && ( {canEdit && (
<div <div
className="opacity-0 group-hover:opacity-100 transition-opacity" className="opacity-0 group-hover:opacity-100 transition-opacity shrink-0"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<DropdownMenu modal={false}> <DropdownMenu modal={false}>
@@ -1176,7 +1176,7 @@ function FolderTreeItem({
<div <div
ref={setNodeRef} ref={setNodeRef}
className={cn( className={cn(
'group flex cursor-pointer items-center gap-1 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground', 'group flex cursor-pointer items-center gap-1 rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-sidebar-accent hover:text-sidebar-accent-foreground min-w-0',
(isActive || isSelected) && (isActive || isSelected) &&
'bg-sidebar-accent text-sidebar-accent-foreground font-medium', 'bg-sidebar-accent text-sidebar-accent-foreground font-medium',
isDragging && 'opacity-50', isDragging && 'opacity-50',
@@ -1188,7 +1188,10 @@ function FolderTreeItem({
onClick={handleFolderClick} onClick={handleFolderClick}
> >
{!isRoot && ( {!isRoot && (
<button onClick={handleToggleExpand} className="flex h-4 w-4 items-center justify-center"> <button
onClick={handleToggleExpand}
className="flex h-4 w-4 items-center justify-center shrink-0"
>
{isExpanded ? ( {isExpanded ? (
<ChevronDown className="h-3 w-3" /> <ChevronDown className="h-3 w-3" />
) : ( ) : (
@@ -1197,15 +1200,15 @@ function FolderTreeItem({
</button> </button>
)} )}
{isRoot ? ( {isRoot ? (
<Clapperboard className="h-4 w-4 text-sidebar-primary" /> <Clapperboard className="h-4 w-4 text-sidebar-primary shrink-0" />
) : ( ) : (
<Folder className="h-4 w-4 text-sidebar-primary" /> <Folder className="h-4 w-4 text-sidebar-primary shrink-0" />
)} )}
<span className="flex-1 truncate text-sidebar-foreground">{folder.name}</span> <span className="flex-1 truncate text-sidebar-foreground">{folder.name}</span>
{canEdit && !isRoot && ( {canEdit && !isRoot && (
<div <div
className="opacity-0 group-hover:opacity-100 transition-opacity" className="opacity-0 group-hover:opacity-100 transition-opacity shrink-0"
onClick={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()}
> >
<DropdownMenu modal={false}> <DropdownMenu modal={false}>