Fixes the Report-a-Bug flow producing a GitHub "request URL too long" error by budgeting truncation against the actual encoded URL GitHub receives instead of the raw diagnostics body length.
- Replace the raw BUG_URL_BODY_CAP (5500 chars) with BUG_URL_MAX_ENCODED (8000 chars), measured against the final GitHub issue URL (base URL + ?body= + encodeURIComponent(body)).
- Add buildBugReportIssueUrl() which binary-searches the largest body prefix (by code point) whose encoded URL still fits the budget, appending a truncation marker when needed.
- doReportBug now calls buildBugReportIssueUrl(body) instead of manually slicing the body and encoding it inline.
- Update tests to assert the final URL length stays under BUG_URL_MAX_ENCODED and to exercise a diagnostics bundle whose JSON (quotes/braces) expands significantly under percent-encoding.
Files changed:
.../__tests__/SystemControlsArea.test.tsx | 9 +++--
.../command-center/areas/SystemControlsArea.tsx | 47 +++++++++++++++++-----
2 files changed, 44 insertions(+), 12 deletions(-)
Fusion-Task-Id: FN-7890
Fusion-Task-Lineage: fcadafcd-0bbc-4c06-b2ec-c2b124d736db
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>