Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified bin/aarch64/syncshell-core
Binary file not shown.
Binary file modified bin/x86_64/syncshell-core
Binary file not shown.
11 changes: 6 additions & 5 deletions core/internal/session/profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ func (s *Session) removeWebProfile(ctx context.Context) ActionResult {
}
modern, _ := s.webProfile.Name("modern")
themed, _ := s.webProfile.Name("themed")
if current.Theme != "default" && current.Theme != modern && current.Theme != themed {
return rejected("profile_not_selected", "Another Web UI profile is selected; switch to default before removing this adapter's profiles")
}
if result := s.setWebUITheme(ctx, "default"); !result.OK {
return result
// Only a theme this adapter owns would be left pointing at deleted files;
// any other selection is the user's or another adapter's and stays.
if current.Theme == modern || current.Theme == themed {
if result := s.setWebUITheme(ctx, "default"); !result.OK {
return result
}
}
if err := s.webProfile.Remove(assets); err != nil {
return rejected("profile_cleanup", err.Error())
Expand Down
30 changes: 30 additions & 0 deletions core/internal/session/profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,36 @@ func TestProfileActionVerifiesThemeAndOwnedFileOutcomes(t *testing.T) {
}
}

func TestProfileCleanupLeavesAThemeItDoesNotOwn(t *testing.T) {
s, api := profileSession(t)
result := s.Act(context.Background(), "webui.apply-profile", ActionArguments{Profile: "modern"})
if !result.OK {
t.Fatalf("profile was not applied: %#v", result)
}
profile := filepath.Join(api.guiAssets, "syncshell-test-modern")
other := filepath.Join(api.guiAssets, "another-adapter")
if err := os.Mkdir(other, 0700); err != nil {
t.Fatal(err)
}
for _, theme := range []string{"dark", "another-adapter"} {
api.mu.Lock()
api.theme = theme
api.mu.Unlock()
if result := s.Act(context.Background(), "webui.remove-profile", ActionArguments{}); !result.OK {
t.Fatalf("cleanup refused %s: %#v", theme, result)
}
if api.currentTheme() != theme {
t.Fatalf("cleanup changed %s to %s", theme, api.currentTheme())
}
if _, err := os.Stat(profile); !os.IsNotExist(err) {
t.Fatalf("owned profile remains under %s: %v", theme, err)
}
if _, err := os.Stat(other); err != nil {
t.Fatal("another adapter's directory was changed", err)
}
}
}

func TestProfileActionRejectsChangedAssetDirectory(t *testing.T) {
s, api := profileSession(t)
changed := t.TempDir()
Expand Down
2 changes: 1 addition & 1 deletion hosts/caelestia/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ Web UI selection is explicit. Palette changes update only the currently
selected `syncshell-caelestia-themed` profile; another adapter's selection is
left alone. Profiles use the `caelestia` ownership marker. Use Settings,
**Restore default UI and clean owned profiles**, before disabling/removing
Syncshell. If another profile is selected, explicitly apply Default first.
Syncshell. Any other selected theme stays selected.

For direct removal without a manager hook, run the same core action before
deleting the installed package (set `config` to the selected configuration):
Expand Down
4 changes: 2 additions & 2 deletions packaging/bundled/SHA256SUMS
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
314a89c32525c5b746f50a52b65967ed301e11f12bbbf5f3d44e387a10d540fc bin/syncshell-core
13aa21873936b346df54fd3ea4e1827667757516cabf0c27b4823618ca4ad1d5 bin/x86_64/syncshell-core
b568b7582679dec3eb0bf094f1ff89b0e26505086619a8564772c026b4c563a2 bin/aarch64/syncshell-core
bfd889d229704f88160eed43bb0d4b5da1e48921299e8feab4d121373d915142 bin/x86_64/syncshell-core
2bdfb7361a0e8971127949795694248c0747a1b26c7462928f20d11e25652397 bin/aarch64/syncshell-core
2 changes: 1 addition & 1 deletion shared/AdapterService.qml
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ QtObject {
}

function removeWebProfile() {
return runAction("webui.remove-profile", {}, "Default Web UI restored; this adapter's profiles removed", "");
return runAction("webui.remove-profile", {}, "This adapter's Web UI profiles removed", "");
}

function setServiceEnabled(enabled) {
Expand Down
Loading