Skip to content

feat(ui): add layout toggle button in Model Manager header#213

Merged
hayden-fr merged 1 commit intohayden-fr:mainfrom
Ainaemaet:feat/layout-toggle
Feb 26, 2026
Merged

feat(ui): add layout toggle button in Model Manager header#213
hayden-fr merged 1 commit intohayden-fr:mainfrom
Ainaemaet:feat/layout-toggle

Conversation

@Ainaemaet
Copy link
Contributor

@Ainaemaet Ainaemaet commented Sep 18, 2025

Adds a new header button inside the Model Manager dialog to quickly switch
between "flat" (card grid) and "folder explorer" layouts.

  • New toggleLayout function flips the config.flat flag, persists it to
    ComfyUI settings (ModelManager.UI.Flat), closes the current dialog, and
    reopens with the new layout.
  • Header button dynamically updates its icon:
    • Folder icon (pi pi-folder-open) in flat mode (suggests switch to folder view)
    • Grid icon (pi pi-th-large) in folder mode (suggests switch to flat view)
  • Tooltip changes accordingly:
    • "Switch to Folder View" when flat layout is active
    • "Switch to Flat View" when folder layout is active

This lets users change layouts directly in the UI without digging into the
global ComfyUI settings menu.

Follow-up notes on small fixes

  • First icon fix: corrected the layout toggle icon so it reflected the current state (flat = grid, folder = folder-open).

  • Second icon fix: flipped the logic so the toggle now shows the next view you’ll switch to, not the current one (resolves the backwards icon issue).

  • Hidden-files toggle: added a header button to show/hide dot-prefixed files/folders, persisted via ModelManager.Scan.IncludeHiddenFiles.

These are small, cosmetic/UX corrections stacked on top of the main layout/hidden-files feature work.

Added a couple extra fix commits - apparently I shouldn’t be vibe-coding UI icons on too little sleep - even if I'm not the one doing the heavy lifting. Everything’s correct now.

Fix: Ensure proper model refresh after toggling hidden files setting

The previous implementation didn't properly refresh the model list after toggling the visibility of hidden files. This fix adds a call to refreshModelsAndConfig() after toggling the setting, ensuring that the UI updates immediately to reflect the new state.

The dialog is also closed and reopened to ensure the changes are applied dynamically, providing a seamless experience for the user.

This change addresses the issue where toggling the "Show Hidden Files" feature wouldn't immediately reflect in the model list until a full page refresh.

Ok, I think I'm done for the night.

@hayden-fr
Copy link
Owner

I merged #211 and now this merge seems to have conflicts, so resolve it.

@Ainaemaet
Copy link
Contributor Author

I’m still pretty new to contributing on GitHub, so apologies if I made things messier along the way. Thanks for your patience while I cleaned this up.

I squashed this branch onto upstream/main, so the PR is now a single clean commit that touches only the UI files.

Changes included here:

Layout toggle button in the Model Manager header (icon now correctly reflects the current layout).

Hidden-files toggle (eye/eye-slash button with tooltip + immediate refresh).

Small cleanups to tooltip text, refresh handling, and formatting.

I noticed in the most recent upstream update the layout toggle icon logic was reversed (flat → folder-open). I left it as my original fix (flat → grid), since that matches the current layout more clearly for the user (grid icon when in flat view, folder icon when in folder view).

All checks are now passing ✅. This should be clean and ready to merge. Thanks again for your patience!

@hayden-fr hayden-fr merged commit 60837ae into hayden-fr:main Feb 26, 2026
2 checks passed
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.

2 participants