Skip to content

feat: Base64 error toasts, multi-line input, and multi-format timestamp conversion#2

Merged
slhmy merged 2 commits intomainfrom
copilot/support-multi-format-timestamp-conversion
Apr 16, 2026
Merged

feat: Base64 error toasts, multi-line input, and multi-format timestamp conversion#2
slhmy merged 2 commits intomainfrom
copilot/support-multi-format-timestamp-conversion

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 16, 2026

Base64 decode errors were silently swallowed with only an inline text hint. Timestamp conversion only emitted Unix seconds with no support for milli/nanosecond inputs or outputs.

Base64

  • Swapped inline error state for sonner toast notifications (toast.error(...)) on encode/decode failure
  • Replaced single-line <Input> with <Textarea rows={6}> for both input and output — handles multi-line plaintext and wrapped Base64
  • Added src/components/ui/textarea.tsx styled to match the existing Input component

Timestamp

  • Auto-detects input unit by digit length: ≤10 → seconds, ≤13 → milliseconds, >13 → nanoseconds
  • Both conversion directions now emit all four formats via a shared TimestampResultTable component:
Label Example
ISO 8601 2023-11-14T22:13:20.000Z
Unix (s) 1700000000
Unix Milli (ms) 1700000000000
Unix Nano (ns) 1700000000000000000
  • Nanosecond output uses BigInt arithmetic (BigInt(ms) * 1_000_000n) to avoid float precision loss beyond Number.MAX_SAFE_INTEGER

App

  • Added <Toaster richColors /> from sonner outside the router, wrapped in a fragment

@slhmy slhmy marked this pull request as ready for review April 16, 2026 04:15
@slhmy slhmy merged commit f178461 into main Apr 16, 2026
4 checks passed
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.

2 participants