fix(ui): scope file viewer CSS so CSV/MD renderers don't affect app l…#1275
Open
dataCenter430 wants to merge 1 commit intoeigent-ai:mainfrom
Open
fix(ui): scope file viewer CSS so CSV/MD renderers don't affect app l…#1275dataCenter430 wants to merge 1 commit intoeigent-ai:mainfrom
dataCenter430 wants to merge 1 commit intoeigent-ai:mainfrom
Conversation
Author
|
@Wendong-Fan could you plesae review the PR? thx |
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.
Closes #1264
Related Issue
Switching between file types (e.g. in_progress_tickets.csv and shared_files.md) caused visible typography and layout shifts in the whole interface (sidebar, file list, outer containers). File renderer CSS was affecting the rest of the app.
Root cause
CSV/HTML content: injectFontStyles() injected a <style> with a global * { font-family: ... } selector. That style was rendered in the main document by FolderComponent, so it applied to the entire app. When switching to markdown (different render path), the style disappeared and the UI “snapped” back.
Markdown: github-markdown-css set color-scheme (and variables) on [data-theme="dark"] / [data-theme="light"], which is on the app root, so it influenced the whole app.
Description
htmlFontStyles.ts: For HTML fragments (e.g. CSV), use a scoped selector (.eigent-file-content *) and wrap content in
markdown-styles.css: Override so color-scheme is not set on the theme root; only [data-theme] .markdown-body gets color-scheme.
Folder viewer: Add .file-viewer-content wrapper and, in index.css, use contain: layout style and isolation: isolate so file content styles don’t affect the surrounding app.
Result
File viewer styling is confined to the content area; switching between CSV and markdown (and other file types) no longer changes sidebar or outer layout/typography.
15.02.2026_17.08.21_REC.mp4
What is the purpose of this pull request?
Contribution Guidelines Acknowledgement