Skip to content

fix: add layout.title_position and layout.show_file_count options (#908) - #909

Merged
dmtrKovalenko merged 1 commit into
mainfrom
triage-bot/issue-908
Oct 8, 2026
Merged

dmtrKovalenko merged 1 commit into
mainfrom
triage-bot/issue-908

Conversation

@gustav-fff

@gustav-fff gustav-fff commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #908

Root cause

Picker title position hardcoded title_pos = 'left' in lua/fff/layout.lua:317 (bottom prompt, list window) and lua/fff/layout.lua:384 (top prompt, input window). Matched/total count always rendered by update_status in lua/fff/picker_ui/picker_ui.lua:389-414, no switch.

Fix

  • layout.title_position = 'left' (default) | 'center' | 'right'. Invalid value falls back to 'left'.
  • layout.show_file_count = true (default). When false, file-mode count is skipped (also skips the get_search_metadata FFI call). Indexing files N progress and grep mode indicator still shown.
  • Options put under layout next to show_scrollbar, not top-level as proposed in the issue. README + doc/fff.nvim.txt updated. Defaults unchanged.

Steps to reproduce

On pre-fix main:

make build
nvim --clean --cmd "set rtp^=$PWD" -c "lua vim.g.fff = { layout = { prompt_position = 'top', title_position = 'center', show_file_count = false } }" -c "lua require('fff').find_files()"

Expected: FFFiles centered on top border, nothing right of the prompt.
Actual (main): title glued to the left corner, file count (e.g. 32) right of the prompt. Both options silently ignored.

How verified

make build-e2e
make test-lua-snap
  • New snapshot cases title_center_no_count/empty_{top,bottom} (tests/screenshots/tests-picker_ui_snap.lua---title_center_no_count---*): title centered (┌──── FFFiles ────┬), no count on prompt row. Compare with default/empty_*: ┌ FFFiles ─── and 32 on prompt row.
  • All existing empty_*, no_results_*, cursor_second_item_*, scrollbar snapshots pass unchanged, so defaults did not move.
  • 16 query_main_* / combo / debug_* snapshots fail locally, identically on clean main (c188e7a). Pre-existing drift, not touched here. CI does not run this suite.
  • layout.compute checked headless for left|center|right|bogus|nil x top|bottom prompt: resolves to given value, bogus/nil fall back to left.
  • stylua --check clean.

Automated triage via Gustav. Honk-Honk 🪿

Summary by CodeRabbit

  • New Features
    • Added options to show or hide the matched and total file count, and to align the picker title left, center, or right. Defaults show the count and align the title left.
  • Documentation
    • Documented the new layout options in the configuration guides.

Title position was hardcoded to 'left' and the matched/total count next
to the prompt could not be hidden. Defaults keep current behavior.

Closes #908

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 458e7baf-0d62-479e-b09c-0ece91fb0261
📥 Commits

Reviewing files that changed from the base of the PR and between c188e7a and 45a044a.

📒 Files selected for processing (8)
  • README.md
  • doc/fff.nvim.txt
  • lua/fff/conf.lua
  • lua/fff/layout.lua
  • lua/fff/picker_ui/picker_ui.lua
  • tests/picker_ui_snap.lua
  • tests/screenshots/tests-picker_ui_snap.lua---title_center_no_count---empty_bottom
  • tests/screenshots/tests-picker_ui_snap.lua---title_center_no_count---empty_top

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The picker layout now supports configurable title alignment and an option to hide the matched/total file count. The defaults keep the count visible and align titles to the left. Snapshot tests cover centered titles with the count hidden.

Changes

Picker layout options

Layer / File(s) Summary
Layout options and defaults
lua/fff/conf.lua, README.md, doc/fff.nvim.txt
The layout configuration declares show_file_count and title_position, with defaults of true and 'left'. The documentation describes the available title positions and file-count behavior.
Configurable title alignment
lua/fff/layout.lua
Window titles use the configured position for both top and bottom prompt layouts. Invalid positions fall back to left.
File-count visibility and snapshots
lua/fff/picker_ui/picker_ui.lua, tests/picker_ui_snap.lua, tests/screenshots/tests-picker_ui_snap.lua---title_center_no_count---*
When file-count display is disabled, the picker clears the status and does not add status virtual text. Snapshot cases cover centered titles and hidden counts for top and bottom prompt positions.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Feature

Suggested reviewers: dmtrkovalenko

Merge Risk: ⚪ Minimal · up to 45a04

The new options preserve the existing defaults, and hiding the file count does not hide indexing progress or grep-mode indicators. No actionable merge risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the two layout options added by the pull request.
Linked Issues check ✅ Passed Issue #908 requests configurable title positioning and an option to hide the file count. lua/fff/layout.lua accepts left, center, and right, with invalid values falling back to left, for bot…
Out of Scope Changes check ✅ Passed The changes are limited to the requested layout configuration, picker status rendering, configuration documentation, and focused snapshot test support and fixtures. These changes directly support issu…
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 4 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@dmtrKovalenko
dmtrKovalenko merged commit a7ded8b into main Oct 8, 2026
54 checks passed
wpenistone pushed a commit to wpenistone/fffork that referenced this pull request Oct 13, 2026
…ons (dmtrKovalenko#908) (dmtrKovalenko#909)

Title position was hardcoded to 'left' and the matched/total count next
to the prompt could not be hidden. Defaults keep current behavior.

Closes dmtrKovalenko#908

Co-authored-by: Dmitriy Kovalenko <dmitriy@iusevimbtw.com>
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.

[Suggestion]: Allow configuring the picker title position and hiding the file count

2 participants