feat(ui): support BackTop custom target#91
Conversation
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 548a9d8153
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| target?: () => BackTopTarget | null | ||
| } | ||
|
|
||
| const getScrollTop = (target: BackTopTarget) => (target === window ? window.scrollY : target.scrollTop) |
There was a problem hiding this comment.
Narrow BackTopTarget before reading scrollTop
When the UI package is built (npm run build:ui), tsup's declaration step fails with TS2551 on this expression because BackTopTarget also includes Window, which does not have scrollTop. This blocks generating the published package even though the runtime branch is intended to handle window; use an explicit instanceof Window/HTMLElement narrowing or a helper type guard before reading scrollTop.
Useful? React with 👍 / 👎.
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
Summary
targetsupport so BackTop can observe and scroll a custom containerValidation
CI / qualitypassed for head3a857bc042573996e799102065de523ad583d95bin run28896994040.npm run lint:ui,npm run typecheck:ui,npm run test:ui,npm run build:ui,npm run build:docs.preventDefault(), and custom accessible content.Failed to create unified exec process: No such file or directory.Notes
codebase-memory-mcpgraph tools were not exposed in this session, so this run used GitHub file reads as the AGENTS.md fallback.FloatButton.BackTopexposestarget; Element PlusBacktopalso supports atargetoption for custom scroll containers.