mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-05 19:40:30 +08:00
refactor(editor): add a layer of ui-logic to enhance type safety (#12511)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced modular UI logic layers for Kanban and Table views, enhancing maintainability and scalability. - Added new CSS-in-JS style modules for database blocks and table views, improving visual consistency. - Expanded telemetry event tracking for database views, properties, filters, and groups. - Added utility functions for lazy initialization and cached computed values. - **Refactor** - Unified logic and state management across Kanban and Table views by replacing direct component dependencies with logic-centric architecture. - Updated components and widgets to use the new logic-based approach for state, selection, and event handling. - Replaced inline styles with CSS classes; updated class names to align with new component structure. - Centralized state access through UI logic instances, eliminating direct DOM queries and simplifying dependencies. - Consolidated Kanban and Table view presets effects for streamlined initialization. - Replaced Lit reactive state with Preact signals in multiple components for improved reactivity. - Split monolithic components into separate logic and UI classes for clearer separation of concerns. - Removed obsolete components and consolidated exports for cleaner API surface. - **Bug Fixes** - Enhanced selection and interaction reliability in database cells and views. - Fixed scrolling issues on mobile table views for improved compatibility. - **Chores** - Updated end-to-end test selectors to reflect new component names and structure. - Removed deprecated utilities and cleaned up unused imports. - **Documentation** - Improved type definitions and public API exports for better developer experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -48,7 +48,7 @@ export async function pasteString(page: Page, data: string) {
|
||||
}
|
||||
|
||||
export async function selectCell(page: Page, nth: number, editing = true) {
|
||||
const firstCell = page.locator('affine-database-cell-container').nth(nth);
|
||||
const firstCell = page.locator('dv-table-view-cell-container').nth(nth);
|
||||
// First click for focus
|
||||
await firstCell.click({ delay: 100 });
|
||||
// Second click for edit mode
|
||||
@@ -62,7 +62,7 @@ export async function verifyCellContents(
|
||||
page: Page,
|
||||
expectedContents: string[]
|
||||
) {
|
||||
const cells = page.locator('affine-database-cell-container');
|
||||
const cells = page.locator('dv-table-view-cell-container');
|
||||
for (let i = 0; i < expectedContents.length; i++) {
|
||||
const cell = cells.nth(i);
|
||||
await expect(cell.locator('uni-lit > *:first-child')).toHaveText(
|
||||
|
||||
Reference in New Issue
Block a user