mirror of
https://github.com/nexu-io/open-design.git
synced 2026-10-27 09:51:12 +01:00
* feat(deck): enhance slide deck functionality with speaker notes and navigation improvements - Added a switch for including speaker notes in slide decks, defaulting to true. - Updated keyboard navigation to include 'R' for resetting to the first slide. - Implemented click navigation for half-slide transitions. - Enhanced the deck framework to support hidden programmatic prev/next controls. - Improved handling of file inputs in question forms to support file submissions. This update aims to improve user experience in creating and presenting slide decks, ensuring better accessibility and functionality. * feat(artifacts): enforce semantic naming for user-facing deliverables - Updated guidelines to require semantic filenames derived from user briefs for new artifacts, moving away from defaulting to `index.html`. - Enhanced documentation to clarify naming conventions for HTML files, emphasizing the use of descriptive names like `investor-pitch-deck.html`. - Adjusted prompts and hints across the system to reflect these changes, ensuring consistency in user-facing outputs. - Improved test coverage to validate the new naming conventions and ensure proper implementation in various contexts. This update aims to enhance clarity and usability in project file management, promoting better organization and user experience. * feat(file-viewer): enhance speaker notes display and improve file workspace functionality - Updated the speaker notes section to include a styled placeholder for empty notes, improving user experience. - Changed the icon in the file workspace from "slides" to "panel-left" for better clarity. - Introduced new sub-category filtering options in the file workspace, enhancing organization and navigation. - Improved styling for the page creator search input and added visual feedback for loading states. These changes aim to enhance usability and visual consistency across the file viewer and workspace components. * test(web): align workspace tests with pages switcher * test(e2e): open design files through pages menu * fix(deck): keep source mode reachable * fix(workspace): restore uploaded file tabs * feat(deck-thumbnail): implement virtualized thumbnail rail for improved performance - Introduced a new `DeckThumbnailRail` component to optimize the rendering of deck thumbnails, reducing memory usage and improving load times. - Enhanced the `FileViewer` to integrate the new thumbnail rail, allowing for lazy loading of thumbnails based on viewport visibility. - Added tests for the `DeckThumbnailRail` to ensure correct functionality and caching behavior. - Updated styles for better visual consistency and performance during thumbnail rendering. These changes aim to enhance user experience by providing a smoother and more efficient way to navigate through deck slides. * feat(deck): enhance deck rendering with thumbnail support and keyboard shortcuts - Integrated `DeckSlideThumbnail` for rendering individual slides in a shadow root, improving performance and reducing main-thread load. - Updated `DeckThumbnailRail` to utilize the new thumbnail component, allowing for efficient slide navigation. - Implemented keyboard shortcuts for deck navigation, enhancing user experience during presentations. - Added tests for `buildDeckRenderInput` to ensure proper functionality of the deck stage fallback. - Improved styling for loading states in the viewer, providing a smoother visual experience. These changes aim to optimize the deck viewing experience by reducing resource consumption and enhancing interactivity. * feat(deck): improve thumbnail loading and speaker notes editing experience - Refactored `DeckSlideThumbnail` to enhance loading states with a new shimmer effect, improving visual feedback during thumbnail rendering. - Updated `DeckThumbnailRail` to manage loading states for thumbnails, ensuring a smoother user experience. - Simplified the speaker notes editing interface by removing the toggle switch, allowing direct editing from the notes body. - Enhanced accessibility by adding roles and focus states to speaker notes elements. - Added tests to verify the new loading states and speaker notes functionality. These changes aim to optimize the user experience in deck navigation and speaker notes management, providing a more intuitive and responsive interface. * feat(file-viewer): enhance version export functionality and speaker notes interaction - Introduced new export options for file versions, including PDF and image formats, improving the ability to download and share content. - Implemented a streamlined process for exporting version content, with progress indicators and error handling for a better user experience. - Enhanced speaker notes editing by refining event handling to prevent unintended focus shifts, ensuring a smoother editing experience. - Updated styles for improved visual consistency in the file version download interface. - Added tests to verify the functionality of version exports and speaker notes interactions. These changes aim to optimize the file viewer's usability and enhance the overall experience when managing and exporting project files. * fix(web): polish export menus and creator filters * fix(file-viewer): fall back to preview exports * test(file-viewer): cover version export fallbacks * test(file-viewer): assert loading skeleton by role * fix(file-viewer): restore html source mode affordance * fix(file-viewer): capture full version fallback snapshots * docs: trim slides handoff eof * test(exports): cover full preview snapshot requests * test(file-viewer): account for snapshot options arg * refactor(file-viewer, file-workspace): streamline export functions and enhance page creator dialog visibility * test(file-workspace): enhance slide template creation and mock plugin responses * feat(export): add support for versioned exports and enhance HTML export functionality * feat(export): implement versioned export support across multiple formats and enhance related tests * feat(file-viewer): enhance manual edit functionality with commit sequence tracking and add test for inline text session saving * style(speaker-notes): update filmstrip and thumb-frame styles for improved responsiveness and add corresponding tests * feat(file-viewer): enhance comment composer functionality with portal metrics and improve draw toolbar layout for mobile views * feat(analytics): track slide deck viewing experience Add analytics for the new deck/slides experience introduced in this PR: the deck viewer surface, in-deck slide navigation, thumbnail rail, and speaker-notes authoring. Presentation entry stays on the existing present_popover click to avoid double-counting. - contracts: DeckViewerSurfaceViewProps (surface_view), DeckViewerClickProps (ui_click), SpeakerNotesSaveResultProps (new speaker_notes_save_result event), wired into the event unions. - web: track* wrappers + fire helpers in FileViewer — deck_viewer surface_view on deck mount, slide_prev/next/reset, thumbnail_select, thumbnail_rail_toggle (expand/collapse), speaker_notes_edit, and speaker_notes_save_result (preview + presenter surfaces). - tests: deck analytics suite asserting the emitted (event, props) pairs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * feat(file-viewer, file-workspace): enhance export toast functionality and improve localization for page creation * feat(home-view, plugins-home-section, agent-skill): update default facet preference, enhance category selection handling, and improve localization support - Set `preferDefaultFacet` to true in HomeView component for better user experience. - Introduced `handlePickCategory` function in PluginsHomeSection to manage category selection based on card layout visibility. - Updated PRIMARY_CATEGORIES to reflect the new order and added localization for titles and descriptions in adaptAgentSkill. - Enhanced tests to verify the correct handling of display copy and tags from SKILL frontmatter. * feat(plugins-home, file-workspace): introduce commercial category labels and enhance deck handling - Added a new module for resolving and localizing commercial category labels for plugins. - Updated the FileWorkspace and PluginCard components to display the commercial category label on deck cards. - Enhanced the PageCreatorPresetFrame to adjust frame classes based on deck presets. - Refactored subcategory handling in facets to align with the new commercial category taxonomy. - Improved localization support for new category labels across multiple languages. * feat(deck-preview): implement deck preview scaling and enhance home hero layout - Introduced `useDeckPreviewScale` hook to manage scaling of deck previews within a fixed 1280×720 logical viewport, ensuring proportional rendering across various templates. - Updated `FileWorkspace`, `HomeHero`, and `PluginCard` components to utilize the new scaling functionality for improved visual consistency. - Enhanced the layout of the home hero section to accommodate new subtype chips and descriptions, including a "More" dropdown for overflow handling. - Improved localization support for new UI elements across multiple languages. * fix(PreviewModal): clarify sidebar prop documentation and update test description - Updated the documentation for the `PreviewSidebar` interface to specify that the sidebar's stage-edge handles are not shown when the sidebar prop is absent. - Modified the test suite description for `PreviewModal` to be more concise and relevant. * test(e2e): select prototype visual card --------- Co-authored-by: free666799 <293857035+free666799@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
213 lines
8.9 KiB
TypeScript
213 lines
8.9 KiB
TypeScript
import { expect, test } from '@/playwright/suite';
|
|
import { openNewProjectModal } from '@/playwright/rail';
|
|
import { T } from '@/timeouts';
|
|
import {
|
|
captureVisual,
|
|
captureVisualTarget,
|
|
configureVisualPage,
|
|
gotoVisualHome,
|
|
scrollVisualLocatorIntoStableView,
|
|
VISUAL_AMR_AGENT,
|
|
VISUAL_CLI_AGENTS,
|
|
waitForVisualFonts,
|
|
waitForVisualProjects,
|
|
} from '@/playwright/visual';
|
|
|
|
test('[P2] captures the onboarding cloud sign-in surface', async ({ page }) => {
|
|
test.setTimeout(T.xlong);
|
|
|
|
await configureVisualPage(page, {
|
|
projects: [],
|
|
agents: [VISUAL_AMR_AGENT, ...VISUAL_CLI_AGENTS],
|
|
config: {
|
|
onboardingCompleted: false,
|
|
},
|
|
});
|
|
|
|
await page.goto('/onboarding', { waitUntil: 'domcontentloaded' });
|
|
await page.getByText('Loading Open Design…').waitFor({ state: 'hidden', timeout: T.long });
|
|
// The connect step opens on the cloud sign-in landing. Local CLI and BYOK
|
|
// remain available as secondary paths from the same first screen.
|
|
await expect(
|
|
page.getByRole('heading', { name: /Sign in to Open Design|登录 Open Design/i }),
|
|
).toBeVisible({ timeout: T.medium });
|
|
await expect(
|
|
page.getByRole('button', { name: /Sign in to Open Design|登录 Open Design/i }),
|
|
).toBeVisible();
|
|
await expect(
|
|
page.getByRole('button', { name: /Local coding agent|本地 Coding Agent/i }),
|
|
).toBeVisible();
|
|
await expect(
|
|
page.getByRole('button', { name: /Bring your own key|自己的模型 Key/i }),
|
|
).toBeVisible();
|
|
await waitForVisualFonts(page);
|
|
|
|
await captureVisual(page, 'visual-onboarding-cloud');
|
|
});
|
|
|
|
test('[P2] captures the visual home harness', async ({ page }) => {
|
|
await configureVisualPage(page, { projects: [] });
|
|
await gotoVisualHome(page);
|
|
|
|
await expect(page.getByTestId('home-hero')).toBeVisible();
|
|
await expect(page.getByTestId('home-hero-input')).toBeVisible();
|
|
await waitForVisualProjects(page, []);
|
|
|
|
await captureVisual(page, 'visual-home');
|
|
});
|
|
|
|
test('[P2] captures the home plugin catalog surface', async ({ page }) => {
|
|
test.setTimeout(90_000);
|
|
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
// The redesigned entry shell keeps every view mounted (only the active one
|
|
// is visible) so tab switches don't reload thumbnails. That means
|
|
// `plugins-home-section` exists in both the home and plugins views, so
|
|
// scope the lookup to the home view to keep these strict-mode locators
|
|
// unambiguous.
|
|
const home = page.getByTestId('entry-view-home');
|
|
await expect(page.getByTestId('recent-projects-strip')).toBeVisible();
|
|
const community = home.getByTestId('plugins-home-section');
|
|
await expect(community).toBeVisible();
|
|
await scrollVisualLocatorIntoStableView(page, community);
|
|
await expect(home.locator('article.plugins-home__card--gallery').first()).toBeVisible();
|
|
await expect(home.getByTestId('plugins-home-search')).toBeVisible();
|
|
|
|
await captureVisual(page, 'visual-home-catalog');
|
|
});
|
|
|
|
test('[P2] captures the home plugin filtered surface', async ({ page }) => {
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
const home = page.getByTestId('entry-view-home');
|
|
await home.getByTestId('plugins-home-pill-category-deck').click();
|
|
await expect(home.locator('article.plugins-home__card[data-plugin-id="visual-deck-writer"]')).toBeVisible();
|
|
|
|
await captureVisual(page, 'visual-home-plugin-filter');
|
|
});
|
|
|
|
test('[P2] captures the home plugin detail surface', async ({ page }) => {
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
const home = page.getByTestId('entry-view-home');
|
|
await home.getByTestId('plugins-home-pill-category-deck').click();
|
|
const card = home.locator('article.plugins-home__card[data-plugin-id="visual-deck-writer"]');
|
|
await expect(card).toBeVisible();
|
|
await card.hover();
|
|
await home.getByTestId('plugins-home-details-visual-deck-writer').click({ force: true });
|
|
await expect(page.getByRole('dialog', { name: /Deck Writer preview/i })).toBeVisible();
|
|
await expect(page.getByTestId('plugin-details-use-visual-deck-writer')).toBeVisible();
|
|
await expect(page.locator('.ds-modal-stage-iframe-scaler iframe')).toBeVisible();
|
|
|
|
await captureVisual(page, 'visual-plugin-details');
|
|
});
|
|
|
|
test('[P2] captures the plugin detail share menu surface', async ({ page }) => {
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
const home = page.getByTestId('entry-view-home');
|
|
await home.getByTestId('plugins-home-pill-category-deck').click();
|
|
const card = home.locator('article.plugins-home__card[data-plugin-id="visual-deck-writer"]');
|
|
await expect(card).toBeVisible();
|
|
await card.hover();
|
|
await home.getByTestId('plugins-home-details-visual-deck-writer').click({ force: true });
|
|
await expect(page.getByRole('dialog', { name: /Deck Writer preview/i })).toBeVisible();
|
|
const trigger = page.locator('.template-share-trigger');
|
|
await trigger.click();
|
|
const popover = page.locator('.template-share-popover[role="menu"]');
|
|
await expect(popover).toBeVisible();
|
|
|
|
await captureVisual(page, 'visual-plugin-share-menu');
|
|
await captureVisualTarget(page, 'visual-plugin-share-menu-popover', [trigger, popover]);
|
|
});
|
|
|
|
test('[P2] captures the home context picker surface', async ({ page }) => {
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
await page.getByTestId('home-hero-input').fill('@visual');
|
|
const input = page.getByTestId('home-hero-input');
|
|
const picker = page.getByTestId('home-hero-plugin-picker');
|
|
await expect(picker).toBeVisible();
|
|
await expect(page.getByRole('option', { name: /Prototype Starter/i })).toBeVisible();
|
|
|
|
await captureVisual(page, 'visual-home-context-picker');
|
|
await captureVisualTarget(page, 'visual-home-context-picker-popover', [input, picker]);
|
|
});
|
|
|
|
test('[P2] captures the home staged attachment surface', async ({ page }) => {
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
await page.getByTestId('home-hero-file-input').setInputFiles({
|
|
name: 'visual-brief.txt',
|
|
mimeType: 'text/plain',
|
|
buffer: Buffer.from('Visual regression fixture for staged home attachments.\n', 'utf8'),
|
|
});
|
|
await expect(page.getByTestId('home-hero-staged-files')).toContainText('visual-brief.txt');
|
|
|
|
await captureVisual(page, 'visual-home-staged-attachment');
|
|
});
|
|
|
|
test('[P2] captures the home plugin use staged surface', async ({ page }) => {
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
const home = page.getByTestId('entry-view-home');
|
|
await home.getByTestId('plugins-home-pill-category-prototype').click();
|
|
const card = home.locator('article.plugins-home__card[data-plugin-id="visual-prototype-starter"]');
|
|
await expect(card).toBeVisible();
|
|
await home.getByTestId('plugins-home-details-visual-prototype-starter').click({ force: true });
|
|
await expect(page.getByRole('dialog', { name: /Prototype Starter details/i })).toBeVisible();
|
|
await page.getByTestId('plugin-details-use-visual-prototype-starter').click();
|
|
await expect(page.getByTestId('home-hero-active-plugin')).toContainText('Prototype Starter');
|
|
await expect(page.getByTestId('home-hero-input')).toBeVisible();
|
|
|
|
await captureVisual(page, 'visual-home-plugin-use-staged');
|
|
});
|
|
|
|
test('[P2] captures the home plugin use with query surface', async ({ page }) => {
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
const home = page.getByTestId('entry-view-home');
|
|
await home.getByTestId('plugins-home-pill-category-deck').click();
|
|
const card = home.locator('article.plugins-home__card[data-plugin-id="visual-deck-writer"]');
|
|
await expect(card).toBeVisible();
|
|
// Community gallery tiles carry no inline Use actions — use-with-query
|
|
// lives behind the detail modal's split Use button.
|
|
await home.getByTestId('plugins-home-details-visual-deck-writer').click({ force: true });
|
|
// Deck Writer ships a previewEntry, so its detail surface is the
|
|
// PreviewModal (aria-label "Deck Writer preview"), not the scenario
|
|
// detail's "... details" dialog. Match on the plugin name only.
|
|
await expect(page.getByRole('dialog', { name: /Deck Writer/i })).toBeVisible();
|
|
const trigger = page.getByTestId('plugin-details-use-visual-deck-writer-menu');
|
|
await trigger.click();
|
|
const menu = page.locator('.ds-modal-primary-action-popover[role="menu"]');
|
|
await expect(menu).toBeVisible();
|
|
await captureVisualTarget(page, 'visual-plugin-use-menu-popover', [trigger, menu]);
|
|
await page.getByTestId('plugin-details-use-with-query-visual-deck-writer').click();
|
|
// use-with-query now seeds the rendered preset text (placeholders filled in),
|
|
// not the raw `{{...}}` query — matching the example-prompt card path.
|
|
await expect(page.getByTestId('home-hero-input')).toContainText('Draft a topic deck.');
|
|
|
|
await captureVisual(page, 'visual-home-plugin-use-with-query');
|
|
});
|
|
|
|
test('[P2] captures the new project modal surface', async ({ page }) => {
|
|
test.setTimeout(T.xlong);
|
|
|
|
await configureVisualPage(page);
|
|
await gotoVisualHome(page);
|
|
|
|
await openNewProjectModal(page);
|
|
await expect(page.getByTestId('new-project-name')).toBeVisible();
|
|
|
|
await captureVisual(page, 'visual-new-project-modal');
|
|
});
|