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

feat: show count selected items in select mode#1187

Merged
yorukot merged 1 commit into
yorukot:mainyorukot/superfile:mainfrom
xelavopelk:select_countxelavopelk/superfile:select_countCopy head branch name to clipboard
Dec 12, 2025
Merged

feat: show count selected items in select mode#1187
yorukot merged 1 commit into
yorukot:mainyorukot/superfile:mainfrom
xelavopelk:select_countxelavopelk/superfile:select_countCopy head branch name to clipboard

Conversation

@xelavopelk

@xelavopelk xelavopelk commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

New Features
When switching to Select mode there should be an indicator for how many files has been selected. issue #1164

  • when selected something
image - when nothing selected image - browser mode is not changed image

Summary by CodeRabbit

  • New Features
    • Select mode in the file panel now displays a count of selected items in the footer label, showing "(N)" where N represents the total number of currently selected items.

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

@coderabbitai

coderabbitai Bot commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The filePanel rendering pipeline is enhanced to display the count of selected items. The renderFooter method now accepts a selectedCount parameter and passes it to getPanelModeInfo, which augments the Select mode label with a "(N)" suffix indicating the number of selected items.

Changes

Cohort / File(s) Summary
File panel footer enhancement
src/internal/model_render.go
Modified renderFooter to accept selectedCount parameter; updated Select mode label to include item count suffix; enhanced Render flow to supply count during footer rendering

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Single file modified with focused, minimal logic changes
  • Straightforward parameter passing through rendering pipeline
  • Clear intent and limited scope of impact

Possibly related PRs

Suggested reviewers

  • yorukot

Poem

🐰 A count appears, so neat and fine,
In Select mode's label line,
"(N)" whispers soft and clear,
How many treasures gathered here! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: show count selected items in select mode' directly matches the PR's main objective of displaying a count of selected items in select mode, as evidenced by the file changes that add selectedCount to the footer rendering.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/internal/model_render.go (1)

86-87: Consider addressing the unit test TODO.

Since renderFooter is being modified to support the new selected count feature, this could be a good opportunity to add unit tests for the function, especially to verify the count display in different scenarios (0 items, 1 item, multiple items).

Do you want me to generate unit test code for this function, or would you prefer to open an issue to track this task?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f83e2da and 6d3640a.

📒 Files selected for processing (1)
  • src/internal/model_render.go (3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: lazysegtree
Repo: yorukot/superfile PR: 0
File: :0-0
Timestamp: 2025-04-12T12:00:32.688Z
Learning: In PR #767 for yorukot/superfile, the focus is on moving code (especially sidebar-related functionality) to a more organized structure without changing functionality. Pre-existing issues should be ignored since the purpose is code reorganization, not fixing existing problems.
📚 Learning: 2025-04-12T13:51:24.691Z
Learnt from: lazysegtree
Repo: yorukot/superfile PR: 770
File: src/internal/ui/sidebar/render.go:0-0
Timestamp: 2025-04-12T13:51:24.691Z
Learning: In the sidebar component of yorukot/superfile, the partial list rendering in render.go is intentional. The sidebar implements scrolling functionality where ListUp/ListDown methods in navigation.go update cursor position and renderIndex to show the appropriate portion of the directory list based on available space.

Applied to files:

  • src/internal/model_render.go
📚 Learning: 2025-08-27T11:32:17.326Z
Learnt from: lazysegtree
Repo: yorukot/superfile PR: 1021
File: .gitignore:37-37
Timestamp: 2025-08-27T11:32:17.326Z
Learning: In PR #1021 for yorukot/superfile, the preview panel refactoring created duplicate ImagePreviewer instances (one in defaultModelConfig and another in preview.New()), which caused image preview crashes. The refactoring also renamed SetContextWithRenderText to SetContentWithRenderText, and moved global batCmd to per-instance batCmd initialization, all contributing to crashes during image preview and test failures.

Applied to files:

  • src/internal/model_render.go
🧬 Code graph analysis (1)
src/internal/model_render.go (1)
src/config/icon/icon.go (3)
  • Browser (32-32)
  • Space (10-10)
  • Select (33-33)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build and Test (windows-latest)
🔇 Additional comments (2)
src/internal/model_render.go (2)

69-69: LGTM! Clean implementation of the selected count feature.

The changes correctly thread the selected item count through the rendering pipeline:

  • Line 69 safely converts len(panel.selected) to uint and passes it to renderFooter
  • The count is passed through to getPanelModeInfo which formats it as "(N)" in select mode
  • The implementation follows the existing pattern used for sort information

The format "Select (N)" is clear and informative, including the edge case where N=0.

Also applies to: 87-89, 169-174


174-174: Verify the UI display across different scenarios.

Please ensure the selected count displays correctly in the footer when:

  • No items are selected (shows "Select (0)")
  • One item is selected (shows "Select (1)")
  • Multiple items are selected (shows "Select (N)")
  • With and without Nerdfont enabled
  • When the footer info items are truncated (line 104)

@yorukot

yorukot commented Dec 12, 2025

Copy link
Copy Markdown
Owner

LGTM! Thanks a lot.

@yorukot
yorukot merged commit d2c5da0 into yorukot:main Dec 12, 2025
9 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 17, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [yorukot/superfile](https://github.com/yorukot/superfile) | minor | `v1.4.0` → `v1.5.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>yorukot/superfile (yorukot/superfile)</summary>

### [`v1.5.0`](https://github.com/yorukot/superfile/releases/tag/v1.5.0)

[Compare Source](yorukot/superfile@v1.4.0...v1.5.0)

This release brings major new features, including video and PDF preview support, multi-column file panels, and configurable navigation, alongside significant code refactoring and comprehensive bug fixes.

#### Install:

[**Click me to know how to install**](https://github.com/yorukot/superfile?tab=readme-ov-file#installation)

#### Highlights

- Added video and PDF preview support via loading the first frame/page as an image. Thanks [@&#8203;Yassen-Higazi](https://github.com/Yassen-Higazi) for the implementation

<details><summary>Screenshots</summary>
<p>

<img width="951" height="596" alt="image" src="https://github.com/user-attachments/assets/6edfa9c2-ebcd-4622-a115-f71fa533b3e1" />

<img width="949" height="594" alt="image" src="https://github.com/user-attachments/assets/8d15fa46-5178-422d-8eea-455cac31fdd0" />

</p>
</details>

- Multi-column file panel view with date/size/permission columns. Thanks [@&#8203;xelavopelk](https://github.com/xelavopelk) for the implementation

<details><summary>Screenshots</summary>
<p>

<img width="420" height="264" alt="image" src="https://github.com/user-attachments/assets/e172f1e8-c2a5-42d2-8eeb-62e721f61a4f" />

</p>
</details>

- Configurable fast navigation in the Filepanel. See this MR for more details: [#&#8203;1220](yorukot/superfile#1220)
- You can now configure `spf` to open files with specific extensions with your choice of editor application. Thanks  [@&#8203;litvinov-git](https://github.com/litvinov-git) for the implementation See this MR for more details: [#&#8203;1197](yorukot/superfile#1197)
- Terminal stdout support for shell commands
- Allow launching with the filename. `spf /a/b/c.txt` will launch in `/a/b` with `c.txt` as the selected file.
- Various bug fixes, including modal confirmations, layout issues, and race conditions. See 'Detailed Change Summary'

##### Internal Updates

- Separated FilePanel and FileModel into a dedicated package for better code organization
- Comprehensive end-to-end testing with layout fixes
- Enhanced dimension validation and sidebar fixes
- Updated multiple dependencies including Astro, Go toolchain, and linters
- Added gosec linter and MND linter with magic number cleanup

#### Detailed Change Summary

<details><summary>Details</summary>
<p>

##### Update
- allow hover to file [`#1177`](yorukot/superfile#1177) by @&#8203;lazysegtree
- show count selected items in select mode [`#1187`](yorukot/superfile#1187) by @&#8203;xelavopelk
- Add icon alias for kts to kt [`#1153`](yorukot/superfile#1153) by @&#8203;nicolaic
- link icon and metadata [`#1171`](yorukot/superfile#1171) by @&#8203;xelavopelk
- user configuration of editors by file extension [`#1197`](yorukot/superfile#1197) by @&#8203;litvinov-git
- add video preview support [`#1178`](yorukot/superfile#1178) by @&#8203;Yassen-Higazi
- Add pdf preview support [`#1198`](yorukot/superfile#1198) by @&#8203;Yassen-Higazi
- Add icons in pinned directories [`#1215`](yorukot/superfile#1215) by @&#8203;lazysegtree
- Enable fast configurable navigation [`#1220`](yorukot/superfile#1220) by @&#8203;lazysegtree
- add Trash bin to default directories for Linux [`#1236`](yorukot/superfile#1236) by @&#8203;lazysegtree
- add terminal stdout support for shell commands [`#1250`](yorukot/superfile#1250) by @&#8203;majiayu000
- More columns in file panel (MVP) [`#1268`](yorukot/superfile#1268) by @&#8203;xelavopelk

##### Bug Fix
- only calculate checksum on files [`#1119`](yorukot/superfile#1119) by @&#8203;nikero41
- Linter issue with PrintfAndExit [`#1133`](yorukot/superfile#1133) by @&#8203;xelavopelk
- Remove repeated os.ReadDir calls [`#1155`](yorukot/superfile#1155) by @&#8203;lazysegtree
- Disable COPYFILE in macOS [`#1194`](yorukot/superfile#1194) by @&#8203;lazysegtree
- add missing hotkeys to help menu [`#1192`](yorukot/superfile#1192) by @&#8203;lazysegtree
- Fetch latest version automatically [`#1127`](yorukot/superfile#1127) by @&#8203;lazysegtree
- Use async methods to prevent test race conditions [`#1201`](yorukot/superfile#1201) by @&#8203;lazysegtree
- update metadata and process bar sizes when toggling footer [`#1218`](yorukot/superfile#1218) by @&#8203;lazysegtree
- File panel dimension management [`#1222`](yorukot/superfile#1222) by @&#8203;lazysegtree
- Layout fixes with full end-to-end tests [`#1227`](yorukot/superfile#1227) by @&#8203;lazysegtree
- Fix flaky tests [`#1233`](yorukot/superfile#1233) by @&#8203;lazysegtree
- modal confirmation bug with arrow keys [`#1243`](yorukot/superfile#1243) by @&#8203;lazysegtree
- small file panel optimization [`#1241`](yorukot/superfile#1241) by @&#8203;xelavopelk
- use ExtractOperationMsg for extraction [`#1248`](yorukot/superfile#1248) by @&#8203;lazysegtree
- skip open_with from missing field validation [`#1251`](yorukot/superfile#1251) by @&#8203;lazysegtree
- border height validation fixes [`#1267`](yorukot/superfile#1267) by @&#8203;lazysegtree
- fix case with two active panes [`#1271`](yorukot/superfile#1271) by @&#8203;xelavopelk
- help model formatting [`#1277`](yorukot/superfile#1277) by @&#8203;booth-w

##### Optimization
- simplify renameIfDuplicate logic [`#1100`](yorukot/superfile#1100) by @&#8203;sarff
- separate FilePanel into dedicated package [`#1195`](yorukot/superfile#1195) by @&#8203;lazysegtree
- File model separation [`#1223`](yorukot/superfile#1223) by @&#8203;lazysegtree
- Dimension validations [`#1224`](yorukot/superfile#1224) by @&#8203;lazysegtree
- layout validation and sidebar dimension fixes [`#1228`](yorukot/superfile#1228) by @&#8203;lazysegtree
- user rendering package and removal of unused preview code [`#1245`](yorukot/superfile#1245) by @&#8203;lazysegtree
- user rendering package for file preview [`#1249`](yorukot/superfile#1249) by @&#8203;lazysegtree

##### Documentation
- update Fish shell setup docs [`#1142`](yorukot/superfile#1142) by @&#8203;wleoncio
- fix macOS typo [`#1212`](yorukot/superfile#1212) by @&#8203;wcbing
- stylistic and linguistic cleanup of config documentation [`#1184`](yorukot/superfile#1184) by @&#8203;ninetailedtori

##### Dependencies
- update astro monorepo [`#1010`](yorukot/superfile#1010) by @&#8203;renovate[bot]
- update starlight-giscus [`#1020`](yorukot/superfile#1020) by @&#8203;renovate[bot]
- bump astro versions [`#1138`](yorukot/superfile#1138), [`#1157`](yorukot/superfile#1157), [`#1158`](yorukot/superfile#1158) by @&#8203;dependabot[bot], @&#8203;renovate[bot]
- bump vite [`#1134`](yorukot/superfile#1134) by @&#8203;dependabot[bot]
- update setup-go action [`#1038`](yorukot/superfile#1038) by @&#8203;renovate[bot]
- update expressive-code plugins [`#1189`](yorukot/superfile#1189), [`#1246`](yorukot/superfile#1246) by @&#8203;renovate[bot]
- update sharp [`#1256`](yorukot/superfile#1256) by @&#8203;renovate[bot]
- update fontsource monorepo [`#1257`](yorukot/superfile#1257) by @&#8203;renovate[bot]
- update urfave/cli [`#1136`](yorukot/superfile#1136), [`#1190`](yorukot/superfile#1190) by @&#8203;renovate[bot]
- update astro / starlight / ansi / toolchain deps [`#1275`](yorukot/superfile#1275), [`#1278`](yorukot/superfile#1278), [`#1280`](yorukot/superfile#1280) by @&#8203;renovate[bot]
- update python and go versions [`#1276`](yorukot/superfile#1276), [`#1191`](yorukot/superfile#1191) by @&#8203;renovate[bot]
- update golangci-lint action [`#1286`](yorukot/superfile#1286) by @&#8203;renovate[bot]

##### Misc
- update CI input names [`#1120`](yorukot/superfile#1120) by @&#8203;nikero41
- Everforest Dark Hard theme [`#1114`](yorukot/superfile#1114) by @&#8203;fzahner
- migrate tutorial demo assets to local [`#1140`](yorukot/superfile#1140) by @&#8203;yorukot
- new logo asset [`#1145`](yorukot/superfile#1145) by @&#8203;nonepork
- mirror repository to codeberg [`#1141`](yorukot/superfile#1141) by @&#8203;yorukot
- sync package lock [`#1143`](yorukot/superfile#1143) by @&#8203;yorukot
- bump golangci-lint version [`#1135`](yorukot/superfile#1135) by @&#8203;lazysegtree
- add gosec linter [`#1185`](yorukot/superfile#1185) by @&#8203;lazysegtree
- enable MND linter and clean magic numbers [`#1180`](yorukot/superfile#1180) by @&#8203;lazysegtree
- skip permission tests when running as root [`#1186`](yorukot/superfile#1186) by @&#8203;lazysegtree
- release v1.4.1-rc [`#1203`](yorukot/superfile#1203) by @&#8203;lazysegtree
- 1.5.0-rc1 housekeeping changes [`#1264`](yorukot/superfile#1264) by @&#8203;lazysegtree

</p>
</details> 

#### New Contributors
* @&#8203;fzahner made their first contribution in yorukot/superfile#1114
* @&#8203;sarff made their first contribution in yorukot/superfile#1100
* @&#8203;nicolaic made their first contribution in yorukot/superfile#1153
* @&#8203;Yassen-Higazi made their first contribution in yorukot/superfile#1178
* @&#8203;ninetailedtori made their first contribution in yorukot/superfile#1184
* @&#8203;litvinov-git made their first contribution in yorukot/superfile#1197
* @&#8203;wcbing made their first contribution in yorukot/superfile#1212
* @&#8203;majiayu000 made their first contribution in yorukot/superfile#1250

**Full Changelog**: <yorukot/superfile@v1.4.0...v1.5.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44MC4xIiwidXBkYXRlZEluVmVyIjoiNDIuODAuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
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.