Skip to content

Improve Script Editor resource browsing and previews (UI/UX improvement) - #1758

Merged
CodFrm merged 2 commits into
scriptscat:mainfrom
cyfung1031:codex/improve-script-editor-resources
Sep 28, 2026
Merged

CodFrm merged 2 commits into
scriptscat:mainfrom
cyfung1031:codex/improve-script-editor-resources

Conversation

@cyfung1031

@cyfung1031 cyfung1031 commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Checklist / 检查清单

  • Fixes mentioned issues / 修复已提及的问题
  • Code reviewed by human / 代码通过人工检查
  • Changes tested / 已完成测试

N/A — No issue was supplied for this change.

Description / 描述

  • Clarifies resource identity: @resource keeps its declared name; @require and @require-css show a basename derived from the source URL, with the full URL visible and searchable.
  • Adds a lazy View dialog that reads only ScriptCat’s cached resource chunk. Text stays inert, raster previews use a cleaned-up object URL, and automatic preview is capped at 1 MiB; Download remains available for large and unsupported content.
  • Preserves the Resources/DataPanel layout and adds an accessible View action with mobile-sized hit targets. New labels are present in all ten locales.

Screenshots / 截图

resources-pr-contact-sheet

Validation

  • Focused Vitest suites: 35 tests passed.
  • pnpm run typecheck, pnpm run check:i18n, and pnpm run lint passed.
  • pnpm run build completed with the existing bundle-size and Monaco dynamic-require warnings.
  • Browser verification covered resource identity/search, cached text preview, inert HTML/SVG, large and unsupported states, raster image preview, mobile layout, and a completed download. The captured console also contains setup-time 404s before the throwaway profile’s favicon service was disabled and a router warning after direct hash navigation; the headed download session’s console was not captured.
  • pnpm run test:e2e was not run as explicitly requested.

@cyfung1031 cyfung1031 changed the title Improve Script Editor resource browsing and previews Improve Script Editor resource browsing and previews (UI/UX improvement) Sep 21, 2026
@cyfung1031

cyfung1031 commented Sep 21, 2026 •

Copy link
Copy Markdown
Collaborator Author
Screenshot 2026-09-21 at 17 24 09 Screenshot 2026-09-21 at 17 24 41 Screenshot 2026-09-21 at 17 26 38 Screenshot 2026-09-21 at 17 26 27

感覺不錯。

@CodFrm

CodFrm commented Sep 22, 2026 •

Copy link
Copy Markdown
Member

看起来还可以

代码/文本/json可以用monaco,体验好点

@cyfung1031

cyfung1031 commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

看起来还可以

代码/文本/json可以用monaco,体验好点

主要想简单点
能用就够
(不是主要功能,也不让用家去编辑。只是简单能打开看看)

你要复杂点也可以。你再调整吧

@cyfung1031 cyfung1031 added the P2 🐌 非重要也不紧急的内容 label Sep 22, 2026
@CodFrm

CodFrm commented Sep 28, 2026

Copy link
Copy Markdown
Member

看起来还可以
代码/文本/json可以用monaco,体验好点

主要想简单点 能用就够 (不是主要功能,也不让用家去编辑。只是简单能打开看看)

你要复杂点也可以。你再调整吧

只读,不然搜索起来还是挺麻烦的,纯文本阅读也不友好

按 MIME 类型(不够具体时按扩展名)选择语法高亮语言;构建未打包 CSS/HTML worker,
在 registerEditor 中关闭这两类语言服务,避免 editor.worker 加载外部模块失败抛错,保留 Monarch 高亮。
@CodFrm
CodFrm merged commit 56ec5d3 into scriptscat:main Sep 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 🐌 非重要也不紧急的内容

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants