feat: feedback with photo support + web dashboard feedback button
All checks were successful
Security Checks / dependency-audit (push) Successful in 15s
Security Checks / secret-scanning (push) Successful in 4s
Security Checks / dockerfile-lint (push) Successful in 5s

iOS:
- Photo picker in feedback sheet (screenshot/photo attachment)
- Image sent as base64, uploaded to Gitea issue as attachment

Web:
- Feedback button in sidebar rail
- Modal with text area + send
- Auto-labels same as iOS

Gateway:
- Multipart image upload to Gitea issue assets API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 13:31:20 -05:00
parent 557bd80174
commit 96fa49fae2
4 changed files with 198 additions and 4 deletions

View File

@@ -98,10 +98,39 @@ def handle_feedback(handler, body, user):
)
resp = urllib.request.urlopen(req, timeout=10)
result = json.loads(resp.read())
issue_number = result.get("number")
# Upload image attachment if provided
image_b64 = data.get("image")
if image_b64 and issue_number:
import base64
try:
img_bytes = base64.b64decode(image_b64)
boundary = "----FeedbackBoundary123"
body_parts = []
body_parts.append(f"--{boundary}\r\n".encode())
body_parts.append(b'Content-Disposition: form-data; name="attachment"; filename="screenshot.png"\r\n')
body_parts.append(b"Content-Type: image/png\r\n\r\n")
body_parts.append(img_bytes)
body_parts.append(f"\r\n--{boundary}--\r\n".encode())
multipart_body = b"".join(body_parts)
img_req = urllib.request.Request(
f"{GITEA_URL}/api/v1/repos/{REPO}/issues/{issue_number}/assets",
data=multipart_body,
headers={
"Authorization": f"token {GITEA_TOKEN}",
"Content-Type": f"multipart/form-data; boundary={boundary}",
},
method="POST",
)
urllib.request.urlopen(img_req, timeout=15)
except Exception as img_err:
pass # Image upload failed but issue was created
handler._send_json({
"ok": True,
"issue_number": result.get("number"),
"issue_number": issue_number,
"url": result.get("html_url"),
})
except Exception as e: