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

Improve typing & test approach for widgets

Open neiljp opened this issue 8 months ago • 8 comments

Following up on earlier work on polls and todo widget handling in messages, this could involve:

  • [ ] Use TypedDict (or dataclass) for the result of process_todo_widget (and for polls) instead of a nested dict with a union.
  • [ ] Consider if the extracted JSON should match specific types, that we can define using TypedDict or similar too.
  • [ ] Consider factory fixtures for the Submessage content in tests.
  • [ ] Move Submessage into api_types.py, and use it to improve the definition of Message.

See # zulip-terminal > Widget followup work for the original listing of these points and for followup discussion. These points arose in earlier work on widget implementation, so you might read those PRs to understand the background further.

neiljp avatar Apr 04 '25 15:04 neiljp

Hello @zulip/server-refactoring members, this issue was labeled with the "area: refactoring" label, so you may want to check it out!

zulipbot avatar Apr 04 '25 15:04 zulipbot

I would like to work on this issue.

ellikamishra avatar Apr 06 '25 05:04 ellikamishra

Hey @ellikamishra, you can claim the issue using @zulipbot claim Checkout this section of the contributing guide for more info.

apoorvapendse avatar Apr 06 '25 05:04 apoorvapendse

@zulipbot claim

ellikamishra avatar Apr 06 '25 05:04 ellikamishra

Welcome to Zulip, @ellikamishra! We just sent you an invite to collaborate on this repository at https://github.com/zulip/zulip-terminal/invitations. Please accept this invite in order to claim this issue and begin a fun, rewarding experience contributing to Zulip!

Here's some tips to get you off to a good start:

As you work on this issue, you'll also want to refer to the Zulip code contribution guide, as well as the rest of the developer documentation on that site.

See you on the other side (that is, the pull request side)!

zulipbot avatar Apr 06 '25 05:04 zulipbot

@ellikamishra are you working on this ?

Gopinath-Mahendiran avatar Apr 25 '25 17:04 Gopinath-Mahendiran

@ellikamishra are you working on this ?

Yes

ellikamishra avatar Apr 27 '25 16:04 ellikamishra

Hi @neiljp and @ellikamishra, I’m also interested in working on this issue as part of my GSoC and Zulip open-source contribution journey.

If ellikamishra is no longer actively working on this, I’d love to take over or collaborate. Please let me know if that would be okay — I’ve gone through the related discussions and PR,s and would be excited to help move this forward.

Thanks!

Subham-KRLX avatar Jun 17 '25 02:06 Subham-KRLX