Skip to content

feat: expose all skin chrome as reusable React frames - #8

Open
apple-ouyang wants to merge 15 commits into
SneakRead:mainfrom
apple-ouyang:codex/reusable-skin-frames
Open

apple-ouyang wants to merge 15 commits into
SneakRead:mainfrom
apple-ouyang:codex/reusable-skin-frames

Conversation

@apple-ouyang

Copy link
Copy Markdown

Summary

  • expand @sneakread/react from the Word prototype to all 15 SneakRead skins
  • ship one independent JS, CSS, and type entry per skin through @sneakread/react/<skin>
  • expose typed host slots for content, composer, file menu, logo, controls, labels, and skin-specific chrome
  • migrate every SneakRead surface to consume its package frame and remove the duplicate app-owned chrome
  • keep React external and reject reader, core, analytics, storage, react-dom, unrelated skins, and Monaco content models from package artifacts

This subsumes the Word-only package work in #7 and completes the reusable-frame contract requested in #6 across the full skin set.

External host proof

A real Next 15 / React 19 host installs the local package artifact and renders Slack, Lark, and DingTalk with host-owned messages, AI waiting state, composer/input, File menu, and application state. Each host page has one menu owner, no horizontal overflow, and no page-origin console errors.

Browser proof

  • all 15 skins rendered at desktop size with independent package frames
  • applicable skins rechecked at 390x844
  • Slack, Lark, and DingTalk compared against the pre-migration baseline
  • menu mounting, links, skin switching, console output, and overflow verified
  • VS Code package artifact verified not to contain Monaco content models

Verification

  • pnpm --filter @sneakread/react check
  • pnpm build
  • pnpm lint (existing warnings only)
  • npm_config_cache=/tmp/sneakread-npm-cache pnpm --filter @sneakread/react exec npm pack --dry-run
  • git diff --check main...HEAD
  • package artifact audit for all 15 JS/CSS/type subpaths
  • external Next 15 / React 19 host build and Chrome interaction checks

Closes #6

Word chrome lived inside the SneakRead app shell, so React hosts had to copy source and could not consume upstream improvements safely.

Add an installable @sneakread/react workspace package with scoped CSS, typed localization and host menu slots. SneakRead now consumes the package for both home and article Word surfaces, and the package contract excludes reader, analytics, Monaco, app-core and bundled React.
原因:
- 执行上游皮肤模块化需要在 integration worktree 中保留唯一的 approved Spec 和可压缩恢复的进度台账。
- 多个皮肤族会并发修改,必须先固定公共边界、禁止范围和验证门槛。

改动:
- 迁入 approved Spec,记录独立 frame、最小宿主 slots、按族 PR 和真实浏览器验收合同。
- 创建 integration 的 PROGRESS,记录 Word package 前置、并发顺序与 READY_FOR_ACCEPTANCE 停止条件。
Reason:
- Future skin-family migrations need automatic entry discovery without hand-editing the package manifest.

Changes:
- Publish independent per-entry JavaScript, scoped CSS, and declaration artifacts with wildcard exports.
- Clean dist before every package build and enforce source, dependency, artifact, and CSS contracts.
- Preserve the root index and Word compatibility exports.

Example:
- Input: 'src/word.tsx'
- Before: shared 'index' and 'style' artifacts
- After: 'word.js', 'word.css', and 'word.d.ts'
Why:
- The reusable frame migration needs reproducible browser and external-host evidence, including the sizing regression and its verified fix.

What:
- Record the completed T0-T7 execution state and resolved runtime blocker history.
- Add baseline, candidate, mobile, and React 19/Next 15 host screenshots for all required checks.
Reason:
- React hosts need to place Slack's file menu in the channel header, wire Home navigation, and remove the default rail footer without recreating the frame chrome.

Changes:
- Add typed Home, file-menu placement, and rail-footer slots while preserving existing defaults.
- Verify declarations and runtime behavior for both menu placements, footer nullability, callback forwarding, and the single app-menu owner.
- Document the host contract.
原因:
- 已批准 Spec 要求把每个 checkpoint 的 reviewer、验证与精确截图写回现有 PROGRESS。

改动:
- 记录 Slack package/汤问 integration commits、Terra/Sol review 与自动验证。
- 记录 fresh Chrome 菜单位置、Home 跳转、左下调试圆点根因和最终截图。
原因:
- 已批准 Spec 要求把 UI checkpoint 的 reviewer、浏览器结果和精确截图写回现有 PROGRESS。

改动:
- 记录引导箭头根因、Terra 三轮 review 与 focused test 证据。
- 保存 Slack 桌面/移动端和 Word 左侧菜单截图,并记录七种皮肤的 target/arrow 中心对齐结果。
原因:
- 已批准 Spec 要求把本次飞书引导 checkpoint 的 reviewer、几何测量和精确截图写回现有 PROGRESS。

改动:
- 记录外层 slot 与真实按钮的尺寸差异、实现提交和 Terra PASS。
- 保存 350px 视口下 ring 收紧并对准真实按钮的截图。
原因:
- 用户要求 Slack、飞书、钉钉统一使用右上公文包并合并调查工具,需要保留可复核的桌面与移动端真实浏览器证据。

改动:
- 记录汤问 lane、integration commit、Terra review 和自动验证结果。
- 保存三个聊天皮肤在 1440x1000 与 390x844 下的完整面板截图、slot 位置、overflow 和 console 证据。
原因:
- 聊天公文包功能在汤问 rebase 后需要可复核的最终浏览器与回归证据。

改动:
- 记录最新 main 基线、兼容提交、精确测试命令和 Chrome 验收结果。
- 覆盖 Slack、飞书、钉钉桌面与移动端截图中发生变化的文件。
@apple-ouyang

Copy link
Copy Markdown
Author

Following up on this larger PR. It has been ready for review since the last update, but currently has no checks or maintainer review. Could you confirm whether the scope is acceptable, or whether you would prefer this split into smaller PRs?

This branch has not been deployed

No deployments
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.

Expose the Word chrome as a reusable React package

1 participant