Skip to content

feat: show actual file count in files panel footer#5467

Open
PeterTimCousins wants to merge 1 commit intojesseduffield:masterfrom
PeterTimCousins:feat/file-count-footer
Open

feat: show actual file count in files panel footer#5467
PeterTimCousins wants to merge 1 commit intojesseduffield:masterfrom
PeterTimCousins:feat/file-count-footer

Conversation

@PeterTimCousins
Copy link
Copy Markdown

Summary

In tree mode, the files panel footer shows X of Y where Y includes directory nodes in the tree. This doesn't match the actual number of changed files (as reported by git status), which can be confusing.

This adds a file count suffix to the footer so it reads e.g. 1 of 39 | 23 changes, making the true number of changed files visible at a glance while keeping the tree navigation counter intact.

Before: 1 of 39
After: 1 of 39 | 23 changes

When not in tree mode, both numbers match so the suffix is still shown but isn't surprising.

Implementation

  • Adds a generic footerExtra callback field to ListContextTrait — other contexts can use this in the future without modifying shared footer logic
  • WorkingTreeContext sets the callback to return the count from GetAllFiles() (actual files, no directories)
  • Pluralizes correctly (1 change vs 23 changes)

Files changed

  • pkg/gui/context/list_context_trait.gofooterExtra field + setFooter() appends extra info
  • pkg/gui/context/working_tree_context.go — sets footerExtra to show file count

In tree mode, the files panel footer shows "X of Y" where Y includes
directory nodes. This can be confusing since it doesn't match the
actual number of changed files (as shown by git status).

Add a file count suffix to the footer so it reads e.g. "1 of 39 | 23
changes", making the true number of changed files visible at a glance
while keeping the tree navigation counter intact.

This is implemented via a generic footerExtra callback on
ListContextTrait, so other contexts can add footer info in the future
without modifying the shared setFooter logic.
@codacy-production
Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

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.

1 participant