Repository navigation
fix(presentation): AppFlowy error states, official-cloud Present, AI access hints - #689
Merged
Merged
Conversation
…access hints - Load failures in the slides dialog use a centered AppFlowy error state (icon, title, message, Back to page / Retry buttons) instead of left-aligned text with legacy buttons. - A presented mind map or document that cannot load closes and shows an AppFlowy toast instead of a full-screen error page. Mind map empty states use the same centered component. - The header Present button (hidden for everyone by #688) now shows only on official AppFlowy Cloud: usePresentationEntryEnabled() follows useIsOfficialHosted(), so self-hosted servers never see it. - In the Present menu, AI mind map and AI ppt stay visible but unavailable for workspace guests (the server requires a member or owner) and for users without edit access to the page, with the reason shown on hover/focus. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideThe PR updates presentation UX around failures, availability, and access: it uses AppFlowy-native centered states and toasts, exposes Present only on confirmed official Cloud deployments, and explains unavailable AI options for guests or non-editors while preserving server-side fallback handling. Sequence diagram for presentation failure handlingsequenceDiagram
participant User
participant PresentationDialog
participant PresentationStudio
participant notify
participant Page
User->>PresentationDialog: Open presentation
PresentationDialog->>PresentationDialog: Load source and permissions
alt Slides load fails
PresentationDialog-->>User: Show PresentationState error
User->>PresentationDialog: Click Retry or Back to page
else Mind map or document load fails
PresentationDialog->>notify: notify.error(failure)
PresentationDialog->>Page: onClose()
Page-->>User: Return to page with toast
end
User->>PresentationStudio: Open saved mind map
PresentationStudio->>PresentationStudio: Load saved map or page structure
alt Map load fails
PresentationStudio->>notify: notify.error(mapPresentationError)
PresentationStudio->>PresentationStudio: closeMapPresentation()
Page-->>User: Return to page with toast
else Map is empty or unavailable
PresentationStudio-->>User: Show centered PresentationState
end
Sequence diagram for official Cloud Present visibilitysequenceDiagram
participant User
participant Header
participant ViewModal
participant usePresentationEntryEnabled
participant useIsOfficialHosted
participant ServerInfo
User->>Header: Open page
Header->>usePresentationEntryEnabled: Check Present availability
usePresentationEntryEnabled->>useIsOfficialHosted: Read hosting mode
useIsOfficialHosted->>ServerInfo: Read server information
alt Confirmed official AppFlowy Cloud
ServerInfo-->>useIsOfficialHosted: Official hosted
usePresentationEntryEnabled-->>Header: true
Header-->>User: Show Present button
usePresentationEntryEnabled-->>ViewModal: true
ViewModal-->>User: Show Present button
else Self-hosted, loading, or unavailable
ServerInfo-->>useIsOfficialHosted: Not confirmed official
usePresentationEntryEnabled-->>Header: false
usePresentationEntryEnabled-->>ViewModal: false
Header-->>User: Hide Present button
end
Sequence diagram for AI presentation access hintssequenceDiagram
participant User
participant PresentEntry
participant PresentationMenu
participant useUserWorkspaceInfoOptional
participant useViewActionPermissions
participant presentationAIAccessReason
User->>PresentEntry: Open Present menu
PresentEntry->>PresentEntry: setMenuOpen(true)
PresentEntry->>useUserWorkspaceInfoOptional: Read workspace role
PresentEntry->>useViewActionPermissions: Load page permissions
PresentEntry->>presentationAIAccessReason: Check role and canWrite
alt Workspace role is Guest
presentationAIAccessReason-->>PresentEntry: Guest reason
PresentEntry->>PresentationMenu: aiUnavailableReason
PresentationMenu-->>User: Greyed AI rows with lock tooltip
User->>PresentationMenu: Select AI row
PresentationMenu-->>User: Ignore selection
else Permissions loaded and page is not editable
presentationAIAccessReason-->>PresentEntry: Edit access reason
PresentEntry->>PresentationMenu: aiUnavailableReason
PresentationMenu-->>User: Greyed AI rows with lock tooltip
else Access is allowed or unknown
presentationAIAccessReason-->>PresentEntry: undefined
PresentationMenu-->>User: Enable AI rows
User->>PresentationMenu: Select AI row
PresentationMenu->>PresentEntry: onSelect(mode)
end
Flow diagram for AI presentation availabilityflowchart TD
A[Open Present menu] --> B{Workspace role is Guest?}
B -->|Yes| C[Show AI rows unavailable]
B -->|No| D{Page permissions loaded?}
D -->|No| E[Keep AI rows available]
D -->|Yes| F{canWrite?}
F -->|No| C
F -->|Yes| E
C --> G[Show lock icon and access tooltip]
C --> H[aria-disabled and ignore selection]
E --> I[Selecting AI row starts presentation]
I --> J{Server-side access succeeds?}
J -->|No| K[Toast error and close presentation]
J -->|Yes| L[Open AI presentation]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Three presentation UI fixes.
1. Error states use AppFlowy components (no full-screen errors)
Buttons (outline Back to page, primary Retry). Before, it was left-aligned text with legacy white buttons.notify.error) says why. A presented map that can't load keeps showing the loading surface until it closes, so the old error page never flashes.PresentationStatecomponent, with the close button where the map's would be.2. Present button: official AppFlowy Cloud only
#688 hid the header Present button for everyone with
PRESENTATION_ENTRY_ENABLED = false.feature-flags.tsnow exportsusePresentationEntryEnabled(), which followsuseIsOfficialHosted():3. AI options explain missing permission
SOURCE_ACCESS_DENIEDused to surface only after opening, as a full-screen error. The Cloud presentation API requires a workspace member or owner (enforce_role_strong(Member)), so a guest who can edit the page passes the web's edit check but is still refused.In the Present menu, Present AI mind map and Generate AI ppt stay visible but unavailable (
aria-disabled, greyed out, selection ignored) when:The reason appears with a lock icon in the existing hover/focus tooltip. These rows don't use Radix
disabled, because that removes pointer events and the tooltip would never show. Page permission is read only while the menu is open, and unknown permission doesn't block. A denial the client can't predict, such as a mentioned page or linked database the user can't read, still falls back to the toast from (1).Validation
pnpm type-checkpassed. ESLint shows no errors in the changed files.--maxWorkers=2.Checklist
General
Testing
Feature-Specific
🤖 Generated with Claude Code
Summary by Sourcery
Improve presentation availability and failure handling across hosted environments while providing clearer guidance for unavailable AI presentation options.
New Features:
Bug Fixes:
Enhancements:
Documentation:
Tests: