feat(core): new all docs list ui (#12102)

### New all docs list ui
close AF-2531, AF-2585, AF-2586, AF-2580

### What changed

- a new `display-menu` component
  - properties visibility
  - quick actions visibility
- extend DocPropertyType definition
  - `showInDocList`: configure whether to show in doc and how to show (stack | inline)
  - `docListProperty`: define how to render property in doc
  - `groupHeader`: define how to render group header when grouped
- implement all properties's `docListProperty` renderer and `groupHeader` renderer
- new `docs-view` component
  - render doc in `card` | `list` view
  - split doc card into minimal components for reuse in list and card views, as well as visibility control
- implement docs-list with `<Masonry />` and multi-view support
  - for list view, make masonry column count always `1`

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **New Features**
  - Redesigned document explorer with multiple view modes (list, grid, masonry), grouping, selection, and multi-delete.
  - Added customizable display properties and quick actions (favorite, trash, split view, new tab, select) for documents.
  - Introduced new group header and document item components with improved styling and interaction.
  - Enabled dynamic rendering of document properties including tags, dates, users, templates, and themes.
  - Added filtering support for trash status and enhanced localization for UI elements.
  - Introduced drag handle size customization and expanded masonry layout configurability.
  - Added contextual "More" menu with document operations like favorite, info, duplicate, and trash.
  - Implemented shared context for explorer state management and multi-selection logic.

- **Enhancements**
  - Improved virtual scrolling with active item tracking and configurable preload and debounce settings.
  - Responsive, theme-aware styling applied across explorer and property components.
  - Configurable UI elements and quick actions via user preferences.
  - Enhanced error messages for unsupported property types in filters.
  - Refined padding and layout calculations in masonry component for better visual consistency.
  - Avatar and date components refactored for explicit prop-driven rendering and customization.

- **Bug Fixes**
  - Improved error messages for unsupported property types in filters.

- **Documentation**
  - Added new localization keys and updated language completeness for new features.

- **Chores**
  - Modularized workspace property types with list and group header display components.
  - Consolidated imports and enhanced code maintainability.
  - Added new CSS styling modules for explorer components and workspace property types.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
CatsJuice
2025-05-09 05:31:10 +00:00
parent 93e01b4442
commit 2e3b721603
48 changed files with 3060 additions and 124 deletions

View File

@@ -1,26 +1,26 @@
{
"ar": 97,
"ar": 96,
"ca": 4,
"da": 4,
"de": 97,
"el-GR": 97,
"de": 96,
"el-GR": 96,
"en": 100,
"es-AR": 97,
"es-AR": 96,
"es-CL": 98,
"es": 97,
"fa": 97,
"fr": 97,
"es": 96,
"fa": 96,
"fr": 96,
"hi": 2,
"it-IT": 97,
"it-IT": 96,
"it": 1,
"ja": 97,
"ja": 96,
"ko": 56,
"pl": 97,
"pt-BR": 97,
"ru": 97,
"sv-SE": 97,
"uk": 97,
"pl": 96,
"pt-BR": 96,
"ru": 96,
"sv-SE": 96,
"uk": 96,
"ur": 2,
"zh-Hans": 97,
"zh-Hant": 97
"zh-Hans": 96,
"zh-Hant": 96
}

View File

@@ -593,6 +593,18 @@ export function useAFFiNEI18N(): {
* `current`
*/
current(): string;
/**
* `created at {{time}}`
*/
["created at"](options: {
readonly time: string;
}): string;
/**
* `last updated at {{time}}`
*/
["updated at"](options: {
readonly time: string;
}): string;
/**
* `Automatically check for new updates periodically.`
*/
@@ -6908,6 +6920,46 @@ export function useAFFiNEI18N(): {
* `Inactive workspace`
*/
["com.affine.inactive-workspace"](): string;
/**
* `Display Properties`
*/
["com.affine.all-docs.display.properties"](): string;
/**
* `List view options`
*/
["com.affine.all-docs.display.list-view"](): string;
/**
* `Icon`
*/
["com.affine.all-docs.display.list-view.icon"](): string;
/**
* `Body`
*/
["com.affine.all-docs.display.list-view.body"](): string;
/**
* `Quick actions`
*/
["com.affine.all-docs.quick-actions"](): string;
/**
* `Favorite`
*/
["com.affine.all-docs.quick-action.favorite"](): string;
/**
* `Move to trash`
*/
["com.affine.all-docs.quick-action.trash"](): string;
/**
* `Open in split view`
*/
["com.affine.all-docs.quick-action.split"](): string;
/**
* `Open in new tab`
*/
["com.affine.all-docs.quick-action.tab"](): string;
/**
* `Select checkbox`
*/
["com.affine.all-docs.quick-action.select"](): string;
/**
* `core`
*/

View File

@@ -137,6 +137,8 @@
"Deleted User": "Deleted User",
"all": "all",
"current": "current",
"created at": "created at {{time}}",
"updated at": "last updated at {{time}}",
"com.affine.aboutAFFiNE.autoCheckUpdate.description": "Automatically check for new updates periodically.",
"com.affine.aboutAFFiNE.autoCheckUpdate.title": "Check for updates automatically",
"com.affine.aboutAFFiNE.autoDownloadUpdate.description": "Automatically download updates (to this device).",
@@ -1725,6 +1727,16 @@
"com.affine.inactive": "Inactive",
"com.affine.inactive-member": "Inactive member",
"com.affine.inactive-workspace": "Inactive workspace",
"com.affine.all-docs.display.properties": "Display Properties",
"com.affine.all-docs.display.list-view": "List view options",
"com.affine.all-docs.display.list-view.icon": "Icon",
"com.affine.all-docs.display.list-view.body": "Body",
"com.affine.all-docs.quick-actions": "Quick actions",
"com.affine.all-docs.quick-action.favorite": "Favorite",
"com.affine.all-docs.quick-action.trash": "Move to trash",
"com.affine.all-docs.quick-action.split": "Open in split view",
"com.affine.all-docs.quick-action.tab": "Open in new tab",
"com.affine.all-docs.quick-action.select": "Select checkbox",
"core": "core",
"dark": "Dark",
"invited you to join": "invited you to join",