-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
windows version #74
windows version #74
Conversation
ok, it build now on linux and mac in github CI, I dont have a mac. of course the github CI doesnt build the windows version All the tests fail, but they at least compile. Also on linux the terminal is left in an odd state, needs a reset command. Noy investigated at all. |
Awesome. :) Let's start iterating over this. I think the first step would be to get the tests to pass. I'd start by commenting out the terminal_events assertion in each test and seeing if the snapshot tests after it pass. If they do, you can update the terminal events. Once that's done, I think we'll be very close to merging. Another question that came to my mind today: how do the paths look on windows? do they make sense? (with all the backslashes, C:\ stuff, etc.?) |
they have \ in them. |
OK, progress I changed the display of paths to always be / in tests. Most tests passed after that. I actually prefer the / display, many dev oriented tools show / on windows there are 4 failing tests
Worth noting. crossterm key codes combine the character and the control keys. So I had to add a new key! macro sub match of sh_char. If you look for the detection of + you will see I have to test for + char with or without shift key; there are 2 plusses on my kb on that needs shift (above =) and one that doesnt (on the num pad) |
Happy to hear. :) Just a heads up, I won't have time to look at this today - promise to get to it tomorrow. |
Hrm - for me it's actually failing for a different reason. In the
I see... alright, we can skip this test on window for now.
This also fails for a different reason for me. The layout is a little different in one of the snapshots (even though it's still correct). Also for me, when I run this on a large folder (eg the root of my hd), the loading animation of the text above looks wrong. One letter always stays bold after the wave has passed. Maybe before debugging this though, let's make sure we're on the same page regarding the failures? If the failures are different for you, maybe we can try and understand why? |
first one. I see the same error. I looked in the .snap file it doesnt have the (x=small files) in it, even though the UI always displays that no matter how wide or narrow the display. I assumed that the diff engine was picking up the '(' of the (x=small files). But the .new snap only has the '('. On screen when using the app, as far as I can see termion version and crossterm version look identical with those files |
last one, I dont fully understand the issue, the test infratrusture is pretty complex but I am sure we are seeing the same thing. It was just my interpretation |
I noticed an off by 1 on the title line too. sometimes I see CC:/foo/bar instead of C/foo/bar. I will continue to investigate. Here it is on linux maybe if i track that down the others will resolve too BTW - I am also looking at the memory hog issue. I think that can be dramatically improved, I am currently arm-wrestling with the rust lifetime checker over something :-( |
well the out by one errors I was seeing were fixed by pulling the latest tui and crossterm. the crates.io versions dont fix it. It seems to be tui version, I tried to see if they had any recent closed issues that looked relevant but could not see any. Sadly that does not fix the test failures :(. They definitely had an out by one error on the first draw diff of each redraw. |
fixed error number 1, breaking change in latest tui. They changed the way styles are set, I already had to update yr code because the modifier fn was removed and add / remove modifiers fns added instead. But there are more subtle effects. I filed issue with tui but worked around it for the bottomline.rs. changed
to
If you draw over an exisitng string (which you are doing here sometimes, and for sure in the test) in the old code style::default forced that cell to 'plain., In the new code new style is merged in, and merging style::default does nothing because its empty. So I have made a style that forces 'plain' I realized that the tests have nothing to do with changing to crossterm, you are using your own backend. I will fix #4 next |
still #1, actually you have an out by one error, it was harmless but that tui change exposed it. the problem is that you are rendering a last line that goes '.......long_name' in fact there is only enough space for '....long_nam' so you should have displayed nothing according to render_currently_selected, but in fact you place 'long_name' in the buffer. The final 'e' is where the '(' of (X=small files) overwrites the buffer and messes the style. The out by one is because you pass in |
for #4. The test is wrong. I run your current install version set up exactly as per the test it doesnt do what the test says it should do. There are 5 files. The test goes, and this is what my test build and yr current installable download show
the snapshots have
it missed the screen with 3 & 1 being shown, it goes straight to the fully zoomed out. In many cases you add extra padding events.push(None), you did not do that in this test, maybe thats why. |
found the tui bug that caused the out by one errors in the title fdehau/tui-rs#347. not in crates.io yet, only in github main |
Wow, great work @pm100!! My apologies if the code base here is a little rough around the edges or too complex at times. Not so many people have gone through it yet, and I think in certain cases you're a pioneer. I find your input very valuable. About the snapshots: you're right, I also noted the mistake in that test when doing some debugging the other day. If you want to fix it to do the right thing, that would be great - but no stress over it. If the mistake was already there, it's not too bad to leave it for another time IMO. Otherwise: is there anything else I can clarify, explain or that you want me to take a look at? This turned out to be quite a complex fix, I see. |
LOL, I was going to comment on how cool I thought the code was. First time I have looked into this kind of app (text based GUI). I have a ton of spare time, retired former founder/CTO/architect/Lead Dev, got bored and decided to learn rust. "but no stress over it" - compared to what my job was like this is truly fun. Zero pressure :-) Anyway I can fix that test. |
still on test fail #1 Complex here. The original failure was because tui has a bug when overlapping text is drawn fdehau/tui-rs#378. However, as I pointed out, your code tries to not write overlapping text, but it has an out by 1 error. You have 3 candidate bottom lines depending on how much space you have, in this test you should choose the last one (plain file name, no word 'SELECTED" , no sizes) but you in fact display the second one "SELECTED: xxxxx"but no sizes. and the last letter gets chopped by the ( Now I fixed your out by one and the correct message is displayed . But now the test fails :-( I think I should correct the test since it blesses incorrect output at the moment. |
WOOHOO!!
|
Very cool. :) I'm away tomorrow, so will take a deeper look on Tuesday. |
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.
So I've gone over this. Great work, and thanks for putting so much effort into doing this!
I ran this locally and it looks great.
I left some nitpicks in the code, mostly some things we need to clean up and re-adding the event assertions in the tests.
One thing I mentioned and am a little concerned about is getting the TUI dependency from github. It would be far better to get it from crates.io, because github is mutable (even if we point to a specific commit, it can be changed - maliciously or accidentally with a history re-write). As I mentioned in the comment, I think it would be best to open an issue and ask about the release if we're stuck because of it. Maybe they'll agree to just release what we need if they have bigger things in the pipeline? At least we can understand the timeframe and act accordingly.
Looking forward to seeing this merged soon!
src/tests/cases/snapshots/diskonaut__tests__cases__ui__zoom_into_small_files-8.snap
Show resolved
Hide resolved
I will clean all these up. I mentioned earlier that I was not happy with the pointer to tui github. I will ask them to push a new version to crates.io. In the mean time I will fork a copy and point at that (just to ensure no unexpected changes go through). Or maybe you would prefer to fork it. |
OK all done as per request. All test uncommented, command sequences redone. The only possible work item left is the 2 'commented out' tests for windows due to how file permissions work. I can look at those if you like (ex MSFT person here). But lets get this merged and then create new issue cos that will take some time. Anyway this has been fun. First time on github, first time using git, first rust collaboration. |
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.
Looks great, my friend! I made some minor changes (mostly deleting printlns and outdated comments) and I'm very happy to go ahead and merge this now.
This has been fun for me as well. If you'd like to solve those windows test, that would be great. And of course, I'd be very happy to see more contributions from you if you so wish. :)
Could you please add windows version to the release? |
100% conversion to crossterm (no dual mode)
seems to work fine, test on windows 10 using new windows terminal and powershell
works on my rasp pi system too
tests all compile but dont run