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: Correct Text for Collapsed and Expanded Card States #3563

Merged
merged 1 commit into from
Feb 2, 2025

Conversation

sv7000
Copy link
Contributor

@sv7000 sv7000 commented Jan 31, 2025

Related Issue

Closes #3562

Description

This PR addresses the issue where the text displayed when a card is collapsed or expanded is incorrect. Currently, the text does not change as expected between "Expand" and "Collapse" states. This fix ensures that the correct text is shown based on the card's state for all the languages used in ever teams website.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Previous screenshots

Screenshot 2025-01-31 at 8 34 54 PM

Current screenshots

Screenshot 2025-01-31 at 9 11 34 PM

Summary by CodeRabbit

  • New Features

    • Added functionality to expand Kanban columns
    • Updated user interface text to reflect column expansion action
  • Localization

    • Added "Expand Column" translations for multiple languages, including Arabic, Bulgarian, German, English, Spanish, French, Hebrew, Italian, Dutch, Polish, Portuguese, Russian, and Chinese

Copy link
Contributor

coderabbitai bot commented Jan 31, 2025

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/web/lib/components/Kanban.tsx

Oops! Something went wrong! :(

ESLint: 8.46.0

ESLint couldn't find the config "next/core-web-vitals" to extend from. Please check that the name of the config is correct.

The config "next/core-web-vitals" was referenced from the config file in "/apps/web/.eslintrc.json".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

Walkthrough

The pull request introduces a modification to the Kanban component's user interface, specifically changing the text from "Collapse Column" to "Expand Column" across multiple language localization files. This change updates the text displayed in the popover menu when interacting with a Kanban column, reflecting a correction in the user interface text to match the actual functionality of expanding or collapsing columns.

Changes

File Change Summary
apps/web/lib/components/Kanban.tsx Updated text from t('common.COLLAPSE_COLUMN') to t('common.EXPAND_COLUMN')
apps/web/locales/*.json Added new localization entry "EXPAND_COLUMN" with translations in multiple languages (Arabic, Bulgarian, German, English, Spanish, French, Hebrew, Italian, Dutch, Polish, Portuguese, Russian, and Chinese)

Assessment against linked issues

Objective Addressed Explanation
Show "Expand" when card is collapsed [#3562]
Show correct text for card state [#3562]

Possibly related PRs

Suggested labels

web, bug-fix, ever-teams, improvement

Suggested reviewers

  • evereq
  • Cedric921

Poem

🐰 A Rabbit's Ode to Column Expansion 🔍

In Kanban's realm, a text did shift,
From "Collapse" to "Expand" - what a gift!
Columns now breathe with newfound grace,
A linguistic dance in digital space.
Hop, hop, hooray for clarity's might! 🎉


📜 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 5650129 and 826603d.

📒 Files selected for processing (14)
  • apps/web/lib/components/Kanban.tsx (1 hunks)
  • apps/web/locales/ar.json (1 hunks)
  • apps/web/locales/bg.json (1 hunks)
  • apps/web/locales/de.json (1 hunks)
  • apps/web/locales/en.json (1 hunks)
  • apps/web/locales/es.json (1 hunks)
  • apps/web/locales/fr.json (1 hunks)
  • apps/web/locales/he.json (1 hunks)
  • apps/web/locales/it.json (1 hunks)
  • apps/web/locales/nl.json (1 hunks)
  • apps/web/locales/pl.json (1 hunks)
  • apps/web/locales/pt.json (1 hunks)
  • apps/web/locales/ru.json (1 hunks)
  • apps/web/locales/zh.json (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: deploy
🔇 Additional comments (14)
apps/web/lib/components/Kanban.tsx (1)

302-302: Verify the expand/collapse behavior consistency.

The text change from 'COLLAPSE_COLUMN' to 'EXPAND_COLUMN' matches the component's behavior since:

  1. The ChevronLeftIcon is rotated 180° indicating expansion
  2. The toggleColumn function is called with false parameter

Run this script to verify the toggleColumn implementation:

✅ Verification successful

The expand/collapse behavior is correctly implemented

The code shows consistent implementation where:

  • The text "EXPAND_COLUMN" matches the toggleColumn(title, false) call for expansion
  • The ChevronLeftIcon's 180° rotation correctly indicates the expand state
  • Both the button and menu item use the same parameters for consistent behavior
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the toggleColumn implementation in useKanban hook
# Expected: The toggleColumn function should handle both expand/collapse states

# Search for useKanban hook implementation
ast-grep --pattern $'export const useKanban = () => {
  $$$
  const toggleColumn = ($_, $_) => {
    $$$
  }
  $$$
}'

Length of output: 118


Script:

#!/bin/bash
# Try multiple approaches to find the implementation

# 1. Search for useKanban hook with less strict pattern
ast-grep --pattern 'const useKanban'

# 2. Search for toggleColumn function definition
ast-grep --pattern 'toggleColumn ='

# 3. Use ripgrep to find related files and implementations
rg "useKanban" -A 5
rg "toggleColumn" -A 5

# 4. Look for type definitions
rg "interface.*Kanban" -A 5

Length of output: 8883

apps/web/locales/zh.json (1)

28-28: LGTM! Translation is accurate and well-placed.

The Chinese translation "展开列" correctly represents "Expand Column" and follows the existing localization patterns.

apps/web/locales/he.json (1)

28-28: LGTM! Translation is accurate and well-placed.

The Hebrew translation "הרחב עמודה" correctly represents "Expand Column" and follows the existing localization patterns.

apps/web/locales/ar.json (1)

10-10: LGTM! Arabic translation is accurate.

The Arabic translation "توسيع العمود" correctly conveys "Expand Column" and maintains consistency with the existing collapse translation.

apps/web/locales/en.json (1)

37-37: LGTM! English text follows proper conventions.

The text "Expand Column" is clear, properly capitalized, and maintains consistency with the existing collapse text.

apps/web/locales/nl.json (1)

28-28: LGTM! Dutch translation is accurate.

The Dutch translation "Kolom uitvouwen" correctly conveys "Expand Column" and maintains consistency with the existing collapse translation.

apps/web/locales/bg.json (1)

28-28: LGTM! Translation looks good.

The Bulgarian translation "Разгъни колона" is semantically correct for "Expand Column" and follows the proper grammatical structure.

apps/web/locales/pl.json (1)

28-28: LGTM! Translation looks good.

The Polish translation "Rozwiń kolumnę" is semantically correct for "Expand Column" and uses proper case inflection.

apps/web/locales/it.json (1)

28-28: LGTM! Translation looks good.

The Italian translation "Espandi colonna" is semantically correct for "Expand Column" and follows proper Italian grammar rules.

apps/web/locales/ru.json (1)

28-28: LGTM! Translation looks accurate.

The Russian translation "Развернуть столбец" is correctly added and accurately conveys the meaning of "Expand Column" while maintaining proper grammar and capitalization.

apps/web/locales/pt.json (1)

28-28: LGTM! Translation looks accurate.

The Portuguese translation "Expandir Coluna" is correctly added and follows proper capitalization rules consistent with other translations in the file.

apps/web/locales/es.json (1)

28-28: LGTM! Translation looks accurate.

The Spanish translation "Expandir columna" is correctly added and maintains consistency with Spanish language conventions where common nouns are not capitalized.

apps/web/locales/de.json (1)

28-28: LGTM! Translation and placement are correct.

The German translation "Spalte ausklappen" is accurate for "Expand Column" and is appropriately placed next to the related "COLLAPSE_COLUMN" entry.

apps/web/locales/fr.json (1)

28-28: LGTM! Translation and placement are correct.

The French translation "Développer la colonne" is accurate for "Expand Column" and is appropriately placed next to the related "COLLAPSE_COLUMN" entry.


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. (Beta)
  • @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.

@evereq evereq merged commit 8a8ed83 into develop Feb 2, 2025
13 checks passed
@evereq evereq deleted the bug/Collapse-text-correct branch February 2, 2025 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect Text Display for Collapsed and Expanded Cards
3 participants