From 4d6488a19de02a1804e0de5a53fef4df5102db29 Mon Sep 17 00:00:00 2001 From: GigabiteStudios Date: Thu, 18 Jun 2026 19:24:32 -0500 Subject: [PATCH] fix(sidebar): anchor submodules section to bottom --- src/ui/gitree_ui.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ui/gitree_ui.cpp b/src/ui/gitree_ui.cpp index f2bdf5c..bc117af 100644 --- a/src/ui/gitree_ui.cpp +++ b/src/ui/gitree_ui.cpp @@ -495,6 +495,13 @@ void draw_sidebar(float width) { section(ICON_FA_DIAGRAM_PROJECT " WORKTREES", repo().worktrees, ICON_FA_COMPUTER, "Add worktree", "Worktree creation is not wired yet", SidebarItemKind::worktree, 2, section_heights[2], maximum_heights[2]); + + const float submodules_body_height = section_open[3] && section_heights[3] >= ui(1.0f) + ? section_heights[3] + ui(5.0f) + : 1.0f; + const float submodules_block_height = ui(22.0f) + submodules_body_height; + ImGui::SetCursorPosY(std::max(ImGui::GetCursorPosY(), + ImGui::GetContentRegionMax().y - submodules_block_height)); section(ICON_FA_CUBES " SUBMODULES", repo().submodules, ICON_FA_CUBES, "Add submodule", "Submodule creation is not wired yet", SidebarItemKind::submodule, 3, section_heights[3], maximum_heights[3]);