mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-30 12:54:55 +00:00
feat(settings): add team appearance setting to hide agent features (#411)
* feat(settings): add team appearance setting to hide agent features Add an Appearance subpage under Team Settings allowing team owners to toggle appearance.hideAgent for the team. Return appearance.hideAgent in the user-metadata API, and conditionally hide the AGENTS.md button, agent chatbot sidebar, and chatbot trigger button in the WebUI. * refactor(settings): add strongly typed TeamSettingsResponse to remove explicit any Introduce TeamSettingsResponse and TeamAppearanceSettings in @shumai/dtos, type TeamService.getSettings and updateSettings, and eliminate the explicit any cast in AppearanceSettings.tsx.
This commit is contained in:
@@ -19,6 +19,7 @@ import { Button } from '../ui/button'
|
||||
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
|
||||
import { Separator } from '../ui/separator'
|
||||
import { cn } from '@/ui/lib/utils'
|
||||
import { useUserMetadataStore } from '@/ui/stores/user-metadata'
|
||||
|
||||
type FileBrowserToolbarProps = {
|
||||
teamId: string
|
||||
@@ -63,6 +64,7 @@ export function FileBrowserToolbar({
|
||||
const activeFiltersCount = filterConditions.length
|
||||
const isCollection = !!collection
|
||||
const queryClient = useQueryClient()
|
||||
const hideAgent = useUserMetadataStore((s) => Boolean(s.metadata['appearance.hideAgent']))
|
||||
|
||||
const { data: folderInfo } = useQuery({
|
||||
queryKey: ['folders', assetId],
|
||||
@@ -365,7 +367,7 @@ export function FileBrowserToolbar({
|
||||
)}
|
||||
</Button>
|
||||
|
||||
{!isRecentlyDeleted && !isRecents && (
|
||||
{!isRecentlyDeleted && !isRecents && !hideAgent && (
|
||||
<>
|
||||
<Separator orientation="vertical" />
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user