fix: Fix map call in report creation#3509
Conversation
Similar as #3503
📝 WalkthroughWalkthroughThe change updates the construction of the Changes
Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/snakemake/report/html_reporter/template/components/abstract_results.js (1)
285-285: Simplify and Unify Toggle State MappingThe updated mapping correctly converts the iterator from
data.toggleLabels.keys()into an array and then retrieves the corresponding toggle value fromstate.toggles, which addresses the earlier mapping issue.A couple of suggestions:
- Consistency & Readability: While using
Array.fromis perfectly acceptable, you might also consider using the spread operator (e.g.,[...data.toggleLabels.keys()]) for readability and consistency if that pattern is used elsewhere in the codebase.- DRY Principle: Note that similar mapping logic appears in the
toggleCallbackmethod (line 101). Consider extracting this mapping into a dedicated helper function to avoid duplication and ease future modifications.
🤖 I have created a release *beep* *boop* --- ## [9.1.6](v9.1.5...v9.1.6) (2025-04-03) ### Bug Fixes * Fix map call in report creation ([#3509](#3509)) ([287920d](287920d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This pull request includes a small but important fix to the `src/snakemake/report/html_reporter/template/components/abstract_results.js` file. The change corrects the mapping of `data.toggleLabels.keys()` to ensure proper retrieval of toggle states. * [`src/snakemake/report/html_reporter/template/components/abstract_results.js`](diffhunk://#diff-9dc0845743ccae31714e1a4ea05bbe7e6ddf11d4859779dd6bb74c2122a58593L285-R285): Fixed the mapping of `data.toggleLabels.keys()` by removing an erroneous `Array.from` call, which ensures correct toggle state retrieval. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Refactor** - Streamlined the internal handling of display data to enhance efficiency without affecting the current user experience. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
🤖 I have created a release *beep* *boop* --- ## [9.1.6](snakemake/snakemake@v9.1.5...v9.1.6) (2025-04-03) ### Bug Fixes * Fix map call in report creation ([snakemake#3509](snakemake#3509)) ([287920d](snakemake@287920d)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
This pull request includes a small but important fix to the
src/snakemake/report/html_reporter/template/components/abstract_results.jsfile. The change corrects the mapping ofdata.toggleLabels.keys()to ensure proper retrieval of toggle states.src/snakemake/report/html_reporter/template/components/abstract_results.js: Fixed the mapping ofdata.toggleLabels.keys()by removing an erroneousArray.fromcall, which ensures correct toggle state retrieval.Summary by CodeRabbit