Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions src/features/tool-shell/tool-action-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function getResultAnnouncement(action: ToolAction, result: ToolActionResult | vo
const message = result.message || (result.status === "success"
? formatActionStatus(t.common.action_status_success, action.label, "completed")
: formatActionStatus(t.common.action_status_failed, action.label, "failed"))
return result.description ? `${message}. ${result.description}` : message
return result.description ? `${message}${/[.!?]$/.test(message) ? "" : "."} ${result.description}` : message
}

return formatActionStatus(t.common.action_status_success, action.label, "completed")
Expand Down Expand Up @@ -219,11 +219,16 @@ export function ToolActionBar({
setLastActionStatus((current) => ({ ...current, [action.id]: "pending" }))
setActionAnnouncement(formatActionStatus(t.common.action_status_pending, action.label, "in progress"))
const awaitedResult = await maybeResult
setLastActionStatus((current) => ({
...current,
[action.id]: isActionResult(awaitedResult) ? awaitedResult.status : "success",
}))
setActionAnnouncement(getResultAnnouncement(action, awaitedResult, t))
if (isActionResult(awaitedResult)) {
setLastActionStatus((current) => ({
...current,
[action.id]: awaitedResult.status,
}))
setActionAnnouncement(getResultAnnouncement(action, awaitedResult, t))
} else {
setLastActionStatus((current) => ({ ...current, [action.id]: "idle" }))
setActionAnnouncement("")
}
} catch {
setLastActionStatus((current) => ({ ...current, [action.id]: "failed" }))
setActionAnnouncement(formatActionStatus(t.common.action_status_failed, action.label, "failed"))
Expand Down
2 changes: 1 addition & 1 deletion src/features/tool-templates/focused-hash-tool-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export function FocusedHashToolPage({
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload, disabled: !canDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/ai-color-palette-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function AiColorPaletteGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
4 changes: 2 additions & 2 deletions src/features/tools/barcode-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ export function BarcodeGeneratorPage() {
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "generate", label: toolT.generate_action, icon: Play, onClick: handleGenerate },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "svg", label: "SVG", icon: Download, onClick: handleDownloadSvg, disabled: !canExport },
{ id: "png", label: "PNG", icon: Download, onClick: () => void handleDownloadPng(), disabled: !canExport },
{ id: "png", label: "PNG", icon: Download, onClick: handleDownloadPng, disabled: !canExport },
]

return (
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/bionic-reading-converter/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export function BionicReadingConverterPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "clear", label: t.common.clear, icon: Eraser, onClick: handleClear },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy(), disabled: !output.trim() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy, disabled: !output.trim() },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload, disabled: !output.trim() },
]

Expand Down
9 changes: 5 additions & 4 deletions src/features/tools/certificate-decoder/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,18 @@ export function CertificateDecoderPage() {
try {
const text = await navigator.clipboard.readText()
setPem(text)
} catch { /* ignore */ }
return { status: "success" as const, message: t.common.paste }
} catch {
return { status: "failed" as const, message: t.common.action_disabled_unavailable }
}
}

const actions: ToolAction[] = [
{
id: "paste",
label: t.common.paste,
icon: Clipboard,
onClick: () => {
void handlePaste()
},
onClick: handlePaste,
},
{
id: "clear",
Expand Down
4 changes: 1 addition & 3 deletions src/features/tools/cidr-subnet-calculator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ export function CidrSubnetCalculatorPage() {
label: t.common.copy,
icon: Copy,
disabled: !result,
onClick: () => {
void handleCopySummary()
},
onClick: handleCopySummary,
},
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/color-mixer/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export function ColorMixerPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/color-shades-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function ColorShadesGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function CssBackgroundPatternGeneratorPage() {
id: "copy",
label: t.common.copy,
icon: Copy,
onClick: () => void handleCopy(),
onClick: handleCopy,
},
{
id: "download",
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-border-radius-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function CssBorderRadiusGeneratorPage() {
id: "copy",
label: t.common.copy,
icon: Copy,
onClick: () => void handleCopy(),
onClick: handleCopy,
},
{
id: "download",
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-box-shadow-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function CssBoxShadowGeneratorPage() {
id: "copy",
label: t.common.copy,
icon: Copy,
onClick: () => void handleCopy(),
onClick: handleCopy,
},
{
id: "download",
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-checkbox-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function CssCheckboxGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-clip-path-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export function CssClipPathGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-cubic-bezier-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function CssCubicBezierGeneratorPage() {
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "run", label: toolT.run_action, icon: Play, onClick: () => setRun((v) => !v) },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-glassmorphism-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function CssGlassmorphismGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-gradient-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function CssGradientGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-loader-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function CssLoaderGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-switch-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export function CssSwitchGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function CssTextGlitchEffectGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/css-triangle-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export function CssTriangleGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/devops-yaml-validator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function DevopsYamlValidatorPage() {

const actions: ToolAction[] = [
{ id: "run", label: toolT.validate_action, icon: Play, onClick: run, variant: "default", disabled: !input.trim() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void copyOutput(), disabled: !output },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: copyOutput, disabled: !output },
{ id: "sample", label: t.common.sample, icon: RotateCcw, onClick: () => { setInput(SAMPLE_INPUT); setOutput("") } },
{ id: "clear", label: t.common.clear, icon: Eraser, onClick: () => { setInput(""); setOutput("") } },
]
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/fake-iban-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export function FakeIbanGeneratorPage() {
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "generate", label: toolT.generate_action, icon: Play, onClick: handleGenerate },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload, disabled: items.length === 0 },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/google-fonts-pair-finder/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function GoogleFontsPairFinderPage() {

const actions: ToolAction[] = [
{ id: "shuffle", label: toolT.shuffle_action, icon: RefreshCw, onClick: handleShuffle, disabled: filteredPairs.length === 0 },
{ id: "copy_css", label: toolT.copy_css_action, icon: Copy, onClick: () => void handleCopyCss() },
{ id: "copy_css", label: toolT.copy_css_action, icon: Copy, onClick: handleCopyCss },
]

return (
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/graphql-workbench/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function GraphqlWorkbenchPage() {

const actions: ToolAction[] = [
{ id: "run", label: toolT.format_action, icon: Play, onClick: run, variant: "default", disabled: !query.trim() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void copyOutput(), disabled: !output },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: copyOutput, disabled: !output },
{ id: "sample", label: t.common.sample, icon: RotateCcw, onClick: loadSample },
{ id: "clear", label: t.common.clear, icon: Eraser, onClick: clear },
]
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/http-request-builder/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function HttpRequestBuilderPage() {
id: "copy_code",
label: t.common.copy,
icon: Copy,
onClick: () => void handleCopy(),
onClick: handleCopy,
disabled: !urlValidation.ok,
disabledReason: urlValidation.ok ? undefined : urlValidationMessage,
},
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/image-average-color-finder/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export function ImageAverageColorFinderPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/image-caption-generator/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export function ImageCaptionGeneratorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/image-color-extractor/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function ImageColorExtractorPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/image-color-picker/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export function ImageColorPickerPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/image-cropper/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export function ImageCropperPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy(), disabled: isProcessing },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy, disabled: isProcessing },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload, disabled: isProcessing || !outputDataUrl },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/image-filters/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ export function ImageFiltersPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy(), disabled: isProcessing },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy, disabled: isProcessing },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload, disabled: isProcessing || !outputDataUrl },
]

Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/image-resizer/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export function ImageResizerPage() {
}

const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: () => void handleSample() },
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "clear", label: t.common.clear, icon: Eraser, onClick: handleClear, destructive: true },
{ id: "reset", label: t.common.reset, icon: RotateCcw, onClick: handleReset, destructive: true },
{
Expand Down
2 changes: 1 addition & 1 deletion src/features/tools/instagram-filters/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export function InstagramFiltersPage() {
const actions: ToolAction[] = [
{ id: "sample", label: t.common.sample, icon: TestTube2, onClick: handleSample },
{ id: "reset", label: t.common.reset, icon: Eraser, onClick: handleReset },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: () => void handleCopy() },
{ id: "copy", label: t.common.copy, icon: Copy, onClick: handleCopy },
{ id: "download", label: t.common.download, icon: Download, onClick: handleDownload },
]

Expand Down
Loading