From 39eb942b1bf4a27c7da5a25df2d3088572434f68 Mon Sep 17 00:00:00 2001
From: pgotta <168211683+pgotta@users.noreply.github.com>
Date: Tue, 21 Jul 2026 09:15:13 -0400
Subject: [PATCH 01/17] Add isolated musician tools injector
---
app/tools_ui.py | 45 +++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 app/tools_ui.py
diff --git a/app/tools_ui.py b/app/tools_ui.py
new file mode 100644
index 0000000..8d873a7
--- /dev/null
+++ b/app/tools_ui.py
@@ -0,0 +1,45 @@
+"""Inject Stemmy's optional musician tools without modifying the main studio template.
+
+Keeping the tuner and chord creator in isolated static files makes the feature easy
+to remove or revise and avoids coupling it to the large, carefully tuned studio UI.
+"""
+
+from __future__ import annotations
+
+from flask import Flask
+
+
+_CSS_TAG = (
+ ''
+)
+_JS_TAG = (
+ ''
+)
+
+
+def install_tools(app: Flask) -> Flask:
+ """Attach the tuner/chord-creator UI to HTML responses exactly once."""
+
+ @app.after_request
+ def _inject_musician_tools(response):
+ if response.status_code != 200 or response.direct_passthrough:
+ return response
+ content_type = response.headers.get("Content-Type", "")
+ if "text/html" not in content_type:
+ return response
+
+ html = response.get_data(as_text=True)
+ if 'data-stemmy-tools="js"' in html:
+ return response
+ if "" not in html or "