compose_box: Replace compose box with a banner when cannot post in a channel
When a user cannot post in a channel based on ZulipStream.channelPostPolicy, all parts of the compose box (in both channel and topic narrow) are replaced with a banner, saying: You do not have permission to post in this channel.
Screenshot
Screen recording
https://github.com/user-attachments/assets/c599db3c-755f-41b6-b119-0d6fc931f701
Fixes: #674
Thanks @chrisbobbe for the review! Revision pushed with the tests cleaned up. PTAL!
Thanks! Ah, it looks like this has gathered some conflicts—would you mind rebasing and resolving those please?
Conflicts resolved @chrisbobbe! Please have a look!
Thanks @chrisbobbe for the review. Pushed the new changes. Also added #886 comment. PTAL.
cc @PIG208
Thanks @PIG208 for the review. Changes pushed. PTAL.
Also added a few comments in the thread above.
Thanks @gnprice. Changes pushed.
Read through the changes and left some comments mostly for style and formatting. Thanks for the revision! The test changes look clean now; I noticed some changes that probably belongs to compose_box: Replace compose box with a banner when cannot post in a channel.
Thanks @PIG208 for the review. Changes pushed.
Looks good. Thanks! Moving this to Greg's review.
Thanks @gnprice for the previous review. New changes pushed. PTAL.
Also added a few comments just above and one in the previous review sub-thread.
Thanks @gnprice for the review. New changes pushed. Please have a look.
Thanks! Looks good — merging.
One commit-message tweak: I noticed the commits had two variants of what the prefix should be for compose-box changes: 388b83b2d compose test [nfc]: Add a parent test group f14e32dac compose_box: Replace compose box with a banner when cannot post in a channel
namely "compose" vs "compose_box". So I looked at past examples; the shorter "compose" form is what we used originally, and have still used many more times than "compose_box". So edited to "compose": 157418c26 compose: Replace compose box with a banner when cannot post in a channel
FTR here's the command I ended up using to see past usage:
git log --format='%>(20)%an %cs %h %<(26,trunc)%s' --grep compose origin | grep -P '\bcompose(.box)?|'
It's a bit more sophisticated than the quick git log --oneline --grep foo commands I've used many times.