Skip to content

Commit 95efa50

Browse files
committed
improvement: home, sidebar
1 parent a29717e commit 95efa50

File tree

6 files changed

+144
-125
lines changed

6 files changed

+144
-125
lines changed

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-content/resource-content.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import {
99
FileViewer,
1010
type PreviewMode,
1111
} from '@/app/workspace/[workspaceId]/files/components/file-viewer'
12-
import { useWorkspacePermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
1312
import type { MothershipResource } from '@/app/workspace/[workspaceId]/home/types'
14-
import { useWorkflowExecution } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution'
15-
import { useUsageLimits } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/hooks'
13+
import { useWorkspacePermissionsContext } from '@/app/workspace/[workspaceId]/providers/workspace-permissions-provider'
1614
import { Table } from '@/app/workspace/[workspaceId]/tables/[tableId]/components'
15+
import { useUsageLimits } from '@/app/workspace/[workspaceId]/w/[workflowId]/components/panel/hooks'
16+
import { useWorkflowExecution } from '@/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution'
1717
import { useWorkspaceFiles } from '@/hooks/queries/workspace-files'
1818
import { useSettingsNavigation } from '@/hooks/use-settings-navigation'
1919
import { useCurrentWorkflowExecution } from '@/stores/execution'
@@ -72,10 +72,7 @@ interface EmbeddedWorkflowActionsProps {
7272
workflowId: string
7373
}
7474

75-
export function EmbeddedWorkflowActions({
76-
workspaceId,
77-
workflowId,
78-
}: EmbeddedWorkflowActionsProps) {
75+
export function EmbeddedWorkflowActions({ workspaceId, workflowId }: EmbeddedWorkflowActionsProps) {
7976
const router = useRouter()
8077
const { navigateToSettings } = useSettingsNavigation()
8178
const { userPermissions: effectivePermissions } = useWorkspacePermissionsContext()
@@ -88,7 +85,8 @@ export function EmbeddedWorkflowActions({
8885
setActiveWorkflow(workflowId)
8986
}, [setActiveWorkflow, workflowId])
9087

91-
const isRunButtonDisabled = !isExecuting && (!effectivePermissions.canRead && !effectivePermissions.isLoading)
88+
const isRunButtonDisabled =
89+
!isExecuting && !effectivePermissions.canRead && !effectivePermissions.isLoading
9290

9391
const handleRun = useCallback(async () => {
9492
if (isExecuting) {

apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tabs.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
'use client'
22

3-
import { type ElementType, type ReactNode, type RefCallback, type SVGProps, useCallback } from 'react'
3+
import {
4+
type ElementType,
5+
type ReactNode,
6+
type RefCallback,
7+
type SVGProps,
8+
useCallback,
9+
} from 'react'
410
import { Button, Tooltip } from '@/components/emcn'
511
import { PanelLeft, Table as TableIcon } from '@/components/emcn/icons'
612
import { WorkflowIcon } from '@/components/icons'

apps/sim/app/workspace/[workspaceId]/home/home.tsx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,8 @@ export function Home({ chatId }: HomeProps = {}) {
226226

227227
if (!hasMessages) {
228228
return (
229-
<div className='h-full overflow-hidden bg-[var(--bg)]'>
230-
<div className='flex min-h-full flex-col items-center px-[24px]'>
231-
<div className='min-h-[30vh] flex-1' />
229+
<div className='h-full overflow-y-auto bg-[var(--bg)]'>
230+
<div className='flex min-h-full flex-col items-center justify-center px-[24px] pb-[2vh]'>
232231
<h1 className='mb-[24px] max-w-[42rem] font-[440] font-season text-[32px] text-[var(--text-primary)] tracking-[-0.02em]'>
233232
What should we get done
234233
{session?.user?.name ? `, ${session.user.name.split(' ')[0]}` : ''}?
@@ -240,20 +239,20 @@ export function Home({ chatId }: HomeProps = {}) {
240239
onStopGeneration={stopGeneration}
241240
userId={session?.user?.id}
242241
/>
243-
<div className='w-full max-w-[42rem] pt-[48px] pb-[32px]'>
244-
<TemplatePrompts onSelect={(prompt) => handleSubmit(prompt)} />
245-
</div>
242+
</div>
243+
<div className='-mt-[30vh] mx-auto w-full max-w-[42rem] px-[16px] pb-[32px]'>
244+
<TemplatePrompts onSelect={(prompt) => handleSubmit(prompt)} />
246245
</div>
247246
</div>
248247
)
249248
}
250249

251250
return (
252251
<div className='relative flex h-full bg-[var(--bg)]'>
253-
<div className='relative flex h-full min-w-0 flex-1 flex-col'>
252+
<div className='flex h-full min-w-0 flex-1 flex-col'>
254253
<div
255254
ref={scrollContainerRef}
256-
className='min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-6 pt-4 pb-[98px]'
255+
className='min-h-0 flex-1 overflow-y-auto overflow-x-hidden px-6 pt-4 pb-4'
257256
>
258257
<div className='mx-auto max-w-[42rem] space-y-6'>
259258
{messages.map((msg, index) => {
@@ -328,9 +327,8 @@ export function Home({ chatId }: HomeProps = {}) {
328327
</div>
329328
</div>
330329

331-
<div className='pointer-events-none absolute right-0 bottom-0 left-0 z-10 px-[24px] pb-[16px]'>
332-
<div className='pointer-events-auto relative mx-auto max-w-[42rem]'>
333-
<div className='-top-px -right-px -left-px -bottom-[16px] -z-10 absolute rounded-t-[20px] bg-[var(--bg)]' />
330+
<div className='flex-shrink-0 px-[24px] pb-[16px]'>
331+
<div className='mx-auto max-w-[42rem]'>
334332
<UserInput
335333
onSubmit={handleSubmit}
336334
isSending={isSending}

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3836,8 +3836,12 @@ const WorkflowContent = React.memo(
38363836
onNodesChange={onNodesChange}
38373837
onEdgesChange={onEdgesChange}
38383838
onConnect={!embedded && effectivePermissions.canEdit ? onConnect : undefined}
3839-
onConnectStart={!embedded && effectivePermissions.canEdit ? onConnectStart : undefined}
3840-
onConnectEnd={!embedded && effectivePermissions.canEdit ? onConnectEnd : undefined}
3839+
onConnectStart={
3840+
!embedded && effectivePermissions.canEdit ? onConnectStart : undefined
3841+
}
3842+
onConnectEnd={
3843+
!embedded && effectivePermissions.canEdit ? onConnectEnd : undefined
3844+
}
38413845
nodeTypes={nodeTypes}
38423846
edgeTypes={edgeTypes}
38433847
onMouseDown={handleCanvasMouseDown}

apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/workspace-header/workspace-header.tsx

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,8 @@ export function WorkspaceHeader({
331331
type='button'
332332
aria-label='Switch workspace'
333333
className={cn(
334-
'group flex min-w-0 items-center rounded-[8px] border border-[var(--border)] bg-[var(--surface-2)] transition-colors hover:bg-[var(--surface-5)]',
335-
isCollapsed
336-
? 'h-[35px] w-[35px] justify-center px-0'
337-
: 'h-[32px] w-full cursor-pointer gap-[8px] pr-[8px] pl-[6.5px]'
334+
'group flex h-[32px] min-w-0 items-center rounded-[8px] border border-[var(--border)] bg-[var(--surface-2)] pl-[5px] transition-colors hover:bg-[var(--surface-5)]',
335+
isCollapsed ? 'w-[32px]' : 'w-full cursor-pointer gap-[8px] pr-[8px]'
338336
)}
339337
title={activeWorkspace?.name || 'Loading...'}
340338
onContextMenu={(e) => {
@@ -368,7 +366,7 @@ export function WorkspaceHeader({
368366
<DropdownMenuContent
369367
align='start'
370368
side={isCollapsed ? 'right' : 'bottom'}
371-
sideOffset={isCollapsed ? 12 : 8}
369+
sideOffset={isCollapsed ? 16 : 8}
372370
style={
373371
isCollapsed
374372
? {
@@ -539,10 +537,8 @@ export function WorkspaceHeader({
539537
type='button'
540538
aria-label='Switch workspace'
541539
className={cn(
542-
'flex min-w-0 items-center rounded-[8px] border border-[var(--border)] bg-[var(--surface-2)]',
543-
isCollapsed
544-
? 'h-[35px] w-[35px] justify-center px-0'
545-
: 'h-[32px] w-full gap-[8px] pr-[8px] pl-[6.5px]'
540+
'flex h-[32px] min-w-0 items-center rounded-[8px] border border-[var(--border)] bg-[var(--surface-2)] pl-[5px]',
541+
isCollapsed ? 'w-[32px]' : 'w-full gap-[8px] pr-[8px]'
546542
)}
547543
title={activeWorkspace?.name || 'Loading...'}
548544
disabled

0 commit comments

Comments
 (0)