From 344e0df697e17f752d11cbf535674fa45c8968fb Mon Sep 17 00:00:00 2001 From: Akash Dhruv Date: Wed, 17 Jun 2026 17:06:38 -0500 Subject: [PATCH 1/4] updates for webview fixes --- .../Webview/modern_static/build_page.py | 26 +- .../Webview/modern_static/generator.py | 2 +- .../Webview/modern_static/html_utils.py | 2 + .../backend/Webview/modern_static/style.css | 291 ++++++++++++++---- 4 files changed, 239 insertions(+), 82 deletions(-) diff --git a/FlashXTest/backend/Webview/modern_static/build_page.py b/FlashXTest/backend/Webview/modern_static/build_page.py index c66f6ad..e7f0147 100644 --- a/FlashXTest/backend/Webview/modern_static/build_page.py +++ b/FlashXTest/backend/Webview/modern_static/build_page.py @@ -3,9 +3,11 @@ """ import html +import os import re from pathlib import Path from typing import List, Dict +from urllib.parse import quote as url_quote from .html_utils import page_header, page_header_nobody, page_footer @@ -23,7 +25,7 @@ def generate_build_page_frameset(site_name: str, inv_name: str, build_name: str) def generate_left_frame_html( - site_name: str, inv_name: str, build_name: str, build_dir: Path + site_name: str, inv_name: str, build_name: str, build_dir: Path, build_output_dir: Path ) -> str: """Return HTML for the left frame listing structured sections for a build.""" title = f"{site_name} – {inv_name} – {build_name}" @@ -39,14 +41,17 @@ def generate_left_frame_html( + f"{html.escape(inv_name)}" ) + def _rel_href(file: Path) -> str: + return url_quote(os.path.relpath(file, build_output_dir), safe="/") + # invocation files lines.append("") # Setup @@ -58,7 +63,7 @@ def generate_left_frame_html( call_text = sc.read_text().strip() if so.is_file(): lines.append( - f'
  • {html.escape(call_text)}
  • ' + f'
  • {html.escape(call_text)}
  • ' ) else: lines.append(f"
  • {html.escape(call_text)}
  • ") @@ -73,15 +78,11 @@ def generate_left_frame_html( lines.append("

    Compilation

    ") lines.append("") if ct.is_file(): lines.append( @@ -138,8 +139,7 @@ def generate_left_frame_html( lines.append("") def _process_li_line(file: Path) -> str: - """A Helper function to build string for a list item.""" - return f'
  • {html.escape(file.name)}
  • ' + return f'
  • {html.escape(file.name)}
  • ' lines.append("