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

User-friendly date and time formatting.

Open plugyawn opened this issue 2 years ago • 6 comments

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: Screenshot 2022-04-29 at 1 11 14 PM

For user info: Screenshot 2022-04-29 at 1 11 01 PM

plugyawn avatar Apr 29 '22 20:04 plugyawn

@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.

neiljp avatar May 04 '22 05:05 neiljp

@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 : )

plugyawn avatar May 05 '22 18:05 plugyawn

@neiljp could you check the commit flow now?

plugyawn avatar May 06 '22 07:05 plugyawn

@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.

neiljp avatar May 06 '22 21:05 neiljp

@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.

plugyawn avatar Jun 05 '22 02:06 plugyawn

Reviews incorporated into the PR.

plugyawn avatar Aug 06 '22 03:08 plugyawn

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.

zulipbot avatar Apr 17 '24 23:04 zulipbot