Comfy-Org / Comfy-Org/ComfyUI_frontend

feat: strip .app.json extension in stripJsonExtension (or dedicated helper)

Open
#9,451 0 comments 0 reactions 1 assignee Claimed by @christian-byrne View on GitHub
area:workflows
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Summary

The `stripJsonExtension` helper in `src/platform/workflow/sharing/components/ShareWorkflowDialogContent.vue` currently only strips the `.json` extension. It should also handle `.app.json` (and potentially other compound extensions) to correctly derive workflow names.

## Suggested approach

Either extend `stripJsonExtension` to also strip `.app.json`, or introduce a dedicated helper (e.g. `stripWorkflowExtension`) that handles all known workflow file extensions.

```ts
// Current
function stripJsonExtension(filename: string): string {
return filename.replace(/\.json$/i, '')
}

// Proposed
function stripWorkflowExtension(filename: string): string {
return filename.replace(/\.app\.json$/i, '').replace(/\.json$/i, '')
}
```

## Context

Raised during review of PR #8951 (https://github.com/Comfy-Org/ComfyUI_frontend/pull/8951#discussion_r2892540570) by @AustinMroz and @christian-byrne. Agreed to defer to a follow-up App-fix PR.

/cc @christian-byrne

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-9451-feat-strip-app-json-extension-in-stripJsonExtension-or-dedicated-helper-31a6d73d365081eaa6e1d41a0db91eb7) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.