Skip to content

feat(ui): support BackTop custom target#91

Merged
wyf027 merged 5 commits into
mainfrom
codex/backtop-target-2026-07-08
Jul 7, 2026
Merged

feat(ui): support BackTop custom target#91
wyf027 merged 5 commits into
mainfrom
codex/backtop-target-2026-07-08

Conversation

@wyf027

@wyf027 wyf027 commented Jul 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • add target support so BackTop can observe and scroll a custom container
  • keep the existing window behavior as the default
  • add BackTop tests for target-based visibility and scrolling
  • update BackTop docs with a Tailwind custom-container demo and API entry

Validation

  • GitHub Actions CI / quality passed for head 3a857bc042573996e799102065de523ad583d95b in run 28896994040.
  • Passed steps: npm run lint:ui, npm run typecheck:ui, npm run test:ui, npm run build:ui, npm run build:docs.
  • Test run included BackTop coverage for window visibility, click preservation, custom target visibility and scrolling, preventDefault(), and custom accessible content.
  • Not run locally: the Codex shell executor is currently failing with Failed to create unified exec process: No such file or directory.

Notes

  • codebase-memory-mcp graph tools were not exposed in this session, so this run used GitHub file reads as the AGENTS.md fallback.
  • External references: Ant Design FloatButton.BackTop exposes target; Element Plus Backtop also supports a target option for custom scroll containers.

@ecc-tools

ecc-tools Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@ecc-tools

ecc-tools Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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-tools

ecc-tools Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR.

@wyf027
wyf027 merged commit c69d578 into main Jul 7, 2026
1 check passed
@wyf027
wyf027 deleted the codex/backtop-target-2026-07-08 branch July 7, 2026 23:13
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