fix: more alignments still

This commit is contained in:
2026-04-26 09:40:33 +02:00
parent b377951054
commit 50d8e88ce8
8 changed files with 144 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ defmodule BDS.Desktop.ShellLiveTest do
{:ok, _project} = Projects.set_active_project(project.id)
original_shell_platform = Application.get_env(:bds, :shell_platform)
original_git_remote_state_provider = Application.get_env(:bds, :git_remote_state_provider)
on_exit(fn ->
if is_nil(original_shell_platform) do
@@ -33,6 +34,12 @@ defmodule BDS.Desktop.ShellLiveTest do
else
Application.put_env(:bds, :shell_platform, original_shell_platform)
end
if is_nil(original_git_remote_state_provider) do
Application.delete_env(:bds, :git_remote_state_provider)
else
Application.put_env(:bds, :git_remote_state_provider, original_git_remote_state_provider)
end
end)
%{project: project, temp_dir: temp_dir}
@@ -158,6 +165,18 @@ defmodule BDS.Desktop.ShellLiveTest do
refute html =~ ~s(data-testid="window-titlebar-menu-dropdown")
end
test "shell live renders the legacy git activity badge from remote behind count" do
Application.put_env(:bds, :git_remote_state_provider, fn _project_id, _opts ->
{:ok, %{local_branch: "main", upstream_branch: "origin/main", has_upstream: true, ahead: 0, behind: 7}}
end)
{:ok, _view, html} = live_isolated(build_conn(), BDS.Desktop.ShellLive)
assert html =~ ~s(data-view="git")
assert html =~ ~s(class="activity-bar-badge")
assert html =~ ">7<"
end
test "sidebar open supports preview and pin intents for entity tabs" do
{:ok, view, _html} = live_isolated(build_conn(), BDS.Desktop.ShellLive)

View File

@@ -72,6 +72,22 @@ defmodule BDS.GitTest do
assert repo.current_branch == "main"
end
test "remote_state reports upstream ahead and behind counts", %{project: project} do
runner = fake_runner(fn
"git", ["rev-parse", "--abbrev-ref", "HEAD"], _opts -> {"main\n", 0}
"git", ["rev-parse", "--abbrev-ref", "--symbolic-full-name", "@{upstream}"], _opts -> {"origin/main\n", 0}
"git", ["rev-list", "--count", "origin/main..HEAD"], _opts -> {"2\n", 0}
"git", ["rev-list", "--count", "HEAD..origin/main"], _opts -> {"5\n", 0}
end)
assert {:ok, remote_state} = Git.remote_state(project.id, runner: runner)
assert remote_state.local_branch == "main"
assert remote_state.upstream_branch == "origin/main"
assert remote_state.has_upstream == true
assert remote_state.ahead == 2
assert remote_state.behind == 5
end
test "fetch, pull, push, commit_all, reconcile, and prune_lfs_cache run non-interactively", %{
project: project
} do

View File

@@ -136,11 +136,17 @@ defmodule BDS.UI.ShellTest do
template = File.read!("/Users/gb/Projects/bDS2/lib/bds/desktop/shell_live/index.html.heex")
assert css =~ "color: var(--vscode-activityBar-foreground)"
assert css =~ ".activity-bar-badge"
assert css =~ ".tab-actions"
assert css =~ ".tab-dirty-indicator"
assert css =~ ".tab.dirty .tab-close"
assert css =~ ".tab:focus-visible"
assert css =~ ".window-titlebar-action-button:focus"
assert css =~ ".panel-tab.active"
assert css =~ "border-bottom-color: var(--vscode-focusBorder);"
assert css =~ ".sidebar-section-header"
assert css =~ "justify-content: space-between"
assert css =~ "align-items: center"
assert css =~ "padding-right: calc(10px + var(--bds-titlebar-overlay-right, 0px));"
assert live_js =~ "windowControlsOverlay"
assert live_js =~ "geometrychange"
@@ -150,6 +156,7 @@ defmodule BDS.UI.ShellTest do
assert live_js =~ "event.preventDefault()"
assert live_js =~ "this.pushEvent(\"shortcut\""
assert template =~ "data-shortcuts={encoded_shortcuts(@client_shortcuts)}"
assert template =~ "activity-bar-badge"
assert template =~ "tab-actions"
assert template =~ "tab-dirty-indicator"
end