Skip to content

Hide project/services panels when not in a docker-compose project directory#776

Merged
jesseduffield merged 4 commits into
masterfrom
copilot/disable-forced-project-view
Apr 19, 2026
Merged

Hide project/services panels when not in a docker-compose project directory#776
jesseduffield merged 4 commits into
masterfrom
copilot/disable-forced-project-view

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 15, 2026

v0.25's multi-project discovery caused the Projects and Services panels to always appear, even when launched outside a compose project. Containers were also filtered to the first discovered project, making other running containers invisible.

Changes

  • project_panel.go: Added Hide returning !InDockerComposeProject — Projects panel only appears when inside a compose directory.

  • services_panel.go: Simplified Hide from !InDockerComposeProject && len(services) == 0 to !InDockerComposeProject. The old check caused the panel to appear whenever other compose containers were running on the system.

  • containers_panel.go: Project-based filtering now only applies when InDockerComposeProject is true — outside a compose project, all containers are shown in a flat list regardless of their compose project label.

  • arrangement.go: The compact-size treatment (Size: 3) for the first side panel was unconditional. Now it only applies when sideWindowNames[0] == "project", preventing the Containers panel from being squashed to 3 lines when the Projects panel is hidden.

Original prompt

This section details on the original issue you should resolve

<issue_title>Disable forced Project view</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
Before v25 if I run lazydocker in a "non project" folder I was able to see all running containers on the system in the container[3] view, regardless if they belong to a docker-compose project or not and the Services [2] panel was hidden. If i run it from inside a docker-compose project folder I would see the containers of the compose project in the Services[2] Panel and all others in the containers[3] panel.

Now I am no longer able to see all containers on the system at once, no matter in which folder I run lazydocker.
Also now the "Services" panel is always visible which adds yet another panel to the already overcrowded left side (see also #513)

Describe the solution you'd like
A way to disable the "Project" functionality if lazydocker is not run inside a project folder and have all containers be visible in a flat list in panel [3] like it was possible in v24. As shown in the Github Project's own readme/demo https://github.com/jesseduffield/lazydocker/blob/master/docs/resources/demo3.gif

</issue_description>

Comments on the Issue (you are @copilot in this section)


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: jesseduffield <8456633+jesseduffield@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix forced Project view in lazydocker Hide project/services panels when not in a docker-compose project directory Mar 15, 2026
Copilot AI requested a review from jesseduffield March 15, 2026 22:26
Comment thread pkg/gui/containers_panel.go Outdated
Comment on lines 86 to 91
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.

This should be moved after if gui.DockerCommand.InDockerComposeProject{ .., as otherwise containers from other projects would be incorrectly hidden.

@jesseduffield jesseduffield marked this pull request as ready for review April 19, 2026 01:55
Copilot AI review requested due to automatic review settings April 19, 2026 01:55
@jesseduffield jesseduffield merged commit 9134abe into master Apr 19, 2026
7 checks passed
@jesseduffield jesseduffield deleted the copilot/disable-forced-project-view branch April 19, 2026 01:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adjusts LazyDocker’s side panels and container filtering so that when launched outside a docker-compose project directory, the UI doesn’t force the Projects/Services context and instead shows all containers in a flat list (restoring pre-v0.25 behavior and fixing hidden containers).

Changes:

  • Hide the Projects and Services side panels when InDockerComposeProject is false.
  • Apply compose-project filtering in the Containers panel only when InDockerComposeProject is true.
  • Prevent the first visible side panel from being squashed to a fixed compact height unless it’s actually the Project panel.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
pkg/gui/project_panel.go Hides Projects panel outside compose directories.
pkg/gui/services_panel.go Hides Services panel outside compose directories (removes “any discovered services” exception).
pkg/gui/containers_panel.go Limits project/standalone filtering to compose-project context so all containers show outside compose dirs.
pkg/gui/arrangement.go Only applies compact-height treatment when the first side panel is the Project panel.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +90 to 116
// Only apply project and standalone filtering when we are inside a
// docker-compose project. Outside of a compose project all
// containers are shown in a flat list regardless of which compose
// project they belong to.
if gui.DockerCommand.InDockerComposeProject {
// 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.
//
// Note that this is O(N*M) time complexity where N is the number of services
// and M is the number of containers. We expect N to be small but M may be large,
// so we will need to keep an eye on this.
if !gui.Config.UserConfig.Gui.ShowAllContainers && !isStandaloneContainer(container) {
return false
}

// Filter by selected project. Containers with no project (truly
// standalone, not from any compose project) are always shown.
selectedProject := gui.getSelectedProjectName()
if selectedProject == "" {
selectedProject = gui.DockerCommand.LocalProjectName
}
if selectedProject != "" && container.ProjectName != "" && container.ProjectName != selectedProject {
return false
}
}
Copy link

Copilot AI Apr 19, 2026

Choose a reason for hiding this comment

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

The filtering behaviour here changed significantly (project filtering is now conditional on InDockerComposeProject). Since this impacts which containers are visible, it would be good to add unit tests covering the Filter logic for (a) InDockerComposeProject=false => compose-labelled containers are not hidden, and (b) InDockerComposeProject=true with ShowAllContainers toggled and selectedProject set/unset to ensure the expected inclusion/exclusion.

Copilot uses AI. Check for mistakes.
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 [#&#8203;776](jesseduffield/lazydocker#776) from jesseduffield/copilot/disable-forced-project-view
- [`8106125`](jesseduffield/lazydocker@8106125) Merge pull request [#&#8203;795](jesseduffield/lazydocker#795) from ddibiasi/copilot/disable-forced-project-view
- [`7e7aadc`](jesseduffield/lazydocker@7e7aadc) Merge pull request [#&#8203;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=-->
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.

Disable forced Project view

4 participants