Support -p flag again#797
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Restores “project-scoped” UI behavior when running lazydocker with -p outside of a docker-compose project directory, so project/services panels can appear again and container filtering can be applied.
Changes:
- Introduce
DockerCommand.IsProjectScoped()and use it to decide when to show project/services panels and apply container filtering. - Initialize
LocalProjectNamefrom-pwhen not in a compose directory. - Add a guard message for compose config rendering when not launched from a compose directory.
- Add repo guidance for vendored Go builds/tests and adjust Claude hook formatting behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/gui/services_panel.go | Show/hide services panel based on IsProjectScoped() |
| pkg/gui/project_panel.go | Show/hide project panel via IsProjectScoped(); guard compose config rendering outside compose dir |
| pkg/gui/containers_panel.go | Apply project/standalone filtering when IsProjectScoped() |
| pkg/commands/docker.go | Add IsProjectScoped() and LocalProjectName init when -p is used outside compose dir |
| CLAUDE.md | Document vendored Go build/test commands |
| .claude/settings.json | Update PostToolUse hook matcher/command for formatting |
Comments suppressed due to low confidence (1)
pkg/gui/containers_panel.go:98
- The inline comment still refers to an “InDockerComposeProject guard”, but the condition is now
IsProjectScoped(). This makes the rationale unclear/misleading—update the comment to reference the new guard (or clarify the actual condition that needs to hold).
// This check must be inside the InDockerComposeProject guard:
// outside a compose project, services are still derived from
// container labels, so compose-managed containers from other
// projects would be incorrectly hidden.
//
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+157
to
+163
| // When the user passes -p outside of a compose directory, treat it as the | ||
| // local project so the project/services panels still appear and filtering | ||
| // is applied. Inside a compose dir, LocalProjectName is derived from | ||
| // container labels later in RefreshContainersAndServices. | ||
| if !dockerCommand.InDockerComposeProject && config.ProjectName != "" { | ||
| dockerCommand.LocalProjectName = config.ProjectName | ||
| } |
Comment on lines
+168
to
+174
| // IsProjectScoped reports whether lazydocker should be scoped to a single | ||
| // compose project — either because we're inside a compose directory or | ||
| // because the user passed -p. When false, the project/services panels are | ||
| // hidden and all containers are shown in a flat list. | ||
| func (c *DockerCommand) IsProjectScoped() bool { | ||
| return c.InDockerComposeProject || c.Config.ProjectName != "" | ||
| } |
Addresses Copilot review comments on PR #797: - Containers panel title, initial focus selection, and the local-project inclusion in getDiscoveredProjects all switched from InDockerComposeProject to IsProjectScoped, so they stay consistent when -p is given outside a compose dir. - Adds TestIsProjectScoped table test covering all four combinations. InDockerComposeProject is still used at the call sites that genuinely require a compose dir (renderDockerComposeConfig, GetServices). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Apr 21, 2026
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [jesseduffield/lazydocker](https://github.com/jesseduffield/lazydocker) | patch | `v0.25.0` → `v0.25.2` | 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>jesseduffield/lazydocker (jesseduffield/lazydocker)</summary> ### [`v0.25.2`](https://github.com/jesseduffield/lazydocker/releases/tag/v0.25.2) [Compare Source](jesseduffield/lazydocker@v0.25.0...v0.25.2) #### Changelog - [`697cd44`](jesseduffield/lazydocker@697cd44) Add some claude stuff - [`b17d474`](jesseduffield/lazydocker@b17d474) Fixed forced project view - [`e3c1c86`](jesseduffield/lazydocker@e3c1c86) Hide project/services panels when not in a docker-compose project - [`ebce4fc`](jesseduffield/lazydocker@ebce4fc) Initial plan - [`9134abe`](jesseduffield/lazydocker@9134abe) Merge pull request [#​776](jesseduffield/lazydocker#776) from jesseduffield/copilot/disable-forced-project-view - [`8106125`](jesseduffield/lazydocker@8106125) Merge pull request [#​795](jesseduffield/lazydocker#795) from ddibiasi/copilot/disable-forced-project-view - [`7e7aadc`](jesseduffield/lazydocker@7e7aadc) Merge pull request [#​797](jesseduffield/lazydocker#797) from jesseduffield/support-p-flag - [`3974f6f`](jesseduffield/lazydocker@3974f6f) Support -p flag and DRY up code - [`f5ff116`](jesseduffield/lazydocker@f5ff116) Use IsProjectScoped at remaining call sites + add test </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, 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:eyJjcmVhdGVkSW5WZXIiOiI0My4xMzYuMiIsInVwZGF0ZWRJblZlciI6IjQzLjEzNi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiLCJhdXRvbWF0aW9uOmJvdC1hdXRob3JlZCIsImRlcGVuZGVuY3ktdHlwZTo6cGF0Y2giXX0=-->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.