-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Feat: Hardcoded 20px Font and Scroll Zoom Fix for High-DPI Displays #7098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Conversation
…anhq#7027) * fix: preserve dollar sign followed by numbers in markdown rendering Previously, the regex replacement for escaping $<number> patterns was incorrectly using $1 in the replacement string, which was interpreted as a backreference. This caused values like "$200" to be rendered as "$1" in the UI. Changed to use a replacement function that explicitly concatenates the escaped dollar sign with the captured number group. * chore: update RenderMarkdown unit tests
fix: reattach the same file after deletion fix
…anhq#7031) * feat: add embedding flag to model metadata and automatic detection Add an `embedding` boolean field to both `modelInfo` and `ModelConfig`. Implement `resolveEmbeddingConfig` to read GGUF metadata for BERT‑based architectures, determine if a model is an embedding model, and persist the result back to `model.yml`. Update model loading, listing, and validation logic to expose and use the new flag. This change reduces repeated GGUF reads, speeds up model discovery, and allows the system to distinguish embedding‑capable models for downstream use. * fix: filter out embeddings model from model list --------- Co-authored-by: Louis <louis@jan.ai>
fix: Fix extension installation link
fix: spawn new process with window close flag
feat: update link to chrome store for Jan extension
…jects fix: disable context menu list projects
fix: ui check be version
feat: update flatpak build
fix: flatpak upload s3
Close window but let app clean up in background
…load fix: cancel failed download task
fix: fix linter with missing parameters
feat: close app in background
fix: killing process with name checking logic
feat: Dialog to install Jan extension
feat: Cancellation mechanism during mcp connectivity check
* embedding works for large files * attachment as inline * update tan stack router * attachment works with proper selection * fix test * wait for model to start before doing things * Token Count now counts inline * Revert "embedding works for large files" This reverts commit 8518486. * refactor: add batch processing to embedTexts Implemented batch‑based embedding for both rag-extension and vector-db-extension. - Introduced a `batchSize` parameter with a sensible default. - Processed texts in chunks to avoid large single calls to the LlamaCPP embed API. - Mapped batch results to global indices and added per‑batch error handling. - Logged failures and re‑thrown errors with contextual information. This change improves memory usage, resilience to API timeouts, and overall scalability of the embedding pipeline. * Update web-app/src/locales/fr/common.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update web-app/src/locales/ru/common.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update web-app/src/locales/pt-BR/common.json Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix lint * attachment works properly now * update padding --------- Co-authored-by: Akarshan <akarshan@menlo.ai> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Handle attachment parsing error (exit gracefully) * Revert "Handle attachment parsing error (exit gracefully)" This reverts commit 56a356f. * Handle attachment parsing error (exit gracefully)
There was a problem hiding this comment.
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 implements a comprehensive overhaul of font scaling, attachment handling, and MCP server management. The changes introduce a 20px base font size via CSS override, add inline document injection capabilities with automatic size-based routing, improve MCP server lifecycle management with proper shutdown contexts, and enhance the Jan Browser extension integration with connection status checking.
Key Changes:
- Replaced entire CSS styling system with a 20px font override
- Added document parsing modes (auto/inline/embeddings/prompt) with context-aware routing
- Refactored MCP server shutdown logic with context-specific timeouts and concurrent operation guards
- Implemented Jan Browser extension connection detection via ping/snapshot tools
- Enhanced embedding batching for better performance with large text inputs
Reviewed changes
Copilot reviewed 109 out of 110 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| web-app/src/index.css | Complete CSS replacement with 20px font override |
| web-app/src/types/attachment.ts | Added parseMode, injectionMode, and inlineContent fields |
| web-app/src/lib/attachmentProcessing.ts | New centralized attachment processing with auto/prompt modes |
| web-app/src/hooks/useAttachments.ts | Added parseMode, autoInlineContextRatio settings and initialization retry logic |
| web-app/src/hooks/useChat.ts | Refactored to use centralized attachment processing with per-file choice handling |
| web-app/src/containers/ChatInput.tsx | Integrated Jan Browser extension toggle and attachment state management |
| src-tauri/src/core/mcp/helpers.rs | Added ShutdownContext enum and refactored cleanup with timeout controls |
| src-tauri/src/core/mcp/commands.rs | Implemented check_jan_browser_extension_connected command |
| extensions/llamacpp-extension/src/index.ts | Added embedding model detection and batched embedding requests |
| extensions/rag-extension/src/index.ts | Added parseDocument method and parseMode configuration |
Comments suppressed due to low confidence (7)
web-app/src/index.css:1
- The entire CSS architecture has been replaced with a single-line override setting all elements to 20px font size. This removes all existing theme variables, custom properties, and design system tokens that were carefully structured in the original file. This approach will break responsive design, accessibility features (users who need custom font sizes), and makes the application unmaintainable. Consider using CSS custom properties to scale the base font size while preserving the existing design system.
web-app/src/services/providers/tauri.ts:1 - The nullish coalescing operator
?? []is applied after the.filter()call, which means if.list()returns null/undefined and.then()isn't called, the filter will throw. The fallback should wrap the entire chain or handle the promise rejection properly.
web-app/src/hooks/useThreadScrolling.tsx:1 - Adding
scrollContainerRefto the dependency array ofuseEffectis incorrect. Refs are stable objects and should not be dependencies. This will cause the effect to re-run unnecessarily when the ref object identity changes, potentially leading to duplicate event listeners.
web-app/src/hooks/useThreadScrolling.tsx:1 - Same issue as above -
scrollContainerRefshould not be in the dependency array. Refs don't change identity in a way that should trigger effects.
web-app/src/hooks/useThreadScrolling.tsx:1 - Same issue -
scrollContainerRefshould not be in the dependency array.
web-app/src/containers/RenderMarkdown.tsx:1 - [nitpick] The change from template string replacement to function concatenation is unnecessary and less readable. The original
'\\$$1'was clearer and more idiomatic for regex replacements.
web-app/src/containers/DownloadButton.tsx:1 - The useEffect now depends on
modelIdbut the original implementation had an empty dependency array, meaning it should only run once on mount. IfmodelIdcan change during the component's lifetime, this could lead to duplicate event listeners being registered without cleanup.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if let Some(existing_token) = download_manager.cancel_tokens.remove(task_id) { | ||
| log::info!("Cancelling existing download task: {task_id}"); | ||
| existing_token.cancel(); |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing and cancelling an existing download task without waiting for the cancellation to complete could lead to race conditions. The new download might start before the previous one fully cleans up its resources. Consider awaiting the cancellation or ensuring proper cleanup.
| #[cfg(windows)] | ||
| use std::os::windows::process::CommandExt; | ||
|
|
||
| let mut cmd = Command::new("tasklist"); | ||
| cmd.args(&["/FI", &format!("PID eq {}", pid), "/NH"]); | ||
|
|
||
| #[cfg(windows)] | ||
| cmd.creation_flags(0x08000000); // CREATE_NO_WINDOW |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The #[cfg(windows)] attribute is used twice - once for the import and once for the method call. While this works, it's cleaner to wrap the entire Windows-specific block in a single #[cfg(windows)] to improve readability.
Describe Your Changes
This adjustment sets the base font size to 20px and enables Ctrl+Scroll zoom for improved accessibility on high-DPI monitors.
Fixes Issues
Self Checklist