fix architectural issues: SPA nav, error handling, CSS bugs, perf

- responsive.js: fix scroll race condition (scroll after innerHTML),
  add error handling for fetch failures, fix implicit global `eid`,
  dispatch `beforenavigate` event for cleanup hooks
- chessbed.js: fix implicit global `ratings` variable
- status.js: clear polling interval on SPA navigation via
  `beforenavigate` event to prevent leak
- App.css: add font-display:swap to all @font-face, fix broken
  media query (missing px unit), consolidate duplicate selectors
  (.concentratedHead, .relative, strong), fix hardcoded bookshelf
  background-image path to use relative URL
- header.html: defer chessbed.js, use p5.min.js instead of p5.js
- monitor.py: use ThreadPoolExecutor for concurrent service checks
- config.py: fix __import__('envs.py') → __import__('envs')
- app.py: rename misleading error handlers (page404→handle_http_error,
  page500→handle_generic_error), fix error info leakage by not passing
  raw exception to InternalServerError, fix hardcoded canonical "404"

https://claude.ai/code/session_01FUhPqQLahEoL6FMxhXkDKa
This commit is contained in:
Claude
2026-02-12 14:39:43 +00:00
parent 9b6e29a15c
commit c8b1f124f2
8 changed files with 77 additions and 55 deletions

View File

@@ -60,9 +60,9 @@ def goto(location='home'):
page = None
try:
page = flask.render_template(pagevars["template"], var=pagevars)
except Exception as e:
e = HTTPerror.InternalServerError(None, e)
page = page404(e)
except Exception:
e = HTTPerror.InternalServerError()
page = handle_http_error(e)
return [pagevars, page]
def funcGen(pagename, pages):
@@ -72,7 +72,7 @@ def funcGen(pagename, pages):
except Exception:
e = HTTPerror.InternalServerError()
print(e)
return page404(e)
return handle_http_error(e)
return dynamicRule
for i in pages:
@@ -86,14 +86,14 @@ def resume():
return flask.send_file("./static/Resume_Simonson_Andrew.pdf")
@app.errorhandler(HTTPerror.HTTPException)
def page404(e):
def handle_http_error(e):
eCode = e.code
message = e.description
pagevars = {
"template": "error.html",
"title": f"{eCode} - Simonson",
"description": "Error on Andrew Simonson's Digital Portfolio",
"canonical": "404",
"canonical": f"/{eCode}",
}
return (
flask.render_template(
@@ -107,12 +107,12 @@ def page404(e):
)
@app.errorhandler(Exception)
def page500(e):
def handle_generic_error(e):
pagevars = {
"template": "error.html",
"title": "500 - Simonson",
"description": "Error on Andrew Simonson's Digital Portfolio",
"canonical": "404",
"canonical": "/500",
}
return (
flask.render_template(