Skip to content

UI modernization - #89

Merged
BuczynskiRafal merged 19 commits into
mainfrom
ui-modernization
Sep 30, 2026
Merged

BuczynskiRafal merged 19 commits into
mainfrom
ui-modernization

Conversation

@BuczynskiRafal

Copy link
Copy Markdown
Owner

No description provided.

The pages load Bootstrap 5 CSS, but forms were rendered with the
bootstrap4 pack.
rainfall and infiltration_loss are in mm/h (in/h), evaporation_loss in
mm/day (in/day), runoff and runon in the model's FLOW_UNITS.
Secure cookies now default to on only when DEBUG is off: Safari drops
Secure cookies over plain HTTP, so every POST on the dev server failed
the CSRF check. Explicit settings still win.
A backend replacing ModelBackend accepts a username or an email,
ignoring case, and refuses an email shared by two accounts. Registration
rejects an email that is already in use and logs the new user in.
Bootstrap 5.3 with SRI, design tokens and components, a light/dark/auto
theme without a flash of the wrong one, a sticky navbar with a mobile
toggler, an account menu, a skip link and toasts. Vendor scripts load
only on the pages that use them. Replaces base.css and base_ui.js.
window.CS.charts replaces the global render functions; the pages move to
it in the commits that follow.
Without JavaScript the form posts and comes back with a flash message.
The upload view runs its CSRF check after installing the size-limit
handler, which fixes a 500 on real uploads. The zone shows the current
model with its subcatchment count and announces cs:model-changed.
Runs are sent with fetch and answered with a results fragment rendered
from the same partial as the full page; failures come back as {message,
field_errors} JSON without flash messages, and the no-JS path keeps
working. Adds a live range hint, a sortable results table and summary
tiles.
Single runs plot rainfall as inverted bars over the runoff hydrograph;
sweeps use a sequential colour ramp. Evaporation is labelled in mm/day,
as SWMM reports it.
Parity and per-subcatchment charts with MAE, RMSE and mean % error.
SWMM's TotalRunoffMG (10^6 L or 10^6 gal) is converted to m3/ft3 before
the comparison. Running a comparison requires login and follows
Post/Redirect/Get.
Loading or clearing a model drops the saved form values, the cached
subcatchment IDs and each tool's cached result, so results are never
shown next to a model they were not computed from.
The hero hydrograph and the sweep charts are precomputed from
data/example.inp by data/build_home_data.py (the old data came from
another model), and a test keeps them in sync.
Contact redirected to a URL name that does not exist and reported
success even when sending failed; the profile form listed every account
and accepted another user's id. The interface text is now consistently
English.
The in-memory cache was emptied by every runserver autoreload and was
separate for each gunicorn worker. Results now live in a file-based
cache (DJANGO_CACHE_DIR) for 12 hours, and loading content identical to
the session's model keeps its results.
Brand, links and tools sit on a three-column grid, so the links are on
the page's centre line; between 992 and 1199px the wordmark stacks on
two lines so the auth buttons do not wrap.
@BuczynskiRafal BuczynskiRafal self-assigned this Sep 30, 2026
@gitguardian

gitguardian Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Resolve the views.py conflict with the helper extraction from #82 and #83.
The branch had rewritten the run views, the upload flow and the
comparison, so those keep the branch's code; #83's concise docstrings,
%-style logging, _get_download_payload, _file_too_large_message,
_timestamp_suffix and the profile form helpers are kept. Helpers the
branch replaced (the example.inp fallback, the upload session reset,
_store_result_payload_for_user, the timeseries defaults) are dropped,
and _store_upload removes the previous upload again, which #82 had
moved into one of them.
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.71%. Comparing base (b65648f) to head (d3e8ca1).

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #89   +/-   ##
=======================================
  Coverage   98.71%   98.71%           
=======================================
  Files           4        4           
  Lines         233      233           
=======================================
  Hits          230      230           
  Misses          3        3           

☔ 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.

Without JavaScript nothing holds DOMContentLoaded back for the
stylesheets, so the timeseries page first lays out unstyled (the header
is 346px tall) and shifts once Bootstrap arrives. The run button sits
below the fold there, and on CI, where the runner does not prefer
reduced motion, Bootstrap's smooth scrolling left the click finding it
outside the viewport until the 30s timeout. The no-JS contexts now
prefer reduced motion and wait for the stylesheets and fonts first.
Playwright subscribes to file choosers without waiting for the browser
to start intercepting them, so on a slow runner the key pressed right
after expect_file_chooser() could open a native dialog Playwright never
saw. The test now listens before navigating to the page.
@BuczynskiRafal
BuczynskiRafal merged commit c2b1135 into main Sep 30, 2026
24 checks passed
@BuczynskiRafal
BuczynskiRafal deleted the ui-modernization branch September 30, 2026 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant