UI Tweaker Project Skill
UI Tweaker provides granular control over the Obsidian interface, allowing elements to be Shown, Hidden, or Revealed-on-hover. It centralizes UI management logic extracted from legacy theme settings into a modular, production-ready plugin.
Core Architecture
- State Management: Uses
UIVisibilityState('show' | 'hide' | 'reveal') for complex elements andbooleanfor simple toggles. - CSS Injection:
uiManager.tsinjects classes ontodocument.body.- Hidden:
.ui-tweaker-{feature-name} - Reveal:
.ui-tweaker-{feature-name}-reveal
- Hidden:
- Mobile Support: Includes specific logic for nav positioning and mobile-specific hides.
- Status Bar Manager: Advanced detection of status bar items from other plugins using class-based identification and text fallback (matching
obsidian-statusbar-organizerpatterns).
Project-Specific Conventions
- Command IDs: Always use
ui-tweaker:toggle-{feature-name}. - Settings Hierarchy: Maintain a flat list with clear headers (
h2) insettingsTab.ts. - CSS Selectors: Primarily target element classes; maintain compatibility with both Desktop and Mobile DOM structures.
- Reveal UX: Use
opacitytransitions for smooth reveal-on-hover effects instyles.css.
Key Files
src/main.ts: Entry point and lifecycle orchestration.src/uiManager.ts: Core logic for managing CSS classes and visibility states.src/manager/StatusBarManager.ts: Complex status bar item identification logic.src/settings.ts: Settings interface and default value definitions.styles.css: All hiding/revealing CSS rules (heavily dependent on Obsidian DOM).
Maintenance Tasks
- DOM Sync: Test CSS selectors after major Obsidian updates; the DOM structure often changes in non-obvious ways.
- Command PICKER: Update
modals/CommandPickerModal.tsif Obsidian changes how commands are indexed. - Dependency Sync: Maintain alignment with
.ref/plugins/obsidian-oxygen-settingsandobsidian-hiderfor cross-compatible patterns.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.