Skip to content

feat(tui): allow navigating above launch directory#494

Merged
dundee merged 5 commits intodundee:masterfrom
ShivamB25:feat/tui-parent-navigation-481
Feb 25, 2026
Merged

feat(tui): allow navigating above launch directory#494
dundee merged 5 commits intodundee:masterfrom
ShivamB25:feat/tui-parent-navigation-481

Conversation

@ShivamB25
Copy link
Contributor

@ShivamB25 ShivamB25 commented Feb 14, 2026

Summary

  • allow left-arrow navigation at the launch directory to rescan and open its parent directory
  • preserve existing behavior for device mode and archive browsing while adding parent traversal for normal directories
  • update TestMoveLeftRight to validate moving above the initial directory in an isolated temp working tree

Verification

  • golangci-lint run
  • go test -v -covermode=count ./...
  • go test -v -race -covermode=atomic -coverprofile=coverage.out ./...

Fixes #481

@codecov
Copy link

codecov bot commented Feb 14, 2026

Codecov Report

❌ Patch coverage is 80.95238% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.54%. Comparing base (ede21d2) to head (aa604e4).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
cmd/gdu/app/app.go 50.00% 1 Missing and 1 partial ⚠️
tui/tui.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #494      +/-   ##
==========================================
+ Coverage   81.42%   81.54%   +0.11%     
==========================================
  Files          49       49              
  Lines        5126     5179      +53     
==========================================
+ Hits         4174     4223      +49     
- Misses        816      820       +4     
  Partials      136      136              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ShivamB25
Copy link
Contributor Author

Addressed the remaining Codecov patch gaps for tui/keys.go and pushed commit 144bc58.

What changed:

  • added a focused test for the parent-analysis error path: TestAnalyzeParentOfTopDirShowsErrorWhenAnalyzeFails
  • introduced a small test hook (analyzeParentPath) so the error branch in analyzeParentOfTopDir can be exercised deterministically

Validation run locally:

  • golangci-lint run
  • go test -v -covermode=count ./...
  • go test -v -race -covermode=atomic -coverprofile=coverage.out ./...

Note: one parallel verification run hit a pre-existing Badger testdir lock contention in pkg/analyze; rerunning sequentially passed cleanly.

@dundee
Copy link
Owner

dundee commented Feb 24, 2026

Nice PR! I think we should put this behind a config option (could be probably just config file option, not the Gdu command flag) and default it to "disabled".

Put the parent directory traversal feature behind a config file option
(browse-parent-dirs) defaulting to disabled, as requested by the
project maintainer. The option follows the existing config pattern
(Flags struct -> getOptions -> UI setter) and is config-file only,
not exposed as a CLI flag.
@ShivamB25
Copy link
Contributor Author

@dundee check

@dundee
Copy link
Owner

dundee commented Feb 25, 2026

Thank you!

@dundee dundee merged commit 16d331e into dundee:master Feb 25, 2026
9 checks passed
@ShivamB25 ShivamB25 deleted the feat/tui-parent-navigation-481 branch February 25, 2026 12:18
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.

Allo going up the directory structure from the folder where gdu was launched

2 participants