Skip to content

feat: Open text assets in code editor#5918

Merged
kof merged 47 commits into
mainfrom
feat/text-file-editor
Jul 20, 2026
Merged

feat: Open text assets in code editor#5918
kof merged 47 commits into
mainfrom
feat/text-file-editor

Conversation

@kof

@kof kof commented Jul 18, 2026

Copy link
Copy Markdown
Member

What changed

  • open every textual asset type from the upload registry in an editable CodeMirror dialog
  • select installed CodeMirror language support by MIME type and use plain text editing as the fallback
  • support txt, csv, md, js, css, json, html, xml, and svg without adding asset-specific language branches to the shared editor
  • keep the canvas mounted and interactive behind the dialog
  • persist edits on blur, Cmd/Ctrl+S, or Cmd/Ctrl+Enter through the asset replacement pipeline
  • preserve folder and description metadata and repoint supported asset references
  • clean up failed replacement uploads instead of leaving orphan assets

Impact

Users can open, edit, and persist all text-based upload formats directly in the builder without replacing or reloading the canvas. New text/* upload types will automatically become editable as plain text; installed syntax support is selected by MIME type.

Validation

  • pnpm --filter @webstudio-is/builder test -- app/builder/features/text-file-editor/text-file-utils.test.ts app/builder/shared/assets/replace-asset.test.ts app/builder/shared/asset-manager/asset-manager.test.tsx
  • pnpm --filter @webstudio-is/builder typecheck
  • pnpm exec oxlint --deny-warnings <changed files>
  • pnpm exec oxfmt --check <changed files>
  • git diff --check
  • verified the running dev server applied the changes through Vite HMR

Ref #5824

kof added 30 commits July 20, 2026 11:28
@kof kof closed this Jul 20, 2026
@kof kof mentioned this pull request Jul 20, 2026
29 tasks
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.

1 participant