Skip to content

fix: atomic Sort Expression not respecting tabs-included after Atomic version 3.39#6994

Merged
y-lakhdar merged 2 commits intomainfrom
KIT-5419
Jan 22, 2026
Merged

fix: atomic Sort Expression not respecting tabs-included after Atomic version 3.39#6994
y-lakhdar merged 2 commits intomainfrom
KIT-5419

Conversation

@y-lakhdar
Copy link
Copy Markdown
Contributor

@y-lakhdar y-lakhdar commented Jan 20, 2026

Issue

After the Stencil→Lit migration (#6658), atomic-sort-dropdown stopped resetting the sort criteria when switching to a tab where the current sort option isn't allowed (via tabs-included/tabs-excluded).

Root Cause

The Stencil version validated sort criteria in componentShouldUpdate(), which ran synchronously on every state change including tab switches. The Lit migration moved this to updated(), which doesn't reliably trigger when tabManagerState changes.

Context

https://discuss.coveo.com/t/support-00133057-atomic-sort-expression-not-respecting-tabs-included-after-atomic-version-3-39/14095

https://coveord.atlassian.net/browse/KIT-5419

Copy link
Copy Markdown
Contributor

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 fixes a bug where the atomic-sort-dropdown component did not properly respect tabs-included attributes after Atomic version 3.39. The fix ensures that when the active tab changes, the sort expression is reset if it's no longer valid for the current tab.

Changes:

  • Modified the tab manager state binding to use a callback method for state changes
  • Refactored the sort validation logic into a separate method for improved code organization
  • Added a test case to verify the tab state change callback behavior

Reviewed changes

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

File Description
packages/atomic/src/components/search/atomic-sort-dropdown/atomic-sort-dropdown.ts Introduced onTabManagerStateChange callback to react to tab changes and reset invalid sort expressions; extracted validation logic into isSortValid method
packages/atomic/src/components/search/atomic-sort-dropdown/atomic-sort-dropdown.spec.ts Added test case verifying sort reset behavior when tab state changes via the new callback mechanism

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…mic-sort-dropdown.spec.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 20, 2026

@y-lakhdar I've opened a new pull request, #6995, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Copy Markdown

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

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: 303687a02e

ℹ️ 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".

@y-lakhdar y-lakhdar added this pull request to the merge queue Jan 22, 2026
Merged via the queue into main with commit c8c8c44 Jan 22, 2026
99 checks passed
@y-lakhdar y-lakhdar deleted the KIT-5419 branch January 22, 2026 16:30
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.

5 participants