Skip to content
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

Migrate UI & Docs from Private to Direct phrasing #1322

Merged
merged 8 commits into from
Mar 21, 2023

Conversation

theViz343
Copy link
Member

@theViz343 theViz343 commented Mar 13, 2023

What does this PR do?
This PR replaces instances of 'private' with 'direct', in the context of private messages, in the UI and relevant docs.
This is in line with the design decision to rename private message (PM) to direct message (DM).

Fixes #1288

CZO Discussion Link

Tested?

  • Manually
  • Existing tests (adapted, if necessary)
  • New tests added (for any new behavior)
  • Passed linting & tests (each commit)

Commit flow

  • First, second and fourth commits change UI elements from 'private' to 'direct'.
  • Third and fifth commits update the documentation.

Notes & Questions

  • Some UI changes like the keybinding help texts in the second commit do not result in test failures. Do we need to add tests for them?

@zulipbot zulipbot added size: L [Automatic label added by zulipbot] area: documentation Requires changes in documentation area: hotkeys area: UI General user interface update good first issue Good for newcomers labels Mar 13, 2023
@zulipbot
Copy link
Member

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

@theViz343 theViz343 marked this pull request as ready for review March 14, 2023 03:02
Copy link
Collaborator

@neiljp neiljp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theViz343 Thanks for looking into this 👍 Is there anything else visible to change?

I let a few comments inline. More generally, your commit message structure looks fine. However, there's no need to reference the issue in every commit, only the last one, and it can be on the final review - see the related notices that it gave in the issue already :)

zulipterminal/ui_tools/buttons.py Show resolved Hide resolved
zulipterminal/ui_tools/buttons.py Outdated Show resolved Hide resolved
zulipterminal/ui_tools/messages.py Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
@neiljp neiljp added the PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback label Mar 15, 2023
Copy link
Collaborator

@mounilKshah mounilKshah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR looks good to me at first glance. Apart from Neil's suggestions, I have left a comment for a minor modification.

As for hotkeys.md and developer-file-overview.md, as Neil has mentioned, it is better to have them in separate commits later, as they are not updated manually, instead, scripts are used for this purpose.

docs/getting-started.md Outdated Show resolved Hide resolved
@zulipbot zulipbot added size: XL [Automatic label added by zulipbot] and removed size: L [Automatic label added by zulipbot] labels Mar 17, 2023
@zulipbot
Copy link
Member

Hello @theViz343, it seems like you have referenced #1288 in your pull request description, but you have not referenced them in your commit message description(s). Referencing an issue in a commit message automatically closes the corresponding issue when the commit is merged, which makes the issue tracker easier to manage.

Please run git commit --amend in your command line client to amend your commit message description with Fixes #1288..

An example of a correctly-formatted commit:

commit fabd5e450374c8dde65ec35f02140383940fe146
Author: zulipbot
Date:   Sat Mar 18 13:42:40 2017 -0700

    pull requests: Check PR commits reference when issue is referenced.

    Fixes #51.

To learn how to write a great commit message, please refer to our guide.

@theViz343
Copy link
Member Author

I've made the changes requested. I've also added the test for the PM button text. It it looks good, I can add similar tests for the other sidebar buttons.
For the failing linting check, I'm going to squash the docstring change commit and the doc change commit that follows just after it.

Copy link
Collaborator

@neiljp neiljp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@theViz343 Mainly just feedback on the commit structure:

  • Please do squash those two commits together; it's not going to pass CI (or tools/check-branch) otherwise, and one change is directly associated with the other. If it's just the one doc file, you can refer to it more specifically as 'hotkeys' in the commit title prefix.

  • For the title shortening in developer-file-overview, that's not a rename, so it can be in a separate commit. "It also" suggests it's worthy of being separate, and it makes it clearer to tell what's happening from the commit titles. It would also be good as a commit directly before the buttons/docs commit, as you have now but more explicit in the title text.

  • If we're introducing a new test, it's good to keep it as a standalone commit before the associated code is changed. For your previous iteration of the code change, such a test would have hopefully both passed for the existing code, and then failed with the new version. Ordering the commits like that ensures that's the case.

  • Reviewing the commits again, the README change is a change to a 'prose' document (ie. not generated), so since small would fit with the general docs/ commit.

Re the test, this seems like two or more tests which can be split fairly easily:

  • The expected text, and maybe hotkey for this button; I say maybe since I'm not sure if we gain from specifying the hotkey, since it comes from the hotkeys dynamically
  • Ensuring a style for the buttons generally, in terms of the elements of the regex. While a regex is fine, it doesn't tell you how the text is incorrect, or which one is wrong, if it fails multiple elements. Separate checks for the elements you list in the regex comment would individually fail and show the assert condition, telling you specifically what was wrong.

For this PR let's leave it for PMButton only, to focus on the transition, though based on how the latter tests would be near-identical for other buttons, the code similarity also suggests we could refactor at least some of those buttons into one class.

@neiljp neiljp changed the title Issue 1288 private2direct Migrate UI & Docs from Private to Direct phrasing Mar 18, 2023
@theViz343
Copy link
Member Author

theViz343 commented Mar 18, 2023

The expected text, and maybe hotkey for this button; I say maybe since I'm not sure if we gain from specifying the hotkey, since it comes from the hotkeys dynamically

I agree with the hotkey not being useful to check here. Checking just the text should be fine.

Ensuring a style for the buttons generally, in terms of the elements of the regex. While a regex is fine, it doesn't tell you how the text is incorrect, or which one is wrong, if it fails multiple elements. Separate checks for the elements you list in the regex comment would individually fail and show the assert condition, telling you specifically what was wrong.

So, I think checking the length of the button_text (since it remains the same) should be sufficient, apart from checking the expected text. This will catch the most common errors, I suppose.

I've also moved the commit with the notifications change before any doc change commit to keep UI and doc changes separate.

This commit renames 'private messages' to 'direct messages' and
'private conversation' to 'direct message conversation' in narrow titles,
as well as when a user attempts to edit another user's direct message.

Tests updated.
This commit renames 'Private messages' to 'Direct messages' in the left
sidebar menu button.

Test updated.
This commit replaces the use of 'private' with 'direct' in
notifications when the user sets the 'Include content of direct
messages in desktop notifications' setting to False.

Test updated.
@neiljp neiljp added the PR soon to be merged PR has been reviewed & is ready to be merged label Mar 21, 2023
@neiljp neiljp added this to the Next Release milestone Mar 21, 2023
This commit renames 'private messages' to 'direct messages' in the
keys source file, affecting the in-application help menu.

hotkeys.md regenerated using lint-hotkeys.
This commit replaces the use of 'private' with 'direct' in the docs.
It also removes instances of PM (abbreviation for private message)
following the change in zulip#1293.
The maximum docstring length was reduced in 5745272, but the overview file
was not regenerated at that point, so the column width in the document was
not updated.

Therefore, this regenerates the file to make updating of docstrings clearer
later.
developer-file-overview.md regenerated using lint-docstring.
@neiljp neiljp removed the PR awaiting update PR has been reviewed & is awaiting update or response to reviewer feedback label Mar 21, 2023
@neiljp
Copy link
Collaborator

neiljp commented Mar 21, 2023

@theViz343 Thanks for the slight tidy 👍 I rephrased the commit text slightly, but otherwise this is as you wrote it, and I'll merge it now - thanks! 🎉

@neiljp neiljp merged commit 12181ac into zulip:main Mar 21, 2023
@neiljp neiljp removed their request for review March 21, 2023 15:32
@theViz343 theViz343 deleted the issue-1288-private2direct branch March 25, 2023 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: documentation Requires changes in documentation area: hotkeys area: UI General user interface update good first issue Good for newcomers PR soon to be merged PR has been reviewed & is ready to be merged size: XL [Automatic label added by zulipbot]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate UI & docs from "Private Messages" to "Direct Messages" text
4 participants