-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
boxes: Disable stream change during edit. #870
Conversation
0f8752a
to
b73f19b
Compare
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.
@Abhirup-99 Thanks for working on this 👍
I would suggest restructuring to use stream_box_edit_view
solely to make the changes instead of the is_in_edit
state, self.stream_write_box
's nature can be overwritten inside stream_box_edit_view
since the latter is extended from stream_box_view
. You might have to mention self.header_write_box
to include the overwritten stream box in the header box, but it would reduce the extra boolean you currently need, considering that we have a separate edit view for such specifications.
Thanks for the review, I agree it's a valid concern that this should completely be done in the edit box but if I use |
6ed6932
to
fa8d43f
Compare
@Abhirup-99 I meant rewriting the self.stream_write_box = urwid.Text(u"")
self.header_write_box = urwid.Columns(
[self.stream_write_box, self.title_write_box],
dividechars=1
) |
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.
@Abhirup-99 I meant rewriting the
stream_write_box
to be aurwid.Text
or so (as appropriate), and then use it in the sameheader_write_box
as before. We wouldn't be changing the orientation or structure of theheader_write_box.
I believe theheader_write_box
's syntax or behavior shouldn't change.
Here's a snippet that might help make my suggestion clear for extending it in thestream_box_edit_view
.self.stream_write_box = urwid.Text(u"") self.header_write_box = urwid.Columns( [self.stream_write_box, self.title_write_box], dividechars=1 )
I got your point on this part, let me try adding a helper function for this change then because even with this approach, there would be code duplication.
fa8d43f
to
d964b47
Compare
@prah23 take a look now |
@Abhirup-99 It looks well segregated 👍. It seems a little more complicated now though, but I got your point about prioritizing non-redundant code. I'm probably still biased towards the stream_box_edit_view extension approach because though it needed registering the stream box again, it seemed simpler to understand for me. We can definitely wait for Neil's opinion, I just wanted to drop in some suggestions, in case they helped. Also, in your current approach, we wouldn't be needing the is_in_edit boolean, would we? Considering that you have separate views now. |
Yeah it's required while cycling through the tabs. |
d964b47
to
f9873be
Compare
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.
Thanks for working on this! The UI seems to be on the right path!
However, there is a scope for improving/simplifying the code logic. Leaving some quick comments below :)
f9873be
to
8c2d4fe
Compare
8c2d4fe
to
dc1cb07
Compare
I see there has been discussion about this - how ready is this? |
dc1cb07
to
aacda73
Compare
@neiljp this pr is ready for review. I have removed all conflicts. |
Heads up @Abhirup-99, we just merged some commits that conflict with the changes your 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 |
This code is merged after simplification as #1161, which was itself merged manually. |
Partially fixes #774