mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-28 08:44:41 +08:00
feat(toolbar): auto-compact AppSwitcher based on available width
Replace hardcoded app count threshold with ResizeObserver-based detection. Uses a two-layer layout (overflow-hidden outer + shrink-0 inner) to avoid the compact/normal oscillation problem.
This commit is contained in:
@@ -63,7 +63,11 @@ export function AppSwitcher({
|
||||
name={appDisplayName[app]}
|
||||
size={iconSize}
|
||||
/>
|
||||
{!compact && <span>{appDisplayName[app]}</span>}
|
||||
{!compact && (
|
||||
<span className="transition-all duration-200 whitespace-nowrap">
|
||||
{appDisplayName[app]}
|
||||
</span>
|
||||
)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user