Merge pull request 'feat(title): 预设卡片预览联动用户选择的字体' (#1238) from fix/preset-font-preview into develop
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 1m5s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 1m7s
CI/CD Pipeline / Frontend Unit Tests (push) Failing after 2m19s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 3m5s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 5m18s
CI/CD Pipeline / Integration Tests (push) Successful in 1m34s
CI/CD Pipeline / Build Staging API Image (push) Successful in 7m30s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 7m29s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 51s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 40s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 46s
CI/CD Pipeline / Unit Tests (push) Successful in 9m56s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m3s
CI/CD Pipeline / Canary Release to Production (push) Failing after 1029h12m22s
CI/CD Pipeline / Deploy Production (push) Failing after 1029h13m52s
CI/CD Pipeline / CI Gate (push) Failing after 1029h13m52s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1029h13m53s
CI/CD Pipeline / Build Production API Image (push) Failing after 1029h13m54s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 1029h23m17s
CI/CD Pipeline / PR Build API Image (push) Failing after 1029h23m20s
CI/CD Pipeline / Frontend Lint (push) Failing after 1029h23m22s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1029h23m54s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1029h47m9s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1029h47m10s
CI/CD Pipeline / PR Build Web Image (push) Failing after 1029h56m34s

This commit was merged in pull request #1238.
This commit is contained in:
2026-08-04 18:03:26 +08:00
3 changed files with 18 additions and 4 deletions
@@ -13,9 +13,15 @@ interface TitlePresetsGridProps {
presets: TitlePresetItem[]
activePreset: string | null
onApply: (presetKey: string) => void
fontFamily?: string
}
const TitlePresetsGrid: React.FC<TitlePresetsGridProps> = ({ presets, activePreset, onApply }) => {
const TitlePresetsGrid: React.FC<TitlePresetsGridProps> = ({
presets,
activePreset,
onApply,
fontFamily,
}) => {
return (
<div className="xx-title-presets-grid">
{presets.map((p) => {
@@ -27,7 +33,10 @@ const TitlePresetsGrid: React.FC<TitlePresetsGridProps> = ({ presets, activePres
onClick={() => onApply(p.key)}
title={p.label}
>
<span className="xx-title-preset-preview-text" style={p.previewStyle}>
<span
className="xx-title-preset-preview-text"
style={{ ...p.previewStyle, ...(fontFamily ? { fontFamily } : {}) }}
>
标题
</span>
<span className="xx-title-preset-card-label">{p.label}</span>
@@ -107,6 +107,7 @@ const TitleStylePanel: React.FC<TitleStylePanelProps> = ({
presets={titlePresets}
activePreset={activePreset}
onApply={onApplyPreset}
fontFamily={settings.font}
/>
</div>
@@ -1,5 +1,5 @@
import { describe, expect, it, vi } from "vitest"
import { render } from "@testing-library/react"
import { afterEach, describe, expect, it, vi } from "vitest"
import { render, cleanup } from "@testing-library/react"
import TtsPanel from "@/pages/editing-planner/components/TtsPanel"
import { DEFAULT_TTS_CONFIG } from "@/pages/editing-planner/types"
@@ -16,6 +16,10 @@ const defaultProps = {
}
describe("TtsPanel", () => {
afterEach(() => {
cleanup()
})
it("should render without crashing", () => {
const { container } = render(<TtsPanel {...defaultProps} />)
expect(container).toBeTruthy()