mirror of
https://github.com/got-feedBack/feedBack.git
synced 2026-08-11 11:19:24 +00:00
fix(tuner): remove unused settings + fix sidebar panel position (#661)
Removes the Floating Button and Tuning Visibility settings sections and finishes retiring their still-live config: drops the disabledTunings menu filter and showFloatingButton gate from screen.js/ui.js and their persistence in routes.py (retired keys are stripped on write). Repositions the tuner panel opened from the v3 sidebar Plugins popover to anchor beside it via the host's stable plugin-control slot API (falling back to the popover id), clamped to the viewport so it can't open off-screen, and re-anchored on resize. Updates tuner config tests to the retired-key behavior; plugins/tuner 1.3.2 -> 1.3.3. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
9b4bef3fd1
commit
5e78f2f7f7
@@ -54,16 +54,21 @@ class TestConfigDefaults:
|
||||
assert body["lastTuning"] == "Standard"
|
||||
assert body["lastInstrument"] == "guitar-6"
|
||||
assert body["audioInputMode"] == "auto"
|
||||
assert body["showFloatingButton"] is True
|
||||
assert body["visualizationMode"] == "default"
|
||||
assert body["customTunings"] == {}
|
||||
assert body["disabledTunings"] == []
|
||||
|
||||
def test_get_does_not_include_default_tunings(self, client):
|
||||
# defaultTunings moved to GET /api/tunings (core tuning.read capability).
|
||||
body = client.get("/api/plugins/tuner/config").json()
|
||||
assert "defaultTunings" not in body
|
||||
|
||||
def test_get_does_not_include_retired_keys(self, client):
|
||||
# disabledTunings + showFloatingButton were retired along with their
|
||||
# settings UI; the config must no longer expose them.
|
||||
body = client.get("/api/plugins/tuner/config").json()
|
||||
assert "disabledTunings" not in body
|
||||
assert "showFloatingButton" not in body
|
||||
|
||||
|
||||
class TestConfigPersistence:
|
||||
def test_partial_update_persisted(self, client):
|
||||
@@ -109,14 +114,22 @@ class TestConfigPersistence:
|
||||
client.post("/api/plugins/tuner/config", json={"autoOpenOnTuningChange": bad})
|
||||
assert client.get("/api/plugins/tuner/config").json()["autoOpenOnTuningChange"] is False, bad
|
||||
|
||||
def test_disabled_tunings_strips_entries_without_colon(self, client):
|
||||
client.post("/api/plugins/tuner/config", json={
|
||||
"disabledTunings": ["guitar-6:Drop D", "legacy-entry", "bass-4:Standard"]
|
||||
def test_retired_keys_ignored_and_not_persisted(self, client, config_dir):
|
||||
# disabledTunings + showFloatingButton were retired: POSTing them must
|
||||
# not break the request, leak back in the response, or hit the file.
|
||||
r = client.post("/api/plugins/tuner/config", json={
|
||||
"disabledTunings": ["guitar-6:Drop D"],
|
||||
"showFloatingButton": False,
|
||||
"lastTuning": "Drop D",
|
||||
})
|
||||
assert r.status_code == 200
|
||||
body = client.get("/api/plugins/tuner/config").json()
|
||||
assert "legacy-entry" not in body["disabledTunings"]
|
||||
assert "guitar-6:Drop D" in body["disabledTunings"]
|
||||
assert "bass-4:Standard" in body["disabledTunings"]
|
||||
assert "disabledTunings" not in body
|
||||
assert "showFloatingButton" not in body
|
||||
assert body["lastTuning"] == "Drop D"
|
||||
saved = json.loads((config_dir / "tuner.json").read_text())
|
||||
assert "disabledTunings" not in saved
|
||||
assert "showFloatingButton" not in saved
|
||||
|
||||
def test_custom_tuning_old_format_migrated_on_read(self, client, config_dir):
|
||||
(config_dir / "tuner.json").write_text(json.dumps({
|
||||
|
||||
Reference in New Issue
Block a user