Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: #696 #700

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

fix: #696 #700

wants to merge 3 commits into from

Conversation

m2a2x
Copy link
Collaborator

@m2a2x m2a2x commented Feb 27, 2025

  • Group columns based on indexes not based on props
  • Requires careful testing

Summary by CodeRabbit

  • Chores

    • Updated various submodule dependencies to their latest revisions.
  • Refactor

    • Enhanced the range selection interface to provide more detailed results.
    • Streamlined header rendering and group column integrations for a cleaner data flow.
    • Adjusted component export patterns to align with current module standards.

Copy link

coderabbitai bot commented Feb 27, 2025

Walkthrough

This pull request updates multiple subproject commit identifiers across various directories and packages. In addition, it refines component type definitions and export styles. The modifications include a revised method return type in a TypeScript declaration, removal of unused properties, and adjustments to import/export statements in header and grouping column components. Overall, these changes update references to new commit hashes and streamline component interfaces without altering core functionality.

Changes

File(s) Summary
docs, formats/number, packages/… (angular, react, svelte, vue2, vue3) Updated subproject commit identifiers from old hashes to new ones.
src/components.d.ts Updated method signature of getSelectedRange to return `Promise<(RangeArea & AllDimensionType)
src/components/header/revogr-header.tsx, src/plugins/groupingColumn/columnGroupsRenderer.tsx, src/plugins/groupingColumn/headerGroupRenderer.tsx Refactored header and grouping components: changed import/export style, removed unused properties, and updated prop types and rendering logic.

Sequence Diagram(s)

sequenceDiagram
    participant H as RevogrHeaderComponent
    participant C as ColumnGroupsRenderer
    participant G as GroupHeaderRenderer

    H->>C: Pass updated column data (cols)
    C->>G: Delegate group header rendering
    G-->>C: Return rendered header group
    C-->>H: Return complete header view
Loading

Possibly related PRs

Suggested reviewers

  • revolist

Poem

I'm a code-hopping rabbit, thrilled to see the change,
New commits in every corner, rearranging range by range.
Unused props have vanished, exports sing a brand new tune,
Refined components dance together beneath the coding moon.
With a carrot crunch and ASCII art, our code now leaps anew!
🥕 Happy hops to all, in our fresh, sleek review!

✨ Finishing Touches
  • 📝 Generate Docstrings

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/plugins/groupingColumn/columnGroupsRenderer.tsx (1)

24-36: Simplified and improved visibility detection logic.

The new approach for determining visible groups:

  1. Extracts visible column indexes into an array
  2. Uses array operations to check if any column falls within a group's boundaries
  3. Makes the group visibility check more direct and efficient

This implementation directly supports the PR objective of grouping columns based on indexes rather than properties.

For even better readability, consider extracting the visibility check to a named function:

- // Check if any visible column is within this group's range
- const isVisible = visibleIndexes.some(index => 
-   index >= groupStartIndex && index <= groupEndIndex
- );
+ // Check if any visible column is within this group's range
+ const isVisible = isColumnGroupVisible(visibleIndexes, groupStartIndex, groupEndIndex);

With an appropriate helper function defined at the top of the file.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ec5ee6 and 671c667.

📒 Files selected for processing (11)
  • docs (1 hunks)
  • formats/number (1 hunks)
  • packages/angular (1 hunks)
  • packages/react (1 hunks)
  • packages/svelte (1 hunks)
  • packages/vue2 (1 hunks)
  • packages/vue3 (1 hunks)
  • src/components.d.ts (1 hunks)
  • src/components/header/revogr-header.tsx (2 hunks)
  • src/plugins/groupingColumn/columnGroupsRenderer.tsx (2 hunks)
  • src/plugins/groupingColumn/headerGroupRenderer.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (7)
  • packages/angular
  • formats/number
  • packages/vue2
  • packages/react
  • packages/vue3
  • docs
  • packages/svelte
🔇 Additional comments (8)
src/plugins/groupingColumn/headerGroupRenderer.tsx (1)

18-18: Export standardization improves import consistency.

The change from a non-exported constant to a named export aligns with modern JavaScript/TypeScript best practices and makes imports more explicit in consuming files.

src/components.d.ts (1)

157-157:

✅ Verification successful

Enhanced return type provides more detailed range information.

The updated return type for getSelectedRange() now includes dimension information (AllDimensionType) along with the range data, which better supports the index-based column grouping approach described in the PR objectives.


🏁 Script executed:

#!/bin/bash
# Check the implementation of getSelectedRange to ensure it returns the enhanced type

# Look for the getSelectedRange method implementation
rg "getSelectedRange\(\)" -A 10

Length of output: 1705


Enhanced return type successfully integrates dimension info.

The updated signature in src/components.d.ts now accurately reflects that getSelectedRange() returns a Promise resolving to (RangeArea & AllDimensionType) | null. The implementation in both src/components/revoGrid/viewport.service.ts and src/components/revoGrid/revo-grid.tsx confirms this change—using a normalization (via ?? null) to ensure a consistent null when no range is selected, even though the internal return type may include undefined.

  • Confirmed that the returning value is enriched with dimension type details and supports the updated column grouping logic.
  • Verified that the normalization in revo-grid.tsx ensures type consistency with the declaration in components.d.ts.
src/components/header/revogr-header.tsx (2)

15-15: Import aligned with component's export style.

Updated import statement correctly uses named import, reflecting the change in how ColumnGroupsRenderer is exported.


208-208: Simplified props passing with direct column data.

The props have been updated to pass cols directly rather than using visibleProps, which aligns with the modified component API and supports the index-based column grouping approach described in the PR objectives.

src/plugins/groupingColumn/columnGroupsRenderer.tsx (4)

3-5: Import statements correctly updated to support new implementation.

The changes to imports align with the component's new requirements and maintain consistency with the export style changes in HeaderGroupRenderer.


8-17: Props interface improved to use direct column data.

The Props type definition has been updated to use direct column data (cols: PositionItem[]) instead of the property mapping (visibleProps), which aligns with the PR objective of grouping columns based on indexes rather than properties.


19-21: Export style standardized for better module consistency.

Changed from default export to named export, improving import/export consistency across the codebase.


57-59: Improved group boundary tracking with clear comments.

The renamed variables and added comments make the logic easier to follow, showing how the start index advances for the next group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change feature New feature or request
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

1 participant