Skip to content

refactor(ui): consolidate formatters, print-stream tokens, toasts and downloads - #31

Merged
hexjasur merged 10 commits into
masterfrom
refactor/dry-print-stream-cleanup
Nov 28, 2026
Merged

hexjasur merged 10 commits into
masterfrom
refactor/dry-print-stream-cleanup

Conversation

@hexjasur

Copy link
Copy Markdown
Owner

Summary

Consolidates duplicated result formatters, moves off-palette colors to theme tokens, rebuilds all Open Graph images in the light print-stream style, shows BVP/Galerkin errors as toasts, and adds a Download page that serves the latest GitHub release.

Changes

  • Shared number formatters in lib/format.ts; removed an unused notebook generator from Euler.
  • Replaced Tailwind amber/indigo/emerald/red utilities and the hardcoded Euler blue with brand, cyan, pos, neg tokens.
  • Rewrote scripts/generate-og-images.ts (English method names, light theme) and regenerated all OG PNGs.
  • Global ToastProvider (max two visible toasts, oldest closes first, rotating gradient border). BVP and Galerkin errors use it.
  • BVP equation hint now uses y'' - x y' + 2x y = 0.8.
  • New /download page: reads the latest release, detects the platform, offers the matching installer. Linked from the nav and the About page.

Testing

  • bun run lint: passes.
  • bun run build: passes.
  • Numeric parity: 85 calculator and formatter cases produced before and after the refactor; only difference is the formatLagrange default-digits case, and all call sites now pass digits explicitly.
  • bunx tsc --noEmit: one pre-existing error in components/app-shell.tsx (@/public/logo.webp module type); not introduced here.
  • Not checked: visual review of toasts, OG images at full size in social previews, and the Download page in a browser (macOS build is not in the current release, so that card shows the fallback).

Notes

  • Base: master.
  • The Download page fetches api.github.com from the browser; if that fails it falls back to the releases page.

Generated by Claude Code

generateNotebookText had no callers in the app. Removing it does not
change any calculation output.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
Bisection and Simpson share formatFixed (toFixed). Trapezoid, Newton,
Rectangles and Lagrange share formatTrimmed (toFixed + trailing zeros
removed). Sweep keeps its negative-zero handling as formatTrimmedSigned.

Call sites pass digits explicitly where the old default differed, so
displayed values are unchanged.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
Replace Tailwind amber/indigo/emerald/red utilities and the hardcoded
Euler blue with the existing brand, cyan, pos and neg tokens so light
and dark themes stay consistent. Updater splash screen is unchanged.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
Regenerate every method card from scratch: light theme tokens, large
English method names, Uzbek subtitle, MathJax formula panel. The
generator no longer uses the dark palette.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
Global ToastProvider shows short-lived error and success messages at the
top of the screen. The gradient border rotates as a live cue and stops
when the user prefers reduced motion.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
Errors and parse notices were rendered at the bottom of the form, where
they were easy to miss. They now appear as toasts. The equation hint
uses y'' - x y' + 2x y = 0.8.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
A third toast now replaces the oldest one instead of stacking three.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
Input and solver errors now use the shared toast instead of the inline
note below the form.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
New /download page reads the latest GitHub release, detects the visitor's
platform and offers the matching installer, with all platforms listed.
Also adds a Download entry to the navigation and the locale strings.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014R1cEN52FNk9xt68YzjQae
@vercel

vercel Bot commented Nov 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
numeric-methods Ready Ready Preview Nov 28, 2026 2:42pm UTC

@hexjasur hexjasur added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels Nov 28, 2026
@hexjasur
hexjasur merged commit d052430 into master Nov 28, 2026
5 checks passed
@hexjasur
hexjasur deleted the refactor/dry-print-stream-cleanup branch November 28, 2026 14:51

This branch was successfully deployed

1 active deployment
Preview — 002762e5 Deployed Nov 28, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants