Skip to content

Bugfix/geo map bugs#125

Merged
emlimlf merged 3 commits intomainfrom
bugfix/geo-map-bugs
Mar 21, 2025
Merged

Bugfix/geo map bugs#125
emlimlf merged 3 commits intomainfrom
bugfix/geo-map-bugs

Conversation

@emlimlf
Copy link
Copy Markdown
Collaborator

@emlimlf emlimlf commented Mar 20, 2025

In this PR

  • Fix geo map activity type dropdown not responsiveness
  • Disable tooltip on map area that don't have data
  • Disable map highlight color change
  • Increase map fill up space to 140%

Tickets

INS-257
INS-256

Summary by CodeRabbit

  • New Features
    • Improved dropdown display within the project contributors section by limiting its maximum width to create a more balanced layout.
    • Enhanced the geo map visualization with refined layout settings, improved tooltip display based on value conditions, and updated color styling for a more consistent visual experience.

emlimlf added 2 commits March 20, 2025 15:49
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
Signed-off-by: Efren Lim <elim@linuxfoundation.org>
@emlimlf emlimlf requested a review from gaspergrom March 20, 2025 08:18
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 20, 2025

Walkthrough

This pull request introduces two sets of changes. In the geographical distribution component, a new <div> with a maximum width of 160px wraps the <lfx-dropdown> element, constraining its layout within the flex container. In the geo-map chart configuration, new layout properties (layoutCenter, layoutSize, and aspectScale) are added, the tooltip formatter now conditionally returns a formatted string for positive values, and the series style properties are updated to use 'inherit' for color values.

Changes

File(s) Change Summary
frontend/app/components/modules/.../geographical-distribution.vue Wrapped the <lfx-dropdown> component with a <div class="max-w-[160px]"> to restrict its width, without altering its original properties like v-model, icon, options, and dropdown-position.
frontend/app/components/uikit/chart/.../geo-map.chart.ts Added new layout properties (layoutCenter, layoutSize, aspectScale) to defaultGeoOption; modified the tooltip formatter to check params.value (returning a formatted string if >0, else null); updated defaultSeriesStyle to use 'inherit' for styling.

Sequence Diagram(s)

sequenceDiagram
    participant Chart as Geo Map Chart
    participant Tooltip as Tooltip Formatter
    Chart->>Tooltip: Hover event (pass params.value)
    alt params.value > 0
        Tooltip-->>Chart: Return formatted tooltip string
    else params.value <= 0
        Tooltip-->>Chart: Return null
    end
Loading

Possibly related PRs

  • added geographical distribution widget #40: Involved similar modifications to the geographical distribution widget by adding a wrapper around the dropdown, aligning with the changes in this PR.
  • Collection list mobile #65: Addressed layout adjustments for the <lfx-dropdown> component in other filter components, demonstrating a related code-level focus on responsive UI modifications.

Suggested reviewers

  • gaspergrom

📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between da80a0c and b2532cc.

📒 Files selected for processing (2)
  • frontend/app/components/modules/project/components/contributors/geographical-distribution.vue (1 hunks)
  • frontend/app/components/uikit/chart/configs/geo-map.chart.ts (3 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
frontend/app/components/uikit/chart/configs/geo-map.chart.ts (1)
frontend/app/config/styles/colors.ts (1) (1)
  • lfxColors (1-73)
🔇 Additional comments (4)
frontend/app/components/modules/project/components/contributors/geographical-distribution.vue (1)

25-32: Good addition of a max-width constraint for the dropdown.

This change effectively addresses the non-responsive activity type dropdown issue (INS-256) by adding a max-width wrapper div. The 160px constraint ensures the dropdown maintains a reasonable size within the flex container, improving the responsive behavior of the interface.

frontend/app/components/uikit/chart/configs/geo-map.chart.ts (3)

14-16: Good adjustments to map layout properties.

These additions effectively implement the requirement to increase the fill space of the map (now at 140%). The centered layout with a controlled aspect scale of 0.7 will improve the map's visual representation and ensure it displays properly across different screen sizes.


34-49: Well-implemented conditional tooltip display.

This change properly addresses the requirement to disable tooltips on map areas without data. The condition params.value && Number(params.value) > 0 ensures tooltips only appear for areas with positive values. The additional styling improvements to the tooltip's flex layout also enhance readability.


62-65: Effective disabling of highlight color changes.

Changing both areaColor and borderColor to 'inherit' successfully disables the highlight color change feature when hovering over map areas, as required. This ensures consistent visual representation and prevents unnecessary visual distractions.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.

@emlimlf emlimlf merged commit a219d8e into main Mar 21, 2025
3 checks passed
@emlimlf emlimlf deleted the bugfix/geo-map-bugs branch March 21, 2025 01:27
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.

2 participants