Repository navigation
Index: Remove hasActiveFilters check - #35151
Conversation
|
Oh shush, danger - it's a draft PR :P |
hasActiveFilters checkhasActiveFilters check
Are you able to set labels? You should. Danger is out looking for fresh blood, you're our first PR of the day! It's hungry! |
Package BenchmarksCommit: No significant changes detected, all good. 👏 |
|
Well that seemed to break...nothing? If endorsed I'll write some actual tests |
|
LGTM @mrginglymus! Do you wanna follow up here on the other function or separately? I expect it'll be harder 😄 |
|
I think I'll chase that other one elsewhere, this fixes an immediate issue I have withour storybook. I'll try and add some tests tomorrow if I can find where... |
You could start in the Explorer stories with a mocked I don't think we have a good place to test initial story loading behaviour without writing a whole sandbox. You could add an IntentionallyFilteredOut story to the sandbox templates and then add a line in the manager that applies a custom filter targeting this story. Then an E2E test would only check if the story exists in the sidebar (you can try to locate its generated |
0457e9b to
ed75069
Compare
|
@Sidnioulz found some tests to add a test to. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughThe ChangesFilter presence check refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes ✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
code/core/src/manager-api/tests/stories.test.ts (1)
2059-2080: ⚡ Quick winAdd a companion test for the
STORY_SPECIFIEDfiltered-index path.This new case covers
selectFirstStory, but the other changed branch inSTORY_SPECIFIED(filteredIndex && !stateHasSelection) is still unasserted. A focused channel-event test there would lock in the bug fix behavior on initial canvas routing.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@code/core/src/manager-api/tests/stories.test.ts` around lines 2059 - 2080, Add a new test case in the stories.test.ts file that specifically tests the STORY_SPECIFIED action path when filteredIndex is available and stateHasSelection is false. This test should verify the behavior for initial canvas routing by setting up the moduleArgs with a STORY_SPECIFIED action, an active filteredIndex, no current story selection, and then asserting that the navigate function is called with the first story from the filteredIndex rather than from the full index. This will ensure the bug fix behavior for the filteredIndex && !stateHasSelection branch in the STORY_SPECIFIED handler is properly locked in.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@code/core/src/manager-api/tests/stories.test.ts`:
- Around line 2059-2080: Add a new test case in the stories.test.ts file that
specifically tests the STORY_SPECIFIED action path when filteredIndex is
available and stateHasSelection is false. This test should verify the behavior
for initial canvas routing by setting up the moduleArgs with a STORY_SPECIFIED
action, an active filteredIndex, no current story selection, and then asserting
that the navigate function is called with the first story from the filteredIndex
rather than from the full index. This will ensure the bug fix behavior for the
filteredIndex && !stateHasSelection branch in the STORY_SPECIFIED handler is
properly locked in.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 1b61a8fb-ac13-4b83-8115-771094e11ab3
📒 Files selected for processing (3)
code/core/src/manager-api/modules/stories.tscode/core/src/manager-api/tests/stories.test.tscode/core/src/shared/utils/story-index-filters.ts
💤 Files with no reviewable changes (1)
- code/core/src/shared/utils/story-index-filters.ts
There are multiple sources that would cause the index to be filtered, and working out which are active is effectively impossible. Instead, just check for the presence of a filtered index and use that if available.
0fd2629 to
1e729c8
Compare
What I did
There are multiple sources that would cause the index to be filtered, and working out which are active is effectively impossible.
Instead, just check for the presence of a filtered index and use that if available.
Addresses a bug reported on Discord, see https://discord.com/channels/486522875931656193/1507589559439986720 for the conversation and analysis.
Checklist for Contributors
Testing
The changes in this PR are covered in the following automated tests:
Manual testing
code/.storybook/manager.tstargeting the benchmark storyDocumentation
MIGRATION.MD
Checklist for Maintainers
When this PR is ready for testing, make sure to add
ci:normal,ci:mergedorci:dailyGH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found incode/lib/cli-storybook/src/sandbox-templates.tsDeclare whether manual QA will be needed for this PR during the next release, through
qa:neededorqa:skipMake sure this PR contains one of the labels below:
Available labels
bug: Internal changes that fixes incorrect behavior.maintenance: User-facing maintenance tasks.dependencies: Upgrading (sometimes downgrading) dependencies.build: Internal-facing build tooling & test updates. Will not show up in release changelog.cleanup: Minor cleanup style change. Will not show up in release changelog.documentation: Documentation only changes. Will not show up in release changelog.feature request: Introducing a new feature.BREAKING CHANGE: Changes that break compatibility in some way with current major version.other: Changes that don't fit in the above categories.🦋 Canary release
This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the
@storybookjs/coreteam here.core team members can create a canary release here or locally with
gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>Summary by CodeRabbit