-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
bugfix: ui: Focus on content_area when draft is opened from side-panels. #1044
Conversation
@zee-bit This is a nice simple fix 👍 Are there tests for this that can be amended to ensure this doesn't break? I'm happy to merge after we get clarification on a test. However, a good follow-up refactor would be to find some of the similar code associated with opening the compose box and ensure we do the same actions each time by wrapping it in new methods. That may also be useful for resolving things like #1042, though we'd need to check if that's quite the right solution. |
Thanks for looking at my PR, Neil. I |
ab5a0b0
to
c4d3693
Compare
@neiljp I had already updated this PR, if you wanted to re-review. I've added the tests for |
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.
@zee-bit Thanks for adding the test! 👍
Rather than having the first commit break, I'd suggest adding the bulk of
the test for the current behavior in the first commit - which should pass -
and then amending that test and adding the new behavior in the second
commit.
The test logic is rather complex with the mocks, but if we can refactor the
enter-compose functionality this should become much simpler, I expect.
c4d3693
to
05ff31a
Compare
The tests are a bit complex currently, I admit. But I am not sure if we should do the refactoring in this PR too. That would also require changing it for all enter-compose functionality, not just draft. The other way, we could get rid of those mocks or at least reduce the apparent redundancy(since other tests define similar mocks too) is to define them all once in the init function? btw, updated the PR according to your first point above. |
This commit fixes a bug that caused the focus to not move to the central area if the draft was opened from the side-panels. This is a minor bugfix that helps redirect the focus to the compose area in such cases. The recently added tests for OPEN_DRAFT are amended in this commit to match the added bugfix.
39f152c
to
472b623
Compare
@zee-bit Thanks for rearranging the test elements - that was my main interest for getting this merged initially, which I'm just about to do after some trimming to your commit text (each commit is independent so doesn't need to refer to the other) 🎉 If you want to take up the refactor please could you note that or open an issue? |
@neiljp Thanks for merging. |
This commit fixes a bug that caused the focus to not move to the content
area if the draft was opened from the side-panels. This is minor bugfix
that should set the focus to the message_column before setting it to
the footer(i.e. content_area).