Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

fix: Move toggleDot files to fileModel and force re render on toggle#1324

Merged
lazysegtree merged 3 commits into
mainyorukot/superfile:mainfrom
filepanel-state-fixyorukot/superfile:filepanel-state-fixCopy head branch name to clipboard
Jan 26, 2026
Merged

fix: Move toggleDot files to fileModel and force re render on toggle#1324
lazysegtree merged 3 commits into
mainyorukot/superfile:mainfrom
filepanel-state-fixyorukot/superfile:filepanel-state-fixCopy head branch name to clipboard

Conversation

@lazysegtree

@lazysegtree lazysegtree commented Jan 26, 2026

Copy link
Copy Markdown
Collaborator

and enforce a max render delay

Fixes - #981

Summary by CodeRabbit

  • Refactor
    • Improved internal architecture of file panel management for better code organization and maintainability.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Jan 26, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

This PR refactors the file model initialization and dot-file toggle handling. It moves the toggleDotFile state from the main model to fileModel, introduces a constructor for fileModel with a public DisplayDotFiles field, adds ToggleDotFile() and UpdateFilePanelsIfNeeded() methods to encapsulate panel update logic, and simplifies the UpdateElementsIfNeeded() signature.

Changes

Cohort / File(s) Summary
Constants and model state management
src/internal/common/ui_consts.go, src/internal/type.go, src/internal/ui/filemodel/type.go
Removed ReRenderChunkDivisor from public UI constants; removed toggleDotFile and updatedToggleDotFile fields from main model struct; added DisplayDotFiles field to fileModel
FileModel initialization and update encapsulation
src/internal/default_config.go, src/internal/ui/filemodel/utils.go, src/internal/ui/filemodel/update.go
Introduced New() constructor for fileModel initialization replacing manual struct construction; added ToggleDotFile() and UpdateFilePanelsIfNeeded() methods to encapsulate panel update logic
Main model refactoring
src/internal/handle_panel_movement.go, src/internal/model.go
Replaced direct toggle state manipulation with calls to fileModel.ToggleDotFile(); removed getFilePanelItems() helper function; delegated to UpdateFilePanelsIfNeeded()
FilePanel update and render throttling
src/internal/ui/filepanel/consts.go, src/internal/ui/filepanel/get_elements.go, src/internal/ui/filepanel/render.go
Moved re-render constants to filepanel module; simplified UpdateElementsIfNeeded() signature to accept force and displayDotFile flags; updated shouldSkipPanelUpdate() throttling mechanism; updated documentation comment in render logic

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

awaiting pr review

Suggested reviewers

  • yorukot

Poem

🐰 Hopping through the code with joy,
States refactored, cleaner toy,
DotFiles toggle in fileModel's care,
Updates flow with structured flair,
Constants moved to where they belong—
This refactor makes the code more strong! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: moving toggleDot files to fileModel and forcing re-render on toggle, which are the primary objectives reflected throughout the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jan 26, 2026

Copy link
Copy Markdown

Deploying superfile with  Cloudflare Pages  Cloudflare Pages

Latest commit: 20c48c5
Status: ✅  Deploy successful!
Preview URL: https://a3ac2084.superfile.pages.dev
Branch Preview URL: https://filepanel-state-fix.superfile.pages.dev

View logs

HeightBreakC = 40
HeightBreakD = 45

ReRenderChunkDivisor = 100 // divisor for re-render throttling

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to filepanel package

@lazysegtree
lazysegtree requested a review from yorukot January 26, 2026 16:05
@lazysegtree
lazysegtree merged commit fa3a42c into main Jan 26, 2026
14 checks passed
@lazysegtree
lazysegtree deleted the filepanel-state-fix branch January 26, 2026 16:37
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.