Skip to content

Use max_topic_length instead of hardcoded limit of 60 #1413

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

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

Conversation

AhmedTareek
Copy link

@AhmedTareek AhmedTareek commented Mar 16, 2025

Fixes: #307

Changes

  • Added maxTopicLength field to the initial snapshot to retrieve the value from the server.
  • Stored maxTopicLength in PerAccountStore from the initial snapshot.
  • Updated ComposeTopicController in compose_box to use the value from PerAccountStore.
  • Removed the hardcoded value which was in route/messages.dart
  • Modified app_en.arb to dynamically display the maxTopicLength value in the topic length error message, replacing the hardcoded "60"
  • Changed the _send method of compose_box to use the modified error message that contains the dynamic maxTopicLength

Testing

  • Updated tests to use the new value from PerAccountStore instead of the hardcoded value.
  • Confirmed the new behavior by running existing tests with multiple maxTopicLength variants.

@chrisbobbe
Copy link
Collaborator

@AhmedTareek AhmedTareek marked this pull request as ready for review March 18, 2025 04:14
@AhmedTareek
Copy link
Author

Tests are added and I think it's ready for review now.

Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

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

Thanks! Small comments below, and please organize your commits so they're clear and coherent according to the project style: https://github.com/zulip/zulip-mobile/blob/master/docs/style.md#git-commits-commit-messages

@AhmedTareek AhmedTareek force-pushed the main branch 2 times, most recently from 5c616c7 to 98bbfde Compare March 26, 2025 13:05
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.

Use max_topic_length instead of hardcoded limit of 60
2 participants