feat: add icon support for Bases views#228
Open
themanuem wants to merge 1 commit intogfxholo:mainfrom
Open
Conversation
Add BaseIconManager to inject file icons and tag icons/colors into Obsidian's Bases views (tables, cards, lists). File name cells show the same icons as the file explorer (including rule-based icons), and tag pills display their configured icons and colors. Uses debounced MutationObserver with re-entrancy guard to prevent infinite loops from DOM mutations triggered by icon injection. Closes gfxholo#223 Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Owner
|
Hi! This PR won't be merged into the repository, since I'm keeping it clear of AI-generated code (something I should probably mention in a pull request template). Your code does match the repository style extremely well though, so I might use it as a rough reference when I'm adding this feature. 💖 I'll leave this PR open for now so people can personally try out your fork. |
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.
Summary
Adds a new
BaseIconManagerthat injects iconic icons into Obsidian's Bases views:file.namecolumn) display the same icons as the file explorer, including rule-based iconstagscolumn) display their configured icons and colorsMutationObserverwith a re-entrancy guard to prevent infinite loops from DOM mutations triggered by icon injectionrefreshManagers()so icon/color changes propagate to Bases views immediatelyFiles changed
src/managers/BaseIconManager.ts.bases-tdcells in Bases viewssrc/IconicPlugin.tsrefreshManagers()andonunload()styles.css.bases-td .internal-link > .iconic-iconTest plan
file.namecolumn — file icons should appear (both direct and rule-based)tagscolumn — tag icons and colors should render on pillsCloses #223
🤖 Generated with Claude Code