zulip-flutter icon indicating copy to clipboard operation
zulip-flutter copied to clipboard

Use max_topic_length instead of hardcoded limit of 60

Open AhmedTareek opened this issue 8 months ago • 2 comments

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.

AhmedTareek avatar Mar 16 '25 03:03 AhmedTareek