Merged
Conversation
d700d4c to
6e6adc5
Compare
There was a problem hiding this comment.
Pull request overview
This PR enhances lazydocker’s Docker Compose “projects” support by discovering multiple projects from running containers, allowing project selection in the UI, and adding a startup -p/--project flag to preselect a project.
Changes:
- Add project discovery (from container labels) and project-aware filtering for services/containers.
- Add project selection UX (selectable project list, focus-driven expansion) and selection callbacks.
- Propagate project context into compose commands (via
-p) and adjust refresh ordering to support discovery.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/i18n/english.go | Adds a new translation string for non-local service management errors. |
| pkg/gui/views.go | Enables highlighting/selection styling for the project panel. |
| pkg/gui/services_panel.go | Filters services by selected project; blocks some non-local operations; injects selected project into project up/down/bulk commands. |
| pkg/gui/project_panel.go | Converts project panel into a selectable list of discovered projects; re-filters dependent panels on selection; injects project into logs/config. |
| pkg/gui/panels/side_list_panel.go | Adds OnSelect callback invoked on selection changes. |
| pkg/gui/layout.go | Refocus logic updated to use the full list panel set. |
| pkg/gui/gui.go | Refresh order changed so containers/services refresh before projects. |
| pkg/gui/containers_panel.go | Filters containers by selected project; adjusts service/container association to include project. |
| pkg/gui/arrangement.go | Makes project panel expand when focused (accordion-like behavior). |
| pkg/config/app_config.go | Adds ProjectName to app config and threads it through construction. |
| pkg/config/app_config_test.go | Updates tests for new NewAppConfig signature. |
| pkg/commands/service.go | Adds ProjectName to Service. |
| pkg/commands/docker.go | Core logic: derive services/projects from containers, merge with compose services, add -p injection support. |
| pkg/cheatsheet/generate.go | Updates NewAppConfig call signature. |
| main.go | Adds -p/--project flag and passes it into config. |
| docker-compose.yml | Removes the compose file version field. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
pkg/commands/docker.go
Outdated
| @@ -312,6 +432,7 @@ func (c *DockerCommand) GetServices() ([]*Service, error) { | |||
| services[i] = &Service{ | |||
| Name: str, | |||
| ID: str, | |||
Comment on lines
+334
to
+338
| project, _ := gui.Panels.Projects.GetSelectedItem() | ||
| return gui.createConfirmationPanel(gui.Tr.Confirm, gui.Tr.ConfirmUpProject, func(g *gocui.Gui, v *gocui.View) error { | ||
| cmdStr := utils.ApplyTemplate( | ||
| gui.Config.UserConfig.CommandTemplates.Up, | ||
| gui.DockerCommand.NewCommandObject(commands.CommandObject{}), | ||
| gui.DockerCommand.NewCommandObject(commands.CommandObject{Project: project}), |
Comment on lines
+219
to
+223
| // Derive services from container labels (covers all projects) | ||
| services := c.GetServicesFromContainers(containers) | ||
|
|
||
| var composeServices []*Service | ||
| if c.InDockerComposeProject { |
| for _, ctr := range containers { | ||
| if ctr.ProjectName == "" || ctr.ServiceName == "" { | ||
| continue | ||
| } |
Comment on lines
+79
to
+81
| defaultObj.DockerCompose = fmt.Sprintf("%s -p %s", defaultObj.DockerCompose, obj.Service.ProjectName) | ||
| } else if obj.Project != nil && obj.Project.Name != "" { | ||
| defaultObj.DockerCompose = fmt.Sprintf("%s -p %s", defaultObj.DockerCompose, obj.Project.Name) |
| func (gui *Gui) renderDockerComposeConfig(project *commands.Project) tasks.TaskFunc { | ||
| return gui.NewSimpleRenderStringTask(func() string { | ||
| return utils.ColoredYamlString(gui.DockerCommand.DockerComposeConfig()) | ||
| return utils.ColoredYamlString(gui.DockerCommand.DockerComposeConfigForProject(project)) |
Comment on lines
+218
to
+219
| project, _ := gui.Panels.Projects.GetSelectedItem() | ||
| c, err := gui.DockerCommand.ViewAllLogs(project) |
pkg/gui/services_panel.go
Outdated
Comment on lines
288
to
292
| if !gui.isServiceFromLocalProject(service) && service.Container == nil { | ||
| return gui.createErrorPanel(gui.Tr.CannotManageNonLocalService) | ||
| } | ||
|
|
||
| return gui.WithWaitingStatus(gui.Tr.StartingStatus, func() error { |
Comment on lines
+246
to
+249
| // Fall back to directory name | ||
| if c.LocalProjectName == "" && c.Config.ProjectDir != "" { | ||
| c.LocalProjectName = path.Base(c.Config.ProjectDir) | ||
| } |
pkg/commands/docker.go
Outdated
Comment on lines
+282
to
+284
| services = append(services, &Service{ | ||
| Name: ctr.ServiceName, | ||
| ID: ctr.ServiceName, |
6e6adc5 to
700c0ee
Compare
700c0ee to
b65137a
Compare
This was referenced Mar 15, 2026
Closed
|
This is a big regression for me, I am no longer able to use lazydocker to get a quick list of all containers that are running on the system, because I am always forced into the "Project" view, regardless if the current folder is a docker-compose Project folder or not. See also #775 |
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Mar 26, 2026
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [jesseduffield/lazydocker](https://github.com/jesseduffield/lazydocker) | minor | `v0.24.4` → `v0.25.0` | 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.0`](https://github.com/jesseduffield/lazydocker/releases/tag/v0.25.0) [Compare Source](jesseduffield/lazydocker@v0.24.4...v0.25.0) #### Changelog - [`b65137a`](jesseduffield/lazydocker@b65137a) Add claude settings file - [`26ce871`](jesseduffield/lazydocker@26ce871) Improve projects support - [`2ebe384`](jesseduffield/lazydocker@2ebe384) Merge pull request [#​774](jesseduffield/lazydocker#774) from jesseduffield/better-project-support </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, 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:eyJjcmVhdGVkSW5WZXIiOiI0My45MS40IiwidXBkYXRlZEluVmVyIjoiNDMuOTEuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6Om1pbm9yIl19-->
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.
Should fix the following issues:
Core multi-project support:
Service-to-container cross-contamination bug:
from project root
Container scoping by project:
-p flag support: