Skip to content

Improve typing & test approach for widgets #1576

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
4 tasks
neiljp opened this issue Apr 4, 2025 · 7 comments
Open
4 tasks

Improve typing & test approach for widgets #1576

neiljp opened this issue Apr 4, 2025 · 7 comments
Assignees
Labels
area: refactoring area: widgets GSoC Possible GSoC project component help wanted This issue should be clear enough to work on in progress TRACKING

Comments

@neiljp
Copy link
Collaborator

neiljp commented Apr 4, 2025

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 neiljp added area: widgets GSoC Possible GSoC project component help wanted This issue should be clear enough to work on TRACKING area: refactoring labels Apr 4, 2025
@zulipbot
Copy link
Member

zulipbot commented Apr 4, 2025

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

@ellikamishra
Copy link
Collaborator

I would like to work on this issue.

@apoorvapendse
Copy link
Collaborator

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

@ellikamishra
Copy link
Collaborator

@zulipbot claim

@zulipbot
Copy link
Member

zulipbot commented Apr 6, 2025

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)!

@Gopinath-Mahendiran
Copy link

@ellikamishra are you working on this ?

@ellikamishra
Copy link
Collaborator

@ellikamishra are you working on this ?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: refactoring area: widgets GSoC Possible GSoC project component help wanted This issue should be clear enough to work on in progress TRACKING
Projects
None yet
Development

No branches or pull requests

5 participants