Skip to content

perf: polish the web UI and shrink cold start - #131

Merged
njzjz merged 20 commits into
njzjz:masterfrom
njzjz-bot:agent/web-polish-and-speed
Aug 16, 2026
Merged

perf: polish the web UI and shrink cold start#131
njzjz merged 20 commits into
njzjz:masterfrom
njzjz-bot:agent/web-polish-and-speed

Conversation

@njzjz-bot

@njzjz-bot njzjz-bot commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • redesign the browser UI with a cleaner responsive layout, dark-mode support, example chips, clearer progress, and a better result/copy experience
  • remove the external GitHub ribbon and Prism assets so the page has fewer blocking CDN requests
  • preload the website-local Pyodide bundle and start downloading it in parallel with the Pyodide runtime
  • stream the bundle response and surface real downloaded byte counts in the progress message
  • remove requests, urllib3, certifi, charset-normalizer, and idna from the browser-only bundle by keeping native requests imports off the Emscripten path
  • enforce a < 1,000,000 byte compressed Web bundle budget in CI
  • remove the obsolete browser deprecation notice from the README

Cold-start optimization

The currently deployed Pages bundle is 1,474,423 bytes. CI builds the new bundle at 845,131 bytes (about 825 KiB), a 42.7% reduction. The browser networking path uses pyfetch, so the Requests stack in the old archive was unnecessary. This PR reduces the locked browser dependency set to pyiso4, pylatexenc, and unidecode, while native Python continues to use Requests normally.

The Worker also no longer waits for loadPyodide() to finish before requesting the local bundle. The bundle and Pyodide runtime start downloading together, and HTML preloads the bundle as early as possible. Streamed reads report actual downloaded bytes in the progress UI.

Validation

  • Web unit tests cover streamed bundle progress and verify the bundle request starts before loadPyodide
  • Chromium E2E performs a real DOI lookup with the 845,131-byte bundle and succeeds without contacting PyPI/pythonhosted
  • CI builds the exact browser bundle and rejects it if it reaches 1 MB
  • Python 3.10 and 3.13 tests verify the native Requests path remains functional
  • pre-commit remains part of the required aggregate test workflow
  • Codecov continues to receive separate Web and Python coverage uploads

Agent: ChatGPT
Model: GPT-5.6 Sol

Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
Agent: ChatGPT
Model: GPT-5.6 Sol
@codecov

codecov Bot commented Aug 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.91667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.56%. Comparing base (7d115f4) to head (b76c326).

Files with missing lines Patch % Lines
wenxian/feeder/semanticscholar.py 77.77% 2 Missing ⚠️
wenxian/from_identifier.py 85.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #131      +/-   ##
==========================================
+ Coverage   95.41%   95.56%   +0.14%     
==========================================
  Files          18       18              
  Lines        1200     1285      +85     
==========================================
+ Hits         1145     1228      +83     
- Misses         55       57       +2     
Flag Coverage Δ
python 94.37% <82.35%> (-0.16%) ⬇️
web 99.35% <100.00%> (+0.21%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

pre-commit-ci Bot and others added 3 commits August 16, 2026 16:34
@njzjz
njzjz merged commit 47e3a25 into njzjz:master Aug 16, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants