zulip-terminal
zulip-terminal copied to clipboard
User-friendly date and time formatting.
What does this PR do? Adds user friendly times to the user and message info views. The current view just includes the timestamp, which is hard to decipher.
Partial fix for issues #1211 and addresses #1086
Tested?
- [x] Manually
- [x] Existing tests (adapted, if necessary)
- [x] New tests added (for any new behavior)
- [x] Passed linting & tests (each commit)
Commit flow
- first commit adds a helper function to friendly-fy the timestamps.
- second commit implements the helper function in views.py for message and user info popups.
Notes & Questions
Interactions
Visual changes
For message info:
For user info:
@plugyawn You saw my feedback in the stream, but essentially:
- this is unstable right now, at least with the issue @mounilKshah pointed out, as well as for me
- actual timestamps rather than formatted dates would likely be more reliable for comparison
- tests would make it easier to provide potential buggy inputs and get them working
- git commit style could be improved, as we discussed via gitlint.
@plugyawn You saw my feedback in the stream, but essentially:
- this is unstable right now, at least with the issue @mounilKshah pointed out, as well as for me
- actual timestamps rather than formatted dates would likely be more reliable for comparison
- tests would make it easier to provide potential buggy inputs and get them working
- git commit style could be improved, as we discussed via gitlint.
Sorry for the late reply!
- @mounilKshah thanks for pointing out the error! I've fixed it.
- Agreed, I'll check into that. In this case, though, do you think it'll make much of a difference?
- On it! I'll get started with adding tests.
- I set up gitlint, hopefully it's working now : )
@neiljp could you check the commit flow now?
@plugyawn As per discussion in the stream, you really need a rebase (or other adjustment) since you seem to have squashed commits from upstream/main or another PR into one of these commits.
@mounilKshah @neiljp Could you check this now? I think the changes I made in test_popups.py need to be changed -- but I'm unsure as to what those changes should be.
Also, I've made sure the commits only contain changes in their respective files, as you said. Editing the commits and running commit --amend was the solution, as you said.
Reviews incorporated into the PR.
Heads up @plugyawn, we just merged some commits that conflict with the changes you made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/main
branch and resolve your pull request's merge conflicts accordingly.