-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add playback scaling #65
Conversation
pkg/session_recording/player.jsx
Outdated
@@ -620,6 +634,9 @@ | |||
|
|||
/* Skip packets we don't output */ | |||
if (!pkt.is_io || !pkt.is_output) { | |||
this.setState({cols: pkt.width, rows: pkt.height}); | |||
this.state.term.resize(pkt.width, pkt.height); | |||
this._transform(); |
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.
This will also execute on user input, which it shouldn't do. I think you need to rework this condition to only execute your part on !pkt.is_io
.
Well, I have one idea how this can be fixed - it's to use font-size in view
point size and then transform, I'll check this.
…On Thu, Nov 30, 2017 at 9:58 AM, Nikolai Kondrashov < ***@***.***> wrote:
Thank you, Kyrill. I tried this right now and looks great. There is one
problem, however: the terminal width seems to be constrained by less than
the container width, if the browser view zoom is not 100%. Can anything be
done about this? Here's a screenshot:
[image: terminal_width_constrained]
<https://user-images.githubusercontent.com/549246/33422143-572d6d14-d5bd-11e7-9d00-b11802ea888d.png>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#65 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFTQ5UeQHbbj4PJ3DM25qVdws3d67puAks5s7m4_gaJpZM4Qr3qh>
.
--
Kyrylo Gliebov
Software Engineer
Red Hat Czech
|
As for matching size of the container, it was not a problem at all, only thing why it was appearing, that container has fluid width ( according to window size ) and I have had a static value of 630px, so now I've changed this to get actual wrapper's width, this will allow us in future to create full-screen or resizing of container features. |
https://youtu.be/9EAN6Id1YxE |
Also, I've forgot to add one more detail - I've had the idea to add feature as a hand scrolling - for example - you zoomed in and you would just use drag'n'drop to move through content and not the scrollbars, but now I'm not sure if that should be there, because that will remove ability to select text and copy it! But it is possible to create some sort of switch ( button ) between regular cursor to work with text and drag'n'drop. |
Niice, this feels much better, and it seems the issue with non-100% zoom levels is gone. Yes, I think we need to fix the non-centered zoom-in/out as it's confusing. How about we merge the part which keeps the terminal within bounds first, and then work on scrolling/zooming/panning? That way we'll have something working merged already. Yeah, "panning" can be done with a button, although it wouldn't be very convenient to use. Perhaps we can do the button (like http://fontawesome.io/icon/hand-paper-o/), and add a hotkey for turning it on or off, and/or a hotkey which would enable panning while pressed (i.e. hold the key and drag the screen, otherwise select). One thing that I keep noticing is that intermediate window resizes seem to disappear and window jumps through them when skipping, unless there's I/O. Perhaps the main playback routine needs fixing. Can you check that? Regarding the extra characters, could you please provide me with the original logs, where that reproduces? You can use the |
Oh, and another thing: the "zoom to fit" icon seems a bit confusing to me. Do you think we can draw and/or use something like a "square under a lens" icon? E.g. something like these: https://www.iconfinder.com/search/?q=zoom+fit |
Yes, for now, if you will play or skip frames zoom levels will be switched back to match container ( not preserving zoom levels basically ). |
I think we should stick with font awesome to keep overall style. I'll add hotkeys and split commits in two - for playback scaling and for controls |
I've separated commits and now in this PR it's only commit for scaling without buttons. |
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.
Thank you, Kyrill! This looks alright aside from the inline comments.
However, I notice that the playback area gets a scrollbar sometimes, which covers parts of the terminal, especially at extreme proportions. Can that be fixed somehow?
pkg/session_recording/player.jsx
Outdated
@@ -473,6 +474,8 @@ | |||
paused: true, | |||
/* Speed exponent */ | |||
speedExp: 0, | |||
scale: 1, | |||
container_width: 630, |
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.
Could you please keep values aligned here?
pkg/session_recording/player.jsx
Outdated
_transform(width, height) { | ||
var relation = Math.min( | ||
this.state.container_width / this.state.term.element.offsetWidth, | ||
290 / this.state.term.element.offsetHeight |
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.
What is this 290
? Could you please use a constant with a name which would give a clue instead?
pkg/session_recording/player.jsx
Outdated
@@ -620,6 +639,8 @@ | |||
|
|||
/* Skip packets we don't output */ | |||
if (!pkt.is_io || !pkt.is_output) { | |||
this.state.term.resize(pkt.width, pkt.height); | |||
this._transform(pkt.width, pkt.height); |
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.
This is also being called on "input" packets, not only on "window" packets. You're not hitting this now, because input is not recorded by default. Please fix.
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.
Essentially, instead of adding code here, the if
condition should be changed to pkt.is_io && !pkt.is_output
, and the code added instead after the "Output the packet" comment below, branching on output/window packet type. This would also fix the timing issues with window resizing.
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.
Yes, I'm doing this now. Just missed this problem before. Thanks for clarifying, I was about to use just if (pkt.is_output)
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.
I've made a bit different change, not sure if it's okay, but my implementation of your provided idea did not work, let's also discuss this tomorrow, probably I'm missing something.
I think that there's value in a blinking cursor, and we can discuss that, but let's not lump that change with this one. |
c2ec90f
to
9da7540
Compare
I've removed removal of blinking cursor and added ours together if/else fix from meeting. |
I took a look at this today and it feels much better. However, I see that sometimes window resize and repaint play back with a huge delay between them. I'm not sure where that comes from. Will investigate tomorrow. |
@sabbaka, I still see the old resizing code in the commit, not the one we arrived at on our meeting. Have you forgotten to commit/push something, perhaps? |
I’ll need to check that.
On Tue, 12 Dec 2017 at 8:53, Nikolai Kondrashov ***@***.***> wrote:
@sabbaka <https://github.com/sabbaka>, I still see the old resizing code
in the commit, not the one we arrived at on our meeting. Have you forgotten
to commit/push something, perhaps?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#65 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AFTQ5UDHDSpIzHx5rd8-yLCG2aks9y-Mks5s_jDLgaJpZM4Qr3qh>
.
--
Kyrylo Gliebov
Software Engineer
Red Hat Czech
|
Code should be fine now, it seems that I've just forgot to push. |
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.
Apart from the three inline style comments, this looks and works great! Thank you, Kyrill.
pkg/session_recording/player.jsx
Outdated
@@ -473,8 +474,12 @@ | |||
paused: true, | |||
/* Speed exponent */ | |||
speedExp: 0, | |||
scale: 1, | |||
containerWidth: 630, |
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.
Please align the new values with the rest.
pkg/session_recording/player.jsx
Outdated
@@ -532,7 +537,7 @@ | |||
cols: this.state.cols, | |||
rows: this.state.rows, | |||
screenKeys: true, | |||
useStyle: true | |||
useStyle: true, |
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.
Please remove this unnecessary change.
pkg/session_recording/player.jsx
Outdated
@@ -617,9 +637,8 @@ | |||
this.awaitPacket(); | |||
return; | |||
} | |||
|
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.
Please remove this unnecessary change.
I've made changes, but I'm not sure if I understand how to align correctly. |
Thank you. Just make them all appear on the same column. Like this: cols: 80,
rows: 25,
title: _("Player"),
term: null,
paused: true,
/* Speed exponent */
speedExp: 0,
containerWidth: 630,
scale: 1 |
Use css transform property
Thanks a lot, looks and works great! Can you do a demo on today's meeting? Another thing: could you please leave a comment when you're done fixing up things in response to review? I just don't get any updates from GitHub when you're force-pushing over a commit, without adding a new one. And even when you add a new one, it would be great to get a comment from you saying you're done. |
Yes, I will do the demo. |
Use css transform property