Repository navigation
Guarantee a utility surface for runtime-installed plugins #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
DianaSensei
merged 3 commits into
main
from
claude/miniapp-container-logs-overflow-szzaje
Sep 22, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| /* ============================================================================ | ||
| Bề mặt utility bảo đảm cho plugin cài từ bên ngoài | ||
| ---------------------------------------------------------------------------- | ||
| Plugin (Settings → Extensions) được build thành MỘT file ESM và **không mang | ||
| CSS của riêng nó** — xem `docs/plugin-sdk/05-external-install.md`. Toàn bộ | ||
| giao diện plugin ăn theo stylesheet này, vốn sinh ra bằng cách quét `src/**` | ||
| của app chủ. Mã nguồn plugin không có mặt lúc app build (nó được tải lúc | ||
| chạy từ một URL), nên trước file này, một class chỉ có trong plugin sẽ nằm | ||
| trong DOM mà **không có rule nào phía sau** — im lặng không làm gì cả. | ||
|
|
||
| Điều đó biến "app chủ có tình cờ dùng class này ở đâu đó không" thành hợp | ||
| đồng API ngầm, và nó đã gãy thật: Container Manager mất `bottom-3` (nút | ||
| "Jump to latest" rơi lên đỉnh khung log), `pl-1.5`/`-ml-1.5`/`border-bad/60` | ||
| (vạch đỏ đánh dấu dòng stderr biến mất); Kafka Explorer mất `h-64`, `m-4`, | ||
| `py-5`, `translate-x-full`; Redis mất `min-h-16`, `mx-5`, `align-top`; | ||
| RabbitMQ mất `py-5`, `min-h-16`, `min-h-20`, `-mt-2.5`. | ||
|
|
||
| ĐÃ CÓ MỘT CƠ CHẾ TRƯỚC FILE NÀY: `externalPluginClassnamesSafelist.ts` — | ||
| một bản chụp class được trích ra MỘT LẦN lúc bốn tool tách khỏi repo này | ||
| (commit 1b59500 / 5ad6ba2), tồn tại chỉ để Tailwind quét thấy. Nó không hỏng; | ||
| nó CŨ. Chính comment của nó đã báo trước: "no automated re-sync". Mã plugin | ||
| đi tiếp sau ngày đó, thêm class mới, và không có gì đồng bộ lại — đó là lý do | ||
| chính xác vì sao `bottom-3`, `py-5`, `align-top`, `translate-x-full`, | ||
| `min-h-16` không có rule, trong khi `max-w-[9rem]` hay | ||
| `grid-cols-[3rem_minmax(0,1fr)_6.5rem_5.5rem]` (có trong bản chụp) thì có. | ||
|
|
||
| `@source inline(...)` dưới đây bù đúng điểm yếu đó cho phần THANG ĐO CHUNG: | ||
| nó liệt kê theo thang, không theo cách dùng, nên không cần đọc mã plugin và | ||
| không bao giờ cũ đi. Hai file bổ sung nhau, không thay thế nhau — bản chụp | ||
| kia vẫn là thứ duy nhất phủ được các giá trị tuỳ ý plugin đang dùng. | ||
| Giữ danh sách ở mức THANG ĐO CHUNG (khoảng cách, kích thước, vị trí) — | ||
| những thứ một layout bất kỳ cũng cần. Không thêm class trang trí vào đây: | ||
| màu, bóng, bo góc của plugin phải đến từ từ vựng design-system, thứ app chủ | ||
| vốn đã dùng khắp nơi. | ||
|
|
||
| KHÔNG thang đo nào liệt kê nổi giá trị tuỳ ý (`max-w-[12rem]`, | ||
| `grid-cols-[minmax(...)]`) — mỗi cái là một rule riêng. Chúng vẫn phụ thuộc | ||
| bản chụp kia, tức vẫn cũ đi được; nên plugin phải viết chúng bằng inline | ||
| `style`, và repo plugin có test chặn lại (`ui/hostCssClasses.test.ts`). | ||
| ========================================================================== */ | ||
|
|
||
| /* Thang spacing: margin/padding mọi phía, gap, và bù âm cho margin. */ | ||
| @source inline("{,-}m{,x,y,s,e,t,r,b,l}-{0,0.5,1,1.5,2,2.5,3,3.5,4,5,6,7,8,9,10,11,12,14,16,20,24}"); | ||
| @source inline("p{,x,y,s,e,t,r,b,l}-{0,0.5,1,1.5,2,2.5,3,3.5,4,5,6,7,8,9,10,11,12,14,16,20,24}"); | ||
| @source inline("gap{,-x,-y}-{0,0.5,1,1.5,2,2.5,3,3.5,4,5,6,8,10,12}"); | ||
|
|
||
| /* Thang kích thước + các từ khoá nội tại hay dùng để dựng pane cuộn. */ | ||
| @source inline("{w,h,size,min-w,min-h,max-w,max-h}-{0,px,0.5,1,1.5,2,2.5,3,3.5,4,5,6,7,8,9,10,11,12,14,16,20,24,28,32,36,40,44,48,56,64,72,80,96}"); | ||
| @source inline("{w,h,min-w,min-h,max-w,max-h}-{full,screen,fit,min,max,none,auto}"); | ||
|
|
||
| /* Vị trí cho overlay/badge/nút nổi — chỗ `bottom-3` đã gãy. */ | ||
| @source inline("{,-}{inset,inset-x,inset-y,top,right,bottom,left,start,end}-{0,px,0.5,1,1.5,2,2.5,3,3.5,4,5,6,8,10,12,full,auto}"); | ||
| @source inline("{,-}{inset,inset-x,inset-y,top,right,bottom,left}-{1/2,1/3,2/3,1/4,3/4}"); | ||
|
|
||
| /* Biến đổi dùng cho panel trượt và canh giữa tuyệt đối. */ | ||
| @source inline("{,-}translate-{x,y}-{0,px,0.5,1,1.5,2,2.5,3,4,6,8,full,1/2}"); | ||
|
|
||
| /* Lưới và canh dọc — `grid-cols-N` tuỳ ý và `align-top` đều từng thiếu. */ | ||
| @source inline("grid-{cols,rows}-{1,2,3,4,5,6,7,8,9,10,11,12,none}"); | ||
| @source inline("col-span-{1,2,3,4,5,6,full}"); | ||
| @source inline("align-{baseline,top,middle,bottom,text-top,text-bottom,sub,super}"); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.