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
stream_settings: Fix stream row switching behavior when adding subscribers. #29839
stream_settings: Fix stream row switching behavior when adding subscribers. #29839
Conversation
53ebe5b
to
c625852
Compare
Info: still missing some test and proper linting, but decided to up this PR to get feedback early |
c625852
to
4a654d9
Compare
update: added a new test and fixed linting |
4a654d9
to
59119f4
Compare
Thanks! @sahil839 are you up for reviewing this one? I haven't tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posted a couple of comments.
59119f4
to
bfda9fa
Compare
@sahil839 Thanks for reviewing. I've addressed your comments for the PR and have tested it again. Let me know if there are any other changes you'd like to suggest 👍 |
Just a small point - "Fixes .." line in commit message should end with a period. Looks good otherwise. @timabbott ready for your review. |
bfda9fa
to
b653eea
Compare
|
||
window.location.hash = "#some/random/place/subscribers"; | ||
assert.equal(hash_parser.is_subscribers_section_opened_for_stream(), false); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add a test for something more like the empty string.
Add a rule to the switch_rows(event) function to avoid switching stream row when pressing up/down key by checking the current URL hash and the add_subscribers_pill focus state. Add a utility function to hash_parser to help implement new switch_rows behavior mentioned above. Fixes zulip#29690.
b653eea
to
02a40f3
Compare
Made the small test tweak noted above and merged, thanks @PieterCK! |
📑 Overview
The root cause of the bug is that the
switch_rows(event)
function instream_settings_ui.js
does not consider whether the user is currently editing theadd_subscriber_pill
input in the right panel of the stream settings menu for the key up/down event to trigger the stream row switching process.Adjusted the
switch_rows(event)
behavior by adding a condition to prevent switching stream row when the user in the subscriber tab on stream settings menu (hash_parser.is_on_stream_subscribers()
) and is focused on theadd_subscribers_pill
inputFixes #29690
CZO
Screenshots and screen captures:
Screencast.from.25-04-24.17.46.54.webm
Self-review checklist
(variable names, code reuse, readability, etc.).
Communicate decisions, questions, and potential concerns.
Individual commits are ready for review (see commit discipline).
Completed manual review and testing of the following: