Skip to content

Conversation

@akanshaaa19
Copy link
Member

@akanshaaa19 akanshaaa19 commented Nov 6, 2025

The changes to the default language functionality were not backward compatible. Reverting these changes until we work on a better solution.

Summary by CodeRabbit

  • New Features

    • Default languages now included in the language selector
  • Style

    • Updated active language indicator styling
  • Chores

    • Patch version update (1.43.0-3)

@coderabbitai
Copy link

coderabbitai bot commented Nov 6, 2025

Walkthrough

Version bump to 1.43.0-3 and refactoring of language selector logic: removed font-weight emphasis from active language styling, eliminated filtering of default languages from the selector component, and simplified fallback behavior to use a static DEFAULT_LANGUAGE constant instead of dynamically constructing named default tabs.

Changes

Cohort / File(s) Summary
Version Bump
package.json
Updated package version from 1.43.0-2 to 1.43.0-3
Language Selector Styling
src/components/languageselector/LanguageSelector.module.scss
Removed font-weight: 500 property from .active rule, reducing visual emphasis on the active language item
Language Selector Logic
src/components/languageselector/LanguageSelector.tsx
Removed filtering logic that excluded languages where lang.content?.default was truthy, allowing default languages to be included in the selector list
Language Fallback Handler
src/store/thunks.ts
Simplified fallback logic when chosen language is not found: now directly uses DEFAULT_LANGUAGE instead of dynamically computing and constructing named default tabs (e.g., "Default (Name)")

Sequence Diagram(s)

sequenceDiagram
    participant UI as Language Selector UI
    participant State as Redux State
    participant Store as Asset Store
    
    rect rgb(200, 220, 230)
    Note over UI,Store: Old Flow
    UI->>State: Load flow definition
    State->>Store: Check if chosen language exists
    Store-->>State: Language not found
    State->>Store: Scan assetStore.languages for default
    Store-->>State: Return default language metadata
    State->>State: Construct named tab (e.g., "Default (Name)")
    State->>UI: Dispatch with dynamic default
    end
    
    rect rgb(220, 230, 200)
    Note over UI,Store: New Flow
    UI->>State: Load flow definition
    State->>Store: Check if chosen language exists
    Store-->>State: Language not found
    State->>State: Use DEFAULT_LANGUAGE constant
    State->>UI: Dispatch with static default
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • The logic changes are straightforward simplifications rather than complex new functionality
  • Language selection logic is relatively isolated and self-contained
  • Removal of dynamic default language computation reduces complexity
  • Primary attention areas:
    • Verify that removing default language filtering doesn't break language list population
    • Confirm the static DEFAULT_LANGUAGE fallback is appropriate for all language-not-found scenarios
    • Ensure font-weight removal doesn't negatively impact UI/UX for active language indicators

Possibly related PRs

Suggested reviewers

  • AmishaBisht
  • madclaws
  • shijithkjayan

Poem

🐰 A hop, skip, and simplified way,
Languages sorted with DEFAULT's sway,
No weight on the active, just lightness and grace,
Filter removed, defaults now find their place!

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the primary purpose of the changeset, which reverts changes to default language tab functionality as shown in the thunks.ts modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch revert-default-language-changes

📜 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 423e814 and fc2e205.

📒 Files selected for processing (4)
  • package.json (1 hunks)
  • src/components/languageselector/LanguageSelector.module.scss (0 hunks)
  • src/components/languageselector/LanguageSelector.tsx (0 hunks)
  • src/store/thunks.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • src/components/languageselector/LanguageSelector.tsx
  • src/components/languageselector/LanguageSelector.module.scss
🧰 Additional context used
🧬 Code graph analysis (1)
src/store/thunks.ts (2)
src/store/flowContext.ts (1)
  • DEFAULT_LANGUAGE (113-117)
src/store/helpers.ts (1)
  • mergeAssetMaps (660-664)
🔇 Additional comments (2)
package.json (1)

5-5: LGTM - Version bump is appropriate.

The version increment from 1.43.0-2 to 1.43.0-3 correctly reflects the revert changes in this PR.

src/store/thunks.ts (1)

374-378: No unreverted changes from PR #169 remain—the related LanguageSelector files have already been properly reverted.

The git history confirms that commit fc2e205e ("revert hiding default language tab in the language bar") already removed the problematic changes from PR #169:

  • LanguageSelector.tsx: Currently contains no filtering logic; all languages are displayed without filtering default languages.
  • LanguageSelector.module.scss: The .active state contains only styling properties (text-decoration: none; color: $gray; cursor: default;) with no font-weight modifications.

The revert commit successfully removed 1 line each from both LanguageSelector files, restoring them to their pre-PR #169 state. The thunks.ts changes in the current PR stand independently and correctly implement the fallback to DEFAULT_LANGUAGE as shown in the code snippet.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@akanshaaa19 akanshaaa19 merged commit c8eb40b into glific-master Nov 10, 2025
7 checks passed
@akanshaaa19 akanshaaa19 deleted the revert-default-language-changes branch November 10, 2025 12:28
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.

3 participants