Skip to content

Comments

feat(layers panel): 22412 make axis group mutually exclusive. Fix "openByDefault" flag for groups and categories#1244

Merged
albaranau merged 2 commits intomainfrom
22412-make-axis-group-mutually-exclusive
Aug 11, 2025
Merged

feat(layers panel): 22412 make axis group mutually exclusive. Fix "openByDefault" flag for groups and categories#1244
albaranau merged 2 commits intomainfrom
22412-make-axis-group-mutually-exclusive

Conversation

@albaranau
Copy link
Contributor

@albaranau albaranau commented Aug 11, 2025

https://kontur.fibery.io/Tasks/My-tasks-3575#Tasks/Task/Make-axis-group-mutually-exclusive-22412

image

Summary by CodeRabbit

  • New Features
    • Introduced an Indicators group in the Layers panel, positioned between existing groups and set as mutually exclusive (select one at a time).
  • UX Improvements
    • Groups and categories now open/close on first load based on their own default settings rather than always opening. Toggling behavior remains unchanged.
    • Updated group order to accommodate the new Indicators group; some existing groups move down accordingly.
  • Localization
    • Added English translation for “Indicators.”

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 11, 2025

Walkthrough

Added a new "indicators" translation, introduced an "axis" group in logical layer settings with adjusted ordering, and changed default open-state logic in Group and Category components to respect openByDefault when no persisted state exists.

Changes

Cohort / File(s) Summary
Localization: add indicators key
src/core/localization/translations/en/common.json
Added groups.indicators = "Indicators"; adjusted JSON comma to insert new key.
Logical layer group settings update
src/core/logical_layers/constants.ts
Added groupSettings.axis using i18n.t('groups.indicators'); set openByDefault: false, mutuallyExclusive: true, order: 3; incremented qa.order to 4 and osmbasedmap.order to 5.
UI default open-state: Category
src/features/layers_panel/components/Category/Category.tsx
Default isOpen now falls back to category.openByDefault instead of true when no entry in open-state map.
UI default open-state: Group
src/features/layers_panel/components/Group/Group.tsx
Default isOpen now falls back to group.openByDefault instead of true when no entry in open-state map.

Sequence Diagram(s)

sequenceDiagram
  participant UI as Layers Panel UI
  participant State as Open State Map
  participant Config as Group/Category Config

  UI->>State: get(groupId/categoryId)
  alt has stored value
    State-->>UI: isOpen = stored
  else no stored value
    UI->>Config: read openByDefault
    Config-->>UI: openByDefault
    UI-->>UI: isOpen = openByDefault
  end
  UI->>UI: render FoldingWrap(isOpen)
  UI->>State: on toggle -> setOpen(id, !isOpen)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 891053e and 55efb0d.

📒 Files selected for processing (4)
  • src/core/localization/translations/en/common.json (1 hunks)
  • src/core/logical_layers/constants.ts (1 hunks)
  • src/features/layers_panel/components/Category/Category.tsx (1 hunks)
  • src/features/layers_panel/components/Group/Group.tsx (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: deploy
  • GitHub Check: test
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (6)
src/features/layers_panel/components/Category/Category.tsx (1)

18-18: Default open-state now respects category.openByDefault — LGTM

This aligns Category with Group behavior and avoids the previous unconditional “open by default” fallback. No concerns.

src/core/localization/translations/en/common.json (2)

86-87: Add groups.indicators translation — LGTM

Key and value look correct and match usage in constants.


86-87: Verify i18n completeness across all locales

I wasn’t able to automatically confirm that every locale’s common.json defines the groups.indicators key. Please manually verify that each file under
src/core/localization/translations/*/common.json
includes a top-level
"groups": {
"indicators": "…"
}

so no locale falls back to English at runtime.
You can run locally:

fd common.json src/core/localization/translations | \
  xargs -I{} sh -c 'jq -e ".groups.indicators" "{}" >/dev/null 2>&1 || echo "MISSING: {}"'

and ensure the output is empty.

src/features/layers_panel/components/Group/Group.tsx (1)

23-23: Use group.openByDefault as fallback for isOpen — LGTM

This keeps persisted values intact and uses the intended default only when absent. Matches Category behavior.

src/core/logical_layers/constants.ts (2)

41-46: Add axis group (mutuallyExclusive, closed by default) and adjust ordering — looks correct

  • axis uses i18n.t('groups.indicators'), mutuallyExclusive: true, order: 3 — matches PR intent.
  • Reorders qa → 4 and osmbasedmap → 5 as expected.

No issues spotted with the settings themselves.

Also applies to: 51-51, 57-57


41-46: Validate downstream assumptions: ordering, translations, and usage of the new group (manual verification required)

We weren’t able to confirm these points automatically due to environment issues. Please manually verify:

  • The UI sorts groups by GroupSettings.order, and setting order: 3 for the new axis group yields the intended position.
  • There are (or will be) layers assigned to the axis group id so that this group will actually contain items.
  • The translation key groups.indicators is present in every common.json under src/core/localization/translations/<locale>/.

Relevant snippet in src/core/logical_layers/constants.ts (lines 41–46):

  axis: {
    name: i18n.t('groups.indicators'),
    openByDefault: false,
    mutuallyExclusive: true,
    order: 3,
  },
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 22412-make-axis-group-mutually-exclusive

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.

❤️ 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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests 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.

@albaranau albaranau requested review from a team, sleeping-h and vkozio August 11, 2025 16:10
@github-actions
Copy link

Language To Recheck Fuzzy Untranslated Total
ar 3 216 837 1056
be 0 41 0 41
de 2 216 837 1055
es 3 216 837 1056
id 2 216 837 1055
ko 3 216 837 1056
ru 0 24 0 24
uk 0 18 799 817
zh 0 43 0 43

@github-actions
Copy link

Bundle size diff

Old size New size Diff
5.06 MB 5.06 MB 133 B (0.00%)

@albaranau albaranau changed the title feat(layers panel): 22412 make axis group mutually exclusive feat(layers panel): 22412 make axis group mutually exclusive. Fix "openByDefault" flag for groups and categories Aug 11, 2025
@github-actions
Copy link

Preview environments for this PR:

These previews are automatically updated with each commit.

Note: After a new deployment, it may take a few minutes for the changes to propagate and for caches to update. During this time, you might experience temporary loading issues or see an older version of the app. If the app fails to load, please wait a few minutes and try again.

@codecov
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 12.03%. Comparing base (891053e) to head (55efb0d).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/core/logical_layers/constants.ts 0.00% 8 Missing ⚠️
...ures/layers_panel/components/Category/Category.tsx 0.00% 1 Missing ⚠️
...c/features/layers_panel/components/Group/Group.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1244      +/-   ##
==========================================
- Coverage   12.03%   12.03%   -0.01%     
==========================================
  Files         724      724              
  Lines       29785    29791       +6     
  Branches     1398     1398              
==========================================
  Hits         3585     3585              
- Misses      25644    25650       +6     
  Partials      556      556              
Components Coverage Δ
UI Components 0.29% <ø> (ø)
Core Logic 17.18% <0.00%> (-0.01%) ⬇️
Features 2.56% <0.00%> (ø)
Utilities 44.60% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codecov
Copy link

codecov bot commented Aug 11, 2025

Bundle Report

Changes will increase total bundle size by 169 bytes (0.0%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
konturio/disaster-ninja-fe-esm 5.33MB 169 bytes (0.0%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: konturio/disaster-ninja-fe-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 26 bytes 5.93kB 0.44%
assets/index-*.js 60 bytes 229.85kB 0.03%
assets/mapListeners-*.js 83 bytes 3.9kB 2.17%

Files in assets/index-*.js:

  • ./src/features/layers_panel/components/Category/Category.tsx → Total Size: 1.64kB

  • ./src/features/layers_panel/components/Group/Group.tsx → Total Size: 1.44kB

Files in assets/index-*.js:

  • ./src/core/localization/translations/en/common.json → Total Size: 20.21kB

Files in assets/mapListeners-*.js:

  • ./src/core/logical_layers/constants.ts → Total Size: 1.79kB

@albaranau albaranau merged commit 215ae50 into main Aug 11, 2025
29 of 33 checks passed
@albaranau albaranau deleted the 22412-make-axis-group-mutually-exclusive branch August 11, 2025 16:24
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