Skip to content

Dev#3

Open
youngestar wants to merge 9 commits into
mainfrom
dev
Open

Dev#3
youngestar wants to merge 9 commits into
mainfrom
dev

Conversation

@youngestar

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 8, 2026 13:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the repo’s developer tooling/formatting baseline and introduces new chat UX plumbing (virtualized chat list + improved markdown rendering), while also tightening /api/chat provider selection and error/abort behavior.

Changes:

  • Add repo-wide Prettier config + Husky/commitlint/commitizen + lint-staged integration, and apply broad formatting normalization across packages/apps.
  • Introduce a new VirtuosoLite component in @youngro/ui and wire apps/web chat UI to a virtualized list (via react-virtuoso + a scrolling hook).
  • Improve markdown rendering behavior (caching + streaming-friendly updates) and refactor /api/chat streaming/non-streaming handling to be adapter-based with better abort propagation.

Reviewed changes

Copilot reviewed 122 out of 130 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/utils/package.json JSON normalization (no functional change).
packages/ui/src/internal/virtualizer-core/scroll-task.ts New scroll-task helper module for virtualizer internals.
packages/ui/src/components/VirtuosoLite/VirtualItem.tsx New measured item wrapper (ResizeObserver-based).
packages/ui/src/components/VirtuosoLite/types.ts Public VirtuosoLite types/handle contracts.
packages/ui/src/components/VirtuosoLite/rangeCalculator.ts Range + overscan + binary search helpers for virtualization.
packages/ui/src/components/VirtuosoLite/index.ts Exports VirtuosoLite and its public types.
packages/ui/src/components/Textarea/Textarea.tsx Formatting-only refactor.
packages/ui/src/components/Select/Select.tsx Formatting-only refactor.
packages/ui/src/components/Select/index.ts Formatting-only refactor.
packages/ui/src/components/Select/HeadlessSelect.tsx Formatting-only refactor.
packages/ui/src/components/ScrollArea/ScrollArea.tsx Formatting-only refactor.
packages/ui/src/components/RadioCard/RadioCard.tsx Formatting-only refactor.
packages/ui/src/components/Radio/Radio.tsx Formatting-only refactor.
packages/ui/src/components/PageHeader/PageHeader.tsx Formatting-only refactor.
packages/ui/src/components/Menu/IconItem.tsx Add linkComponent to support Next.js Link without hard dependency.
packages/ui/src/components/Input/Input.tsx Formatting-only refactor.
packages/ui/src/components/index.ts Export VirtuosoLite + consolidate exports formatting.
packages/ui/src/components/IconStatusItem/IconStatusItem.tsx Add linkComponent to support Next.js Link without hard dependency.
packages/ui/src/components/HeaderLink/HeaderLink.tsx Add linkComponent to support Next.js Link without hard dependency.
packages/ui/src/components/Field/Field.tsx Formatting-only refactor.
packages/ui/src/components/Checkbox/Checkbox.tsx Formatting-only refactor.
packages/ui/src/components/Card/index.ts Formatting-only refactor.
packages/ui/src/components/Card/Card.tsx Formatting-only refactor.
packages/ui/src/components/Button/Button.tsx Formatting-only refactor.
packages/ui/src/components/BrandLogo/BrandLogo.tsx Formatting-only refactor.
packages/ui/package.json JSON normalization (no functional change).
packages/typescript-config/package.json JSON normalization (no functional change).
packages/llm-tokens/src/index.ts Formatting-only refactor.
packages/llm-tokens/src/index.test.ts Formatting-only refactor.
packages/llm-tokens/package.json JSON normalization (no functional change).
packages/icons/src/generated/TencentcloudIcon.tsx Formatting-only refactor of generated icon.
packages/icons/src/generated/MoonshotIcon.tsx Formatting-only refactor of generated icon.
packages/icons/src/generated/index.tsx Consolidate named exports formatting.
packages/icons/src/generated/DeepseekIcon.tsx Formatting-only refactor of generated icon.
packages/icons/src/build-icons.mjs Formatting-only refactor; no logic change intended.
packages/icons/package.json JSON normalization (no functional change).
packages/feature-chat/src/stream/ndjsonParser.ts Formatting-only refactor.
packages/feature-chat/src/stores/useChatStore.ts Formatting-only refactor.
packages/feature-chat/src/components/ChatDemo.tsx Formatting-only refactor.
packages/feature-card/src/store/index.tsx Prevent persisting state before initial load completes; formatting cleanups.
packages/feature-card/src/index.tsx Formatting-only refactor.
packages/eslint-config/package.json JSON normalization (no functional change).
packages/design-tokens/tailwind.config.cjs Minor formatting simplifications.
packages/design-tokens/styles/chromatic.css Formatting-only refactor.
packages/design-tokens/src/styles/chromatic.css Formatting-only refactor.
packages/design-tokens/src/index.ts Formatting-only refactor.
package.json Add commit tooling + Husky hooks; change Prettier scripts to run on repo root.
eslint.config.mjs Add flat ESLint config entrypoint with common ignores.
commitlint.config.mjs Add commitlint config + cz-git prompt configuration.
apps/web/tsconfig.json Formatting-only refactor.
apps/web/tailwind.config.cjs Formatting-only refactor.
apps/web/src/store/speechStore.ts Formatting-only refactor.
apps/web/src/store/providersStore.ts Formatting-only refactor.
apps/web/src/lib/tts/chunker.ts Formatting-only refactor.
apps/web/src/lib/providers/adapters/openaiCompatible.ts Improve streaming reader teardown + avoid duplicate finish; formatting cleanups.
apps/web/src/lib/providers/adapter.ts Formatting-only refactor.
apps/web/src/lib/markdownProcessor.ts Cache fallback processor promise to avoid repeated instantiation.
apps/web/src/lib/chat/api.ts Formatting-only refactor.
apps/web/src/lib/api/index.ts Formatting-only refactor.
apps/web/src/hooks/useVirtualChatScroll.ts New hook to manage Virtuoso scroll-to-bottom + “back to bottom” visibility.
apps/web/src/hooks/useTurnToPage.ts Formatting-only refactor.
apps/web/src/hooks/useStreamingSpeechPlayback.ts Formatting-only refactor.
apps/web/src/hooks/useSpeechResources.ts Formatting-only refactor.
apps/web/src/hooks/useSpeechPlayback.ts Formatting-only refactor.
apps/web/src/hooks/useScrollToHash.ts Formatting-only refactor.
apps/web/src/hooks/useModulesList.ts Formatting-only refactor.
apps/web/src/data/tencentVoices.json Formatting-only refactor.
apps/web/src/data/settings/providers.ts Formatting-only refactor.
apps/web/src/components/Widgets/AnimatedWave.tsx Formatting-only refactor.
apps/web/src/components/ProviderPageHeader.tsx Change “back” behavior to replace when using explicit href; formatting.
apps/web/src/components/MarkdownRenderer.tsx Add HTML caching + streaming-friendly rendering cadence + fallback modes.
apps/web/src/components/Backgrounds/cross-background.css Formatting-only refactor.
apps/web/scripts/test-api-chat.js Formatting-only refactor.
apps/web/package.json Add react-virtuoso; dependency ordering/formatting.
apps/web/next.config.mjs Formatting-only refactor.
apps/web/app/settings/youngro-card/page.tsx Adjust back navigation; formatting cleanups.
apps/web/app/settings/youngro-card/components/Toolbar.tsx Formatting-only refactor.
apps/web/app/settings/youngro-card/components/IconButton.tsx Formatting-only refactor.
apps/web/app/settings/youngro-card/components/FileInput.tsx Formatting-only refactor.
apps/web/app/settings/youngro-card/components/CreateCardTile.tsx Formatting-only refactor.
apps/web/app/settings/youngro-card/components/CardListItem.tsx Formatting-only refactor.
apps/web/app/settings/youngro-card/components/CardDetailDialog.tsx Formatting-only refactor.
apps/web/app/settings/youngro-card/components/CardCreationDialog.tsx Formatting-only refactor.
apps/web/app/settings/providers/page.tsx Use Next Link via linkComponent; back navigation uses replace.
apps/web/app/settings/providers/components/ClientProviderDetail.tsx Use ProviderPageHeader backHref; formatting cleanups.
apps/web/app/settings/providers/[category]/[id]/page.tsx Formatting-only refactor.
apps/web/app/settings/page.tsx Use Next Link via linkComponent; back navigation uses replace.
apps/web/app/settings/modules/speech/page.tsx Back navigation uses replace.
apps/web/app/settings/modules/speech/ClientSpeechPage.tsx Formatting-only refactor.
apps/web/app/settings/modules/page.tsx Use Next Link via linkComponent; back navigation uses replace.
apps/web/app/settings/modules/consciousness/page.tsx Back navigation uses replace.
apps/web/app/settings/modules/consciousness/ClientConsciousnessPage.tsx Formatting-only refactor.
apps/web/app/settings/layout.tsx Header uses HeaderLink + Next Link via linkComponent.
apps/web/app/settings/components/FloatingSettings.tsx Formatting-only refactor.
apps/web/app/layout.tsx Formatting-only refactor.
apps/web/app/components-demo/page.tsx Add VirtuosoLite demo component import; formatting cleanups.
apps/web/app/components-demo/_components/VirtuosoLiteChatDemo.module.css New CSS for demo scrollbars/scroller.
apps/web/app/api/speech/providers/shared.ts Formatting-only refactor.
apps/web/app/api/speech/providers/[providerId]/voices/route.ts Formatting-only refactor.
apps/web/app/api/speech/providers/[providerId]/validate/route.ts Formatting-only refactor.
apps/web/app/api/speech/providers/[providerId]/synthesize/route.ts Formatting-only refactor.
apps/web/app/api/speech/providers/[providerId]/models/route.ts Formatting-only refactor.
apps/web/app/api/chat/route.ts Major refactor: explicit provider resolution, config shape validation, abort propagation, NDJSON event normalization, non-stream mode support.
apps/web/app/ai-chat/page.tsx Formatting-only refactor.
apps/web/app/ai-chat/layout.tsx Formatting-only refactor.
apps/web/app/ai-chat/_components/VirtualChatList.tsx New Virtuoso-based virtualized chat list component.
apps/web/app/ai-chat/_components/InteractiveArea.tsx Replace ScrollArea-based history wrapper with full-height flex layout (virtual list is handled inside ChatHistory).
apps/web/app/ai-chat/_components/InteractiveArea.module.css Add .chatScroller styles for Virtuoso scroller.
apps/web/app/ai-chat/_components/ChatToolbar.tsx Formatting-only refactor.
apps/web/app/ai-chat/_components/ChatHistory.tsx Switch to virtualized rendering via VirtualChatList; optimize store selection.
apps/web/app/ai-chat/_components/AIChatMessage.tsx Add memoization + pass markdown cache/streaming hints into MarkdownRenderer.
apps/web/tests/simpleModal.outsideClick.spec.tsx Formatting-only refactor.
apps/docs/tsconfig.json Formatting-only refactor.
apps/docs/app/page.tsx Formatting-only refactor.
apps/docs/app/page.module.css Formatting-only refactor.
apps/docs/app/layout.tsx Formatting-only refactor.
.prettierrc.json New Prettier configuration.
.prettierignore New Prettier ignore list.
.opencode/skill/youngro-architecture/SKILL.md New architecture/dependency guidance doc.
.lintstagedrc.json New lint-staged config for pre-commit automation.
.husky/pre-commit New Husky pre-commit hook running lint-staged.
.husky/commit-msg New Husky commit-msg hook running commitlint.
.github/workflows/ci.yml Minor whitespace cleanup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/ui/src/internal/virtualizer-core/scroll-task.ts Outdated
Comment thread packages/ui/src/components/VirtuosoLite/VirtuosoLite.tsx
Comment thread apps/web/src/components/MarkdownRenderer.tsx Outdated
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.

2 participants