diff --git a/src/components/ActivityPanel.tsx b/src/components/ActivityPanel.tsx index 59ac93b..179a93e 100644 --- a/src/components/ActivityPanel.tsx +++ b/src/components/ActivityPanel.tsx @@ -109,15 +109,5 @@ export function ActivityPanel({ isOpen, onClose }: ActivityPanelProps) { ); } -// Toggle button component for the toolbar -export function ActivityToggleButton({ onClick, isActive }: { onClick: () => void; isActive: boolean }) { - return ( - - ); -} +// Note: ActivityToggleButton has been removed - activity panel is now toggled +// from the settings dropdown via a custom event 'toggle-activity-panel' diff --git a/src/routes/Board.tsx b/src/routes/Board.tsx index 40b14ca..14cf09d 100644 --- a/src/routes/Board.tsx +++ b/src/routes/Board.tsx @@ -141,7 +141,7 @@ import { updateLastVisited } from "../lib/starredBoards" import { recordBoardVisit } from "../lib/visitedBoards" import { captureBoardScreenshot } from "../lib/screenshotService" import { logActivity } from "../lib/activityLogger" -import { ActivityPanel, ActivityToggleButton } from "../components/ActivityPanel" +import { ActivityPanel } from "../components/ActivityPanel" import { WORKER_URL } from "../constants/workerUrl" @@ -528,6 +528,17 @@ export function Board() { const [editor, setEditor] = useState(null) const [isActivityPanelOpen, setIsActivityPanelOpen] = useState(false) + // Listen for toggle-activity-panel event from settings dropdown + useEffect(() => { + const handleToggleActivityPanel = () => { + setIsActivityPanelOpen(prev => !prev) + } + window.addEventListener('toggle-activity-panel', handleToggleActivityPanel) + return () => { + window.removeEventListener('toggle-activity-panel', handleToggleActivityPanel) + } + }, []) + // Update read-only state when permission changes after editor is mounted useEffect(() => { if (!editor) return @@ -1474,14 +1485,7 @@ export function Board() { /> )} */} - {/* Activity Panel Toggle Button */} -
- setIsActivityPanelOpen(!isActivityPanelOpen)} - isActive={isActivityPanelOpen} - /> -
- {/* Activity Panel */} + {/* Activity Panel - toggled from settings dropdown */} setIsActivityPanelOpen(false)} diff --git a/src/ui/components.tsx b/src/ui/components.tsx index 23b74d7..2d72176 100644 --- a/src/ui/components.tsx +++ b/src/ui/components.tsx @@ -71,6 +71,7 @@ function CustomSharePanel() { const [mobileMenuSection, setMobileMenuSection] = React.useState<'main' | 'signin' | 'share' | 'settings'>('main') // const [showVersionHistory, setShowVersionHistory] = React.useState(false) // TODO: Re-enable when version reversion is ready const [showAISection, setShowAISection] = React.useState(false) + const [showActivitySection, setShowActivitySection] = React.useState(false) const [hasApiKey, setHasApiKey] = React.useState(false) const [permissionRequestStatus, setPermissionRequestStatus] = React.useState<'idle' | 'sending' | 'sent' | 'error'>('idle') const [requestMessage, setRequestMessage] = React.useState('') @@ -958,131 +959,72 @@ function CustomSharePanel() { onWheel={(e) => e.stopPropagation()} onClick={(e) => e.stopPropagation()} > - {/* Board Permission Section */} -
- {/* Section Header */} + {/* Your Permission - simplified display */} +
- 🔐 - Board Permission + + {PERMISSION_CONFIG[currentPermission].icon} + Your Permission + {PERMISSION_CONFIG[currentPermission].label}
- {/* Permission levels - indented to show hierarchy */} -
- - Access Levels - - {(['view', 'edit', 'admin'] as PermissionLevel[]).map((level) => { - const config = PERMISSION_CONFIG[level] - const isCurrent = currentPermission === level - const canRequest = session.authed && !isCurrent && ( - (level === 'edit' && currentPermission === 'view') || - (level === 'admin' && currentPermission !== 'admin') - ) - - return ( -
- - {config.icon} - {config.label} - {isCurrent && ( - - Current - - )} - - - {canRequest && ( - - )} -
- ) - })} -
+ {/* Request higher permission button */} + {session.authed && currentPermission !== 'admin' && ( + + )} {/* Request status message */} {requestMessage && (

+ {/* Activity Log Accordion */} +

+ + + {showActivitySection && ( +
+

+ Track shape creations, deletions, and updates on this board. +

+ +
+ )} +
+ +
+ {/* Show Tutorial Button */}