@@ -7,21 +7,13 @@ import type {
77 LocalFilesystemMount ,
88 LocalFilesystemResponse ,
99} from '@sim/desktop-bridge'
10- import {
11- Chip ,
12- ChipConfirmModal ,
13- Label ,
14- Switch ,
15- Table ,
16- TableBody ,
17- TableCell ,
18- TableRow ,
19- toast ,
20- } from '@sim/emcn'
10+ import { Chip , ChipConfirmModal , Label , Switch , toast } from '@sim/emcn'
11+ import { Folder } from '@sim/emcn/icons'
2112import { useParams , useRouter } from 'next/navigation'
2213import { getDesktopBridge } from '@/lib/desktop'
2314import { SettingsEmptyState } from '@/app/workspace/[workspaceId]/settings/components/settings-empty-state'
2415import { SettingsPanel } from '@/app/workspace/[workspaceId]/settings/components/settings-panel'
16+ import { SettingsResourceRow } from '@/app/workspace/[workspaceId]/settings/components/settings-resource-row'
2517import { SettingsSection } from '@/app/workspace/[workspaceId]/settings/components/settings-section/settings-section'
2618
2719function getMounts ( response : LocalFilesystemResponse ) : LocalFilesystemMount [ ] | null {
@@ -38,14 +30,10 @@ interface PreferenceRowProps {
3830
3931function PreferenceRow ( { id, label, checked, disabled, onCheckedChange } : PreferenceRowProps ) {
4032 return (
41- < TableRow >
42- < TableCell >
43- < Label htmlFor = { id } > { label } </ Label >
44- </ TableCell >
45- < TableCell >
46- < Switch id = { id } checked = { checked } disabled = { disabled } onCheckedChange = { onCheckedChange } />
47- </ TableCell >
48- </ TableRow >
33+ < div className = 'flex items-center justify-between' >
34+ < Label htmlFor = { id } > { label } </ Label >
35+ < Switch id = { id } checked = { checked } disabled = { disabled } onCheckedChange = { onCheckedChange } />
36+ </ div >
4937 )
5038}
5139
@@ -142,98 +130,98 @@ export function Desktop() {
142130 < >
143131 < SettingsPanel >
144132 < SettingsSection label = 'Notifications' >
145- < Table >
146- < TableBody >
147- < PreferenceRow
148- id = 'desktop-notifications'
149- label = 'Enable desktop notifications'
150- checked = { preferences . notificationsEnabled }
151- disabled = { pendingPreference !== null }
152- onCheckedChange = { ( checked ) =>
153- void updatePreference ( 'notificationsEnabled' , checked )
154- }
155- />
156- < PreferenceRow
157- id = 'desktop-notification-sounds'
158- label = 'Play notification sounds'
159- checked = { preferences . notificationSounds }
160- disabled = { notificationsDisabled || pendingPreference !== null }
161- onCheckedChange = { ( checked ) => void updatePreference ( 'notificationSounds' , checked ) }
162- />
163- < PreferenceRow
164- id = 'desktop-notifications-unfocused'
165- label = "Notify only when Sim isn't focused"
166- checked = { preferences . notificationsOnlyWhenUnfocused }
167- disabled = { notificationsDisabled || pendingPreference !== null }
168- onCheckedChange = { ( checked ) =>
169- void updatePreference ( 'notificationsOnlyWhenUnfocused' , checked )
170- }
171- />
172- </ TableBody >
173- </ Table >
133+ < div className = 'flex flex-col gap-3' >
134+ < PreferenceRow
135+ id = 'desktop-notifications'
136+ label = 'Enable desktop notifications'
137+ checked = { preferences . notificationsEnabled }
138+ disabled = { pendingPreference !== null }
139+ onCheckedChange = { ( checked ) => void updatePreference ( 'notificationsEnabled' , checked ) }
140+ />
141+ < PreferenceRow
142+ id = 'desktop-notification-sounds'
143+ label = 'Play notification sounds'
144+ checked = { preferences . notificationSounds }
145+ disabled = { notificationsDisabled || pendingPreference !== null }
146+ onCheckedChange = { ( checked ) => void updatePreference ( 'notificationSounds' , checked ) }
147+ />
148+ < PreferenceRow
149+ id = 'desktop-notifications-unfocused'
150+ label = "Notify only when Sim isn't focused"
151+ checked = { preferences . notificationsOnlyWhenUnfocused }
152+ disabled = { notificationsDisabled || pendingPreference !== null }
153+ onCheckedChange = { ( checked ) =>
154+ void updatePreference ( 'notificationsOnlyWhenUnfocused' , checked )
155+ }
156+ />
157+ </ div >
174158 </ SettingsSection >
175159
176160 < SettingsSection label = 'App behavior' >
177- < Table >
178- < TableBody >
179- < PreferenceRow
180- id = 'desktop-launch-at-login'
181- label = 'Launch Sim at login'
182- checked = { preferences . launchAtLogin }
183- disabled = { pendingPreference !== null }
184- onCheckedChange = { ( checked ) => void updatePreference ( 'launchAtLogin' , checked ) }
185- />
186- </ TableBody >
187- </ Table >
161+ < div className = 'flex flex-col gap-3' >
162+ < PreferenceRow
163+ id = 'desktop-launch-at-login'
164+ label = 'Launch Sim at login'
165+ checked = { preferences . launchAtLogin }
166+ disabled = { pendingPreference !== null }
167+ onCheckedChange = { ( checked ) => void updatePreference ( 'launchAtLogin' , checked ) }
168+ />
169+ < PreferenceRow
170+ id = 'desktop-auto-download-updates'
171+ label = 'Automatically download updates'
172+ checked = { preferences . autoDownloadUpdates }
173+ disabled = { pendingPreference !== null }
174+ onCheckedChange = { ( checked ) => void updatePreference ( 'autoDownloadUpdates' , checked ) }
175+ />
176+ </ div >
188177 </ SettingsSection >
189178
190179 < SettingsSection
191- label = 'Files '
180+ label = 'Local folders '
192181 action = {
193182 < Chip onClick = { ( ) => void addFolder ( ) } disabled = { mountMutationPending } >
194183 Add folder
195184 </ Chip >
196185 }
197186 >
198187 { mounts . length === 0 ? (
199- < SettingsEmptyState variant = 'inline' > No folders added.</ SettingsEmptyState >
188+ < SettingsEmptyState variant = 'inline' >
189+ No folder access granted. Chat can only read folders you add here.
190+ </ SettingsEmptyState >
200191 ) : (
201- < Table >
202- < TableBody >
203- { mounts . map ( ( mount ) => (
204- < TableRow key = { mount . id } >
205- < TableCell > { mount . name } </ TableCell >
206- < TableCell > { mount . uri } </ TableCell >
207- < TableCell >
192+ < div className = 'flex flex-col gap-2' >
193+ { mounts . map ( ( mount ) => (
194+ < SettingsResourceRow
195+ key = { mount . id }
196+ icon = { < Folder /> }
197+ title = { mount . name }
198+ description = { mount . path }
199+ trailing = {
200+ < div className = 'flex flex-shrink-0 items-center gap-2' >
201+ { ! mount . remembered && (
202+ < span className = 'text-[var(--text-muted)] text-caption' >
203+ Until app restarts
204+ </ span >
205+ ) }
208206 < Chip onClick = { ( ) => setMountToForget ( mount ) } > Revoke</ Chip >
209- </ TableCell >
210- </ TableRow >
211- ) ) }
212- </ TableBody >
213- </ Table >
207+ </ div >
208+ }
209+ />
210+ ) ) }
211+ </ div >
214212 ) }
215213 </ SettingsSection >
216-
217- < SettingsSection label = 'Updates' >
218- < Table >
219- < TableBody >
220- < PreferenceRow
221- id = 'desktop-auto-download-updates'
222- label = 'Automatically download updates'
223- checked = { preferences . autoDownloadUpdates }
224- disabled = { pendingPreference !== null }
225- onCheckedChange = { ( checked ) => void updatePreference ( 'autoDownloadUpdates' , checked ) }
226- />
227- </ TableBody >
228- </ Table >
229- </ SettingsSection >
230214 </ SettingsPanel >
231215
232216 < ChipConfirmModal
233217 open = { mountToForget !== null }
234218 onOpenChange = { ( open ) => ! open && setMountToForget ( null ) }
235219 title = 'Revoke folder access'
236- text = { `Sim will no longer be able to access ${ mountToForget ?. name ?? 'this folder' } .` }
220+ text = { [
221+ 'Sim will no longer be able to read ' ,
222+ { text : mountToForget ?. name ?? 'this folder' , bold : true } ,
223+ '. You can grant access again at any time.' ,
224+ ] }
237225 confirm = { {
238226 label : 'Revoke access' ,
239227 pending : mountMutationPending ,
0 commit comments