Skip to content

feat: align Gallery UI with desktop - #661

Merged
appflowy merged 13 commits into
mainfrom
codex/gallery-desktop-parity
Oct 23, 2026
Merged

appflowy merged 13 commits into
mainfrom
codex/gallery-desktop-parity

Conversation

@appflowy

@appflowy appflowy commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Description

Web Gallery now follows the merged desktop redesign in AppFlowy-Premium #1493 and its Figma design.

  • Match card spacing, property layout, hover styling, and the floating dark toolbar in light and dark mode.
  • Put card preview, card size, Fit image, and Compact mode in the Layout submenu; expose property visibility and grouping alongside it.
  • Add grouped Gallery sections with collapse, visibility, search, and group-aware row creation using the shared database grouping format.
  • Reposition file covers with drag or keyboard controls, Save/Cancel/Escape, and automatic saving when entering another card's reposition mode. Read-only cards retain peek without editing controls.

Validation

  • 172 tests passed across 18 Gallery, shared grouping, and List suites.
  • 4 Chromium browser tests passed: light/dark rendering, compact preference persistence, responsive sizing, cover positioning, read-only actions, grouped search, and collapse.
  • pnpm type-check, changed-source ESLint, and pnpm build passed.
  • Browser reproduction: pnpm exec playwright test playwright/e2e/database/gallery-desktop.spec.ts --workers=1. The fixture runs the real components and Yjs dispatches without a server account.

Feature Preview

Captured from the local browser fixture with built-in sample covers.

Light mode

Gallery in light mode

Dark mode

Gallery in dark mode

Layout settings

Gallery layout settings

Grouped Gallery

Grouped Gallery

Checklist

General

  • Included relevant comments for the changes.
  • Tested in multiple browsers or operating systems. Local browser validation used Chromium on macOS.

Testing

  • Added or updated tests for the changes.

Feature-Specific

  • Added screenshots in Feature Preview.
  • Verified integration with existing grouping, search, row creation, and read-only behavior.

Summary by Sourcery

Bring the Web Gallery experience into parity with the desktop redesign, including its presentation, controls, grouping workflows, and cover editing behavior.

New Features:

  • Align the Gallery view with the desktop redesign across light and dark themes, including card presentation, spacing, hover actions, and settings organization.
  • Add Gallery grouping with shared database grouping behavior, collapsible sections, search-aware visibility, per-group pagination, and grouped row creation.
  • Add cover repositioning with pointer and keyboard controls, save/cancel workflows, automatic session saving, and read-only peek-only behavior.
  • Add persistent Gallery compact mode and desktop-style layout, property visibility, and grouping controls.

Bug Fixes:

  • Prevent Gallery grouping settings and row-order handling from interfering with other view layouts.
  • Preserve Gallery cover positioning in previews and ensure grouping, search, and read-only interactions behave consistently.

Enhancements:

  • Extend shared database grouping and list-cell behavior to support Gallery-specific presentation and metadata synchronization.
  • Improve Gallery action menus, submenu interaction, responsive sizing, card property wrapping, and row creation presentation.

Tests:

  • Add unit and browser coverage for Gallery appearance, settings persistence, responsive sizing, grouping, search, cover repositioning, read-only behavior, and grouped row creation.

@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Sorry @appflowy, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 21 hours and 44 minutes by commenting @sourcery-ai review. Upgrade to get a review now.

@sourcery-ai

sourcery-ai Bot commented Oct 22, 2026

Copy link
Copy Markdown

Reviewer's Guide

This PR brings the web Gallery in line with the desktop redesign by updating its visual system and settings hierarchy, adding shared-format grouping and group-aware creation/search/collapse behavior, implementing accessible cover repositioning with persistence and read-only handling, and validating the changes through expanded unit tests plus a real-component Chromium fixture.

Sequence diagram for Gallery cover repositioning

sequenceDiagram
  actor User
  User->>GalleryCardToolbar: click gallery-card-reposition
  GalleryCardToolbar->>GalleryViewProvider: begin
  GalleryViewProvider->>GalleryCard: activate reposition session
  User->>GalleryCard: ArrowUp or drag cover
  GalleryCard->>GalleryPreview: render draft offset
  alt Save
    User->>GalleryCardToolbar: click gallery-cover-save
    GalleryCard->>Yjs: useUpdateRowMetaDispatch
    Yjs-->>GalleryCard: persist RowMetaKey.CoverId
  else Cancel or Escape
    User->>GalleryCardToolbar: click gallery-cover-cancel
    GalleryCard->>GalleryCard: discard draft offset
  else Open another card
    GalleryViewProvider->>GalleryCard: save previous session
    GalleryCard->>Yjs: useUpdateRowMetaDispatch
  end
Loading

State diagram for Gallery card interaction modes

stateDiagram-v2
  [*] --> Peekable
  Peekable --> Repositioning: click gallery-card-reposition
  Repositioning --> Peekable: gallery-cover-cancel
  Repositioning --> Peekable: Escape
  Repositioning --> Peekable: gallery-cover-save
  Repositioning --> Repositioning: begin another card / save previous
  Peekable --> ReadOnlyPeek: readOnly
  ReadOnlyPeek --> PeekOpened: click gallery-card-peek
  PeekOpened --> ReadOnlyPeek: close peek
Loading

Flow diagram for grouped Gallery rendering and row creation

flowchart TD
  Configure[Configure Gallery grouping] --> Grouping[Load shared grouping state]
  Grouping --> Filter[Filter groups and rows by search query]
  Filter --> Collapse{Group collapsed?}
  Collapse -->|Yes| Header[Render group header only]
  Collapse -->|No| Cards[Render group cards]
  Cards --> NewRow[Create row in current group]
  Header --> Expand[Expand group]
  Expand --> Cards
Loading

File-Level Changes

Change Details Files
Reworked Gallery presentation and settings to match the desktop redesign across light/dark themes.
  • Updated card spacing, sizing, property wrapping, hover states, toolbar styling, responsive columns, and semantic theme tokens.
  • Moved preview, card size, image fitting, and compact mode controls into the Layout submenu, with property visibility and grouping controls exposed in Gallery settings.
  • Added persisted per-view compact mode and desktop-compatible submenu interactions.
src/components/database/gallery/Gallery.tsx
src/components/database/gallery/GalleryCard.tsx
src/components/database/gallery/GalleryCardToolbar.tsx
src/components/database/gallery/GalleryNewRow.tsx
src/components/database/gallery/GalleryPreview.tsx
src/components/database/gallery/gallery.constants.ts
src/components/database/components/settings/GalleryLayoutSettings.tsx
src/components/database/components/settings/GallerySettings.tsx
src/components/database/components/settings/Layout.tsx
src/components/database/components/settings/Properties.tsx
src/components/database/list/ListCell.tsx
src/components/database/gallery/GalleryViewContext.tsx
Added Gallery grouping using the shared database grouping infrastructure.
  • Registered Gallery as an optional groupable layout with its own layout-settings slot and hide-empty behavior.
  • Rendered searchable, collapsible group sections with group-aware pagination, visibility controls, and grouped row creation.
  • Integrated Gallery grouping provider/context into normal database views and synchronized shared grouping metadata.
src/components/database/gallery/Gallery.tsx
src/components/database/gallery/GalleryViewContext.tsx
src/components/database/gallery/GalleryGroupFooter.tsx
src/components/database/components/settings/GallerySettingGroup.tsx
src/components/database/components/settings/GallerySettings.tsx
src/application/database-yjs/dispatch.ts
src/application/database-yjs/selector.ts
src/application/database-yjs/__tests__/useGridGroupingSelector.test.tsx
src/components/database/list/ListGroup.tsx
src/components/database/DatabaseViews.tsx
Implemented editable file-cover repositioning with desktop-style interaction and read-only safeguards.
  • Added drag and keyboard offset adjustment with clamping, live preview, Save/Cancel/Escape behavior, and automatic commit when another card enters reposition mode.
  • Added reposition, peek, edit, and menu toolbar actions while hiding editing controls for read-only cards.
  • Persisted cover offsets through row metadata and applied them to preview image object positioning.
src/components/database/gallery/GalleryCard.tsx
src/components/database/gallery/GalleryCardToolbar.tsx
src/components/database/gallery/GalleryPreview.tsx
src/components/database/gallery/GalleryViewContext.tsx
src/assets/icons/reposition.svg
Expanded automated coverage with a real-component Chromium fixture and updated unit tests.
  • Added a Vite-served Yjs Gallery fixture exercising appearance, settings persistence, responsive sizing, grouping/search/collapse, cover editing, and read-only behavior.
  • Updated Gallery, grouping, settings, toolbar, row creation, and shared cell tests for the new behavior.
playwright/e2e/database/gallery-desktop.spec.ts
playwright/support/gallery-desktop.fixture.tsx
playwright/previews/gallery-desktop/gallery-light.png
playwright/previews/gallery-desktop/gallery-dark.png
playwright/previews/gallery-desktop/gallery-layout.png
playwright/previews/gallery-desktop/gallery-grouped.png
src/components/database/components/settings/__tests__/GalleryLayoutSettings.test.tsx
src/components/database/components/settings/__tests__/GallerySettings.test.tsx
src/components/database/gallery/__tests__/Gallery.search.test.tsx
src/components/database/gallery/__tests__/Gallery.test.tsx
src/components/database/gallery/__tests__/GalleryCard.test.tsx
src/components/database/gallery/__tests__/GalleryCardToolbar.test.tsx
src/components/database/gallery/__tests__/GalleryNewRow.test.tsx
src/components/database/list/__tests__/ListGroup.test.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

appflowy and others added 6 commits October 22, 2026 21:56
- Page grouped galleries per group so "Load more" grows the group it was clicked in
- Keep the cover drag preview inside GalleryCardCover so pointer moves re-render only the cover
- Replace render-time ref writes with a shared useLatest hook
- Resolve the compact-mode preference per view instead of relying on a provider key
- Share the submenu pointer guard between Layout and the Gallery layout options
- Desktop parity: "Gallery" caption above the layout options, 200px card menu, "More" tooltip, 20px document indicator, "No groups for {field}" empty state, hint pill and hover alphas
- Fix DatabaseViews tests that mocked ListGroupingContext without useSyncListGroupingMetadata

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Save and Cancel in the reposition bar use 14px medium text at 64px width; Save gets the 4px radius and 8px side padding from the Figma floating action bar
- The "Drag image to reposition" hint is a 40% black pill with fully opaque text, as in Figma node 7438:222959
- The "Gallery" caption above the layout options uses the Caption_S/Enhanced weight (500)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Web now follows the Figma gallery (Database file, node 7404:109352).
Desktop differences are listed in docs/gallery-view-figma-parity.md.

- Cards: 12px radius, 16px gaps, 16:9 covers, layer-02 surface, hover
  border instead of a lifted shadow, wrapping 500-weight titles, 8px
  title gap, 12px compact spacing, person names only for one person
- Columns follow the Figma size ranges (Small 200, Medium 260, Large
  361 minimum widths)
- Toolbar: Reposition, Rename, More with the Figma rename icon; the
  More menu is 240px with Copy link, Duplicate, Delete; no Peek button,
  since clicking the card opens the row
- Groups: Figma header styling, Hide group and Delete with the Delete
  group confirmation, New group for select fields that stays visible
  while empty, and New page in the last row's free slot
- New page tile is transparent; footer icons use icon/tertiary
- Layout settings row shows the Gallery icon
- Fix gallery e2e helpers and assertions that still targeted the
  pre-branch settings submenu

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row peek was keyed by database and row id, so previous/next remounted
the whole peek. The side panel was hidden and replayed its entrance
animation, and a center peek choice fell back to the view's default (side
peek for grid, board, gallery and list). Key the peek by database only so
row navigation swaps the content in place, matching Desktop
AppFlowy-Premium#1495. The scroller is keyed by row so each row still
starts at the top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AI chat specs fail with Cloud reporting only "AI service is temporarily
unavailable" because http://ai:5001 is unreachable; the AI container has
already exited, but its logs were never collected. Save them, plus the
container exit states, before the stack is torn down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cloud-Premium #1441 moved the AI service into Cloud, and from Cloud 0.20.1
the published appflowy_ai_premium:latest-amd64 expects Cloud's shared
migrations to have created its schema. CI pins Cloud to a pre-#1441
revision, so the new AI image exits with "AI database schema is missing
(af_ai_registry_bootstrap_state)", Cloud rejects AI chat creation as
"AI service is temporarily unavailable", and every AI chat spec fails.

Pin the last standalone AI release (0.13.5), which applies its own
migrations, until CLOUD_REVISION moves past #1441.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
appflowy and others added 6 commits October 23, 2026 11:48
Cloud-Premium #1441 moved the AI service into Cloud, which now owns the AI
schema, so the AI image must come from the same revision as Cloud. Move the
backend from the custom ci-web-row-list-9563cf767ef1 build to the 0.20.2
release, take the AI image from CLOUD_VERSION instead of a separate tag,
and verify its revision with the other Rust images.

0.20.2 includes atomic row creation (Cloud-Premium #1375); the List
field-order repair (#1372) that the custom build carried is not released.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The e2e spec still asserted that previous/next demotes center peek to
side peek. Assert the new contract instead: the mode persists while the
peek is open, the next opening starts in side peek again, and swapping
rows never hides the side panel (the old per-row remount toggled its
hidden attribute twice and replayed the entrance animation).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Cloud 0.20.2's larger seeded workspace, "Database 1 (Copy)" is
appended below the visible sidebar, so the spec's forced click landed on
the sidebar footer's Trash button instead. Use openCopiedPage, which
falls back to the copy's own route when the sidebar click misses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pull latest-amd64 for Cloud, Worker, Search and AI, and resolve the
source revision behind that tag at the start of each test job, so the
Cloud-Premium checkout (compose files, deploy.env, seed snapshot)
always matches the images. The image-revision check still rejects a
mixed set, for example while a release is being published.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-parity

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@appflowy
appflowy merged commit a7e4c2c into main Oct 23, 2026
3 of 23 checks passed
@appflowy
appflowy deleted the codex/gallery-desktop-parity branch October 23, 2026 11:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant