Dev#3
Open
youngestar wants to merge 9 commits into
Open
Conversation
There was a problem hiding this comment.
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
VirtuosoLitecomponent in@youngro/uiand wireapps/webchat UI to a virtualized list (viareact-virtuoso+ a scrolling hook). - Improve markdown rendering behavior (caching + streaming-friendly updates) and refactor
/api/chatstreaming/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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.