mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-02 05:54:44 +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:
@@ -16,6 +16,7 @@ import { useMemberStore } from '@/ui/stores/members'
|
||||
import { useTeamContextStore } from '@/ui/stores/team-context'
|
||||
import { useTopNavStore } from '@/ui/stores/top-nav'
|
||||
import { useUiStore } from '@/ui/stores/ui'
|
||||
import { useUserMetadataStore } from '@/ui/stores/user-metadata'
|
||||
import { type Annotation } from '@/ui/types'
|
||||
import { useMutation } from '@tanstack/react-query'
|
||||
import { createLazyFileRoute } from '@tanstack/react-router'
|
||||
@@ -72,6 +73,7 @@ function FileViewPage() {
|
||||
const [annotations, setAnnotations] = useState<Annotation[]>([])
|
||||
const { fileViewRightSidebarCollapsed } = useUiStore()
|
||||
const { isChatbotOpen } = useChatbotStore()
|
||||
const hideAgent = useUserMetadataStore((s) => Boolean(s.metadata['appearance.hideAgent']))
|
||||
const [currentTime, setCurrentTime] = useState(0)
|
||||
const [selectedCommentId, setSelectedCommentId] = useState<string | null>(null)
|
||||
const [compareActiveAsset, setCompareActiveAsset] = useState<AssetInfo | null>(null)
|
||||
@@ -713,7 +715,7 @@ function FileViewPage() {
|
||||
</FileViewer>
|
||||
)}
|
||||
</div>
|
||||
{(!fileViewRightSidebarCollapsed || isChatbotOpen) && (
|
||||
{(!fileViewRightSidebarCollapsed || (isChatbotOpen && !hideAgent)) && (
|
||||
<>
|
||||
<ResizeHandle
|
||||
onResize={(delta) => {
|
||||
@@ -725,7 +727,7 @@ function FileViewPage() {
|
||||
style={{ width: rightSidebarWidth }}
|
||||
className="flex-shrink-0 bg-background flex flex-col"
|
||||
>
|
||||
{isChatbotOpen ? (
|
||||
{isChatbotOpen && !hideAgent ? (
|
||||
<ChatbotSidebar
|
||||
projectId={projectId}
|
||||
contextAssetId={activeFileId}
|
||||
|
||||
Reference in New Issue
Block a user