Skip to content

feat: add icon support for Bases views#228

Open
themanuem wants to merge 1 commit intogfxholo:mainfrom
themanuem:feat/bases-view-icons
Open

feat: add icon support for Bases views#228
themanuem wants to merge 1 commit intogfxholo:mainfrom
themanuem:feat/bases-view-icons

Conversation

@themanuem
Copy link
Copy Markdown

Summary

Adds a new BaseIconManager that injects iconic icons into Obsidian's Bases views:

  • File name cells (file.name column) display the same icons as the file explorer, including rule-based icons
  • Tag pills (tags column) display their configured icons and colors
  • Uses a debounced MutationObserver with a re-entrancy guard to prevent infinite loops from DOM mutations triggered by icon injection
  • Integrates with refreshManagers() so icon/color changes propagate to Bases views immediately

Files changed

File Change
src/managers/BaseIconManager.ts New manager targeting .bases-td cells in Bases views
src/IconicPlugin.ts Import, instantiate, register in refreshManagers() and onunload()
styles.css Icon sizing and hover styles for .bases-td .internal-link > .iconic-icon

Test plan

  • Open a Base with a file.name column — file icons should appear (both direct and rule-based)
  • Open a Base with a tags column — tag icons and colors should render on pills
  • Change a tag icon/color in settings — Bases view updates immediately
  • Change a file icon — Bases view updates immediately
  • Switch between Base views/filters — icons persist after re-render
  • No performance degradation or UI freezing when scrolling large Bases
  • Plugin unload/reload cleans up injected icons properly

Closes #223

🤖 Generated with Claude Code

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]>
@gfxholo
Copy link
Copy Markdown
Owner

gfxholo commented Apr 1, 2026

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.

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.

Icons in filenames within Base views

2 participants