Commit Graph

63 Commits

Author SHA1 Message Date
Falkan
6a9ecf9d46 fix: custom tooltip (no wiggle required), add ⓘ indicator for described units
- Replace native title-based tooltip with custom positioned div
  Native title only renders on mousemove; custom div fires on mouseenter
  after 500ms delay as intended
- Tooltip styled dark with fade-in; Dan Mode gets yellow-on-black with magenta glow
- Units with descriptions show a small superscript ⓘ on the result label
2026-03-18 19:33:14 -04:00
Falkan
6e38522a89 feat: domain-based branding (humorunits.com / dickloads.com)
- src/lib/brand.ts: Brand config map, getBrand() reads hostname server-side
- src/routes/+layout.server.ts: new, passes brand to layout
- +layout.svelte: site name and footer driven by brand config
- humorunits.com footer: 'invented conversions for ridiculous people'
- dickloads.com footer: placeholder (pending Shannon's pick)
2026-03-18 19:27:49 -04:00
Falkan
b1a5586c25 fix: checkbox alignment, wording, and Dan Mode drag handle contrast 2026-03-18 19:13:48 -04:00
Falkan
d088e61006 feat: two-pass description placeholder resolver with cycle handling
Pass 1 resolves all field tokens ({id}, {id:label}, {id:plural}, {id:symbol})
and replaces {id:description} tokens with sentinels.
Pass 2 replaces sentinels with Pass 1 output for the referenced id — one level
deep, so mutual references expand once then stop cleanly.

ConverterCard now uses resolveAllDescriptions() for efficiency (one map
build per reactive update instead of per-unit).
2026-03-18 17:37:00 -04:00
Falkan
998cda0bb3 feat: hidden flag, description placeholders, drag handle contrast fix
- Unit and Group get hidden?: boolean — filtered server-side before render
- Hidden group also suppresses all its units from the converter
- New resolveDescription() utility in src/lib/description.ts
  supports {id}, {id:label}, {id:plural}, {id:symbol} placeholders
- ConverterCard pre-resolves descriptions and passes result to ConversionResult
- ConversionResult accepts description prop instead of reading unit.description
- Admin forms: Hidden checkbox added for both units and groups
- drag-handle color overridden to --pico-primary-inverse on selected/drag-over rows
  (white in light/dark themes, black on Dan Mode yellow)
2026-03-18 16:53:34 -04:00
Falkan
9d56d2ed46 Revert "fix: replace braille glyph drag handle with SVG grip icon"
This reverts commit 21f1f6baaa.
2026-03-18 16:34:48 -04:00
Falkan
21f1f6baaa fix: replace braille glyph drag handle with SVG grip icon 2026-03-18 16:26:39 -04:00
Falkan
5ed392a2d4 fix: template literal quotes in fetch calls; a11y roles on drag elements 2026-03-17 20:52:44 -04:00
Falkan
3598a2dd25 fix: all admin client-side fetches and redirects use configured adminPath 2026-03-17 20:49:38 -04:00
Falkan
e655204064 fix: block direct /admin access when custom adminPath is configured 2026-03-17 20:45:07 -04:00
Falkan
c044f98aa6 feat: adminPath from config.json rewrites route at startup via reroute hook 2026-03-17 20:40:38 -04:00
Falkan
51f047df3e revert: undo adminPath routing attempts — clean slate for restart 2026-03-17 20:39:51 -04:00
Falkan
3a256ccef5 fix: adminPath reroute — move to hooks.ts universal hook, read config.json directly 2026-03-17 20:36:12 -04:00
Falkan
9e9040d998 feat: adminPath in config.json now drives actual route rewriting via server hook 2026-03-17 20:30:56 -04:00
Falkan
e7752ad4ca fix: results grid uses auto-fill minmax so columns scale with available space 2026-03-17 20:18:19 -04:00
Falkan
ae6a073b7e feat: two-line cards, responsive grid, real uniform font size
- ConversionResult: already two-line layout (value + label/symbol)
- app.css: responsive grid (1/2/3 cols at <480/480-899/≥900px)
- uniformFontSize.ts: JS-measured uniform font size per grid
- config.ts: remove MIN_COLUMN_WIDTH, grid is now CSS-only
- BACKLOG.md: remove resolved 'allow renaming unit/group IDs' item

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 20:17:09 -04:00
Falkan
af83263520 feat: two-line cards, responsive grid, real uniform font size 2026-03-17 20:13:57 -04:00
Falkan
b2adcf05ca feat: bulk delete action with confirmation in admin panel 2026-03-17 20:02:48 -04:00
Falkan
192e852a8c feat: add text-decoration underline to bulk-clear button hover 2026-03-17 20:01:18 -04:00
Falkan
a5d0e988f8 feat: auto-ID generation from label with kebab conversion 2026-03-17 20:00:53 -04:00
Falkan
1317f5e8fb feat: per-group sort order (defined/alpha) in group form and converter 2026-03-17 19:59:02 -04:00
Falkan
6d72242aaa feat: drag-to-reorder groups and units with PUT /admin/api/order 2026-03-17 19:58:17 -04:00
Falkan
c1279c3757 feat: auto-save dirty form guard with field-error highlighting 2026-03-17 19:56:39 -04:00
Falkan
15b763e062 feat: unit descriptions with tooltip action and admin textarea 2026-03-17 19:55:09 -04:00
Falkan
9a8b82eca5 docs: backlog — admin UI for YOLO mode label/description config 2026-03-17 19:51:09 -04:00
Falkan
e2e53ca44a feat: YOLO toggle inline layout; yoloLabel/yoloDescription configurable via config.json 2026-03-17 19:50:59 -04:00
Falkan
78e24017a7 fix: uncontrolled input — stop re-setting value prop on every keystroke, killing focus 2026-03-17 19:27:07 -04:00
Falkan
d2045b7a00 Added some units. 2026-03-17 19:14:13 -04:00
Falkan
b14ae55432 docs: backlog — unit ID rename, descriptions/tooltips, sort order, drag reorder, unsaved-form guard 2026-03-17 19:04:52 -04:00
Falkan
3ff98dff9c docs: backlog — allow renaming group IDs with cascaded reference updates 2026-03-17 18:35:33 -04:00
Falkan
f43f415cfa fix: translate __orphan__ sentinel to null in bulk move; ungrouped units now fully bulk-operable 2026-03-17 18:32:03 -04:00
Falkan
91398174e6 docs: log three backlog improvements 2026-03-17 18:31:23 -04:00
Falkan
ccd25a14fe docs: add BACKLOG.md for non-blocking bugs and improvements 2026-03-17 18:02:34 -04:00
Falkan
e4a989046f docs: correct ghost button hover gotcha — must override CSS vars, not just color 2026-03-17 18:01:12 -04:00
Falkan
6e992bbfae fix: bulk-clear hover — override Pico CSS vars not just color property 2026-03-17 18:00:52 -04:00
Falkan
221dd57deb docs: document plain button hover invisibility gotcha in PICO_CSS.md 2026-03-17 17:58:10 -04:00
Falkan
670833ffa2 fix: bulk-clear hover invisible in light/Dan mode (Pico [role=button] override) 2026-03-17 17:57:14 -04:00
Falkan
7cdb84a4f3 refactor: bulk bar — stable layout, disabled not hidden, stacked group row 2026-03-17 16:22:45 -04:00
Falkan
10d94d676b refactor: bulk bar — two-row layout, better contrast, controls only when active 2026-03-17 16:14:37 -04:00
Falkan
ac6af9e90d refactor: admin left panel — wider, less cluttered, persistent bulk action bar
- Left panel widened to 340px (was 280px)
- Removed redundant edit pencil icons from unit rows — clicking the row selects it
- Group names truncate with ellipsis instead of wrapping
- Added select-all/none checkbox per group header (with indeterminate state)
- Bulk action bar is now persistent at top of left panel, always visible
- Bulk actions use two-dropdown pattern: Action (Move to group) → Target group
- 'Add unit' text shortened to '+ Add unit', no more wrapping
- Delete-group orphan label clarified: 'Delete group only — keep units as Ungrouped'
2026-03-17 15:45:11 -04:00
Falkan
c2179b69cc chore: normalize units.json formatting (no data change) 2026-03-17 14:24:55 -04:00
Falkan
aeeae1e7ce refactor: simplify admin code — extract shared helpers, fix quality issues
- Extract KEBAB_RE, SESSION_COOKIE, SESSION_MAX_AGE_MS, COOKIE_MAX_AGE,
  authRequest(), and sessionResponse() to auth.ts — eliminating 4 copies
  of the auth() wrapper and 3 copies of KEBAB_RE across admin API routes
- Remove timing side-channel: drop a.length !== b.length early-return
  before timingSafeEqual in verifySession (SHA-256 HMAC always 64 chars)
- Fix YOLO localStorage write-before-read race using initialization guard
- Fix admin layout /api/ bypass to return {} instead of {authenticated:true}
- Extract extractError() helper in admin page — removes 4 inline patterns
- Parallel Promise.all in admin loadData() — halves round-trip latency
- Parallel Promise.all in moveCheckedUnits() + surface per-request errors
- Hoist Big(inputValue) above .map() in converter — one alloc per recompute
- O(n) single-pass orderedResults using Map instead of O(n*groups) filters
- Fix expandedGroups.add() mutation — use Set assignment for consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 14:04:33 -04:00
Falkan
d1f51c141e feat: admin page with dynamic converter loading
Implements full admin interface for managing units and groups.
Migrates converter from static imports to server-side data loading.

- Switch adapter-static → adapter-node
- Add bcryptjs session auth with HMAC-signed cookies
- Add data/units.json and data/config.json data layer
- Add atomic file writes via temp-file rename
- Add public GET /api/units endpoint
- Add auth-gated admin CRUD API for units and groups
- Add two-panel admin UI with group tree and edit forms
- Add YOLO mode toggle for cross-group conversions
- Add visual group dividers in converter results grid
- Update ResultItem type for nullable convertedValue and isYolo flag
- Group deletion supports reassign/orphan with toBase recalculation

Rollback point: 067fd44

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 13:55:11 -04:00
Falkan
067fd445ef chore: track MEMORY directory 2026-03-17 13:22:32 -04:00
Falkan
5280a5dc61 tweak: slow Dan Mode banner blink to 1.2s 2026-03-17 11:36:22 -04:00
Falkan
04a6d00549 feat: DAN MODE ACTIVATED banner (blinking), cycle order light→dark→dan 2026-03-17 11:35:49 -04:00
Falkan
7cc893d48f feat: Dan Mode v2 — no grey anywhere, maximum neon
- Override --pico-box-shadow (had grey rgba values) with pure magenta/yellow glow
- Article/card: white bg, magenta border, yellow+magenta box-shadow
- Inputs/selects: yellow bg, magenta border, blue text (!important to beat Pico specificity)
- Dropdown: yellow bg, magenta border
- Footer: yellow bg, magenta border, red text
- Sharp corners (--pico-border-radius: 0) for brutalist aesthetic
- Hotkey hint: magenta
- Nav hover: red
- Header: yellow + red drop-shadow
2026-03-17 11:33:29 -04:00
Falkan
da99b63916 feat: Dan Mode (third theme), Pico CSS notes, cycle theme toggle
Dan Mode: pure white backgrounds, electric blue text (#0000ff), nuclear
yellow accents (#ffff00), hot magenta borders (#ff00ff), red labels,
glowing box-shadows. Maximum saturation. Hostile to human vision by design.

Theme toggle now cycles light → dark → dan → light (icons: 🌙 😎 ☀️).

PICO_CSS.md: documents [role=button] color clobber, palette scoping rules,
and theme toggling pattern for future reference.
2026-03-17 11:28:42 -04:00
Falkan
0f648ab9b8 fix: correct invisible text in result tiles (light mode)
Root cause: .result-tile has role="button", which triggers Pico's button
rule setting --pico-color: var(--pico-primary-inverse) = #fff in light mode.
Text inherited this white color, invisible on white card backgrounds.

Fix: override --pico-color: initial and set explicit color: var(--pico-contrast)
on .result-tile. --pico-contrast is #181c25 in light mode and #dfe3eb in dark —
both legible against their respective card backgrounds.
2026-03-17 11:19:00 -04:00
Falkan
510e61a553 fix+feat: fix invisible result values, inline symbol into label
Fix: .result-value was using color: var(--pico-color) which broke when
our custom palette variables weren't in scope. Now inherits body color —
Pico handles light/dark correctly without us needing to re-assert it.

Feat: unit symbol merged inline into label as 'Blurbs (bl)', replacing
the separate third line. Removes .result-symbol CSS rule. Cards are
shorter and less cluttered.
2026-03-17 11:00:38 -04:00