Skip to content

Conversation

caoxing9
Copy link
Contributor

No description provided.

@caoxing9 caoxing9 requested a review from Copilot October 15, 2025 07:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds smooth scroll-to-bottom functionality for filter items and includes a CSS fix for text truncation in hide fields components. The primary purpose is to enhance user experience by automatically scrolling to the bottom when new filter conditions are added.

  • Added automatic scroll-to-bottom behavior when adding filter conditions
  • Fixed text truncation styling in hide fields component
  • Removed unused hook for hidden fields

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
packages/sdk/src/components/filter/BaseFilter.tsx Added scroll-to-bottom functionality with ref and click handlers
packages/sdk/src/components/hide-fields/HideFieldsBase.tsx Added truncate class to improve text overflow handling
apps/nextjs-app/src/features/app/hooks/useHiddenFields.ts Removed entire unused hook file

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment on lines +114 to +134
<div
role="button"
tabIndex={-1}
onKeyDown={(e) => {
if (e.key === 'Enter') {
e.stopPropagation();
e.preventDefault();
}
}}
className={cn('flex justify-start gap-1', footerClassName)}
onClick={(e) => {
e.stopPropagation();
e.preventDefault();
setTimeout(() => {
filterContainerRef?.current?.scrollTo({
top: filterContainerRef?.current?.scrollHeight,
behavior: 'smooth',
});
}, 0);
}}
>
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

The div with role='button' should handle all keyboard interactions that a button would. Currently it only handles 'Enter' but should also handle 'Space' key for full accessibility compliance.

Copilot uses AI. Check for mistakes.

Comment on lines +127 to +132
setTimeout(() => {
filterContainerRef?.current?.scrollTo({
top: filterContainerRef?.current?.scrollHeight,
behavior: 'smooth',
});
}, 0);
Copy link

Copilot AI Oct 15, 2025

Choose a reason for hiding this comment

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

Using setTimeout with 0ms delay is a code smell that suggests relying on timing for DOM updates. Consider using requestAnimationFrame or ensuring the scroll happens after the DOM update is complete through proper React lifecycle methods.

Copilot uses AI. Check for mistakes.

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