-
Notifications
You must be signed in to change notification settings - Fork 490
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
Feature - CLI Tutor Mode #1572
Feature - CLI Tutor Mode #1572
Conversation
@jessicaschilling here's the draft for cli tutor mode, the place which would need more attention is files component, since it has a lot of shared state, please check this out and suggest any refactors/changes for places where i might have broken any acceptable coding patterns. I'll update this PR tomorrow with little of code cleanup and modal actions alignment fix |
Thanks, @jay-dee7! I'd like @rafaelramalho19 to look through this in more detail ... but just a heads up that he's on holiday for the next week. Don't want you to think that we are ignoring you. 😊 |
That's okay @jessicaschilling. In-fact apologies for the delay. This should've been up way before than it did. In the meantime I'll keep on iterating over this, just to see if anything can be improved upon 😄 |
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.
A few quick thoughts before @rafaelramalho19 reviews; two review comments inline for text changes, too:
- Can you please center text in the "Close" and "Copy" buttons in the modal?
- For the example shown (IPFS config file) - if the user just pastes
ipfs config replace settings.json
into their terminal, this won't actually work, because there's no context of settings.json. Or is this what you mean by the download icon - is that supposed to download the changes made in the window to a file settings.json? If it's the latter, we'll need to make that more clear (and there will still be issues, because just "settings.json" won't necessarily be the right directory level). - Overall, can you please make the size of the clipboard icon a little smaller, based on a vertical height to visually match the vertical height of the trash can icon in the three-dots context menu? (Understood that this might be numerically smaller than the trash can vertically due to inconsistencies in icon aspect ratios.)
I'll have a deeper look when you're done with your cleanup, too. 😊 Thanks!
sure @jessicaschilling i'll make these changes ASAP. There are more things that I didn't notice initially. ContextMenu in files pages needs some work, after rebasing, the copy icon and the text aren't aligned symmetrically and some of the commands aren't correct (as in rename command in files page). I'll need some sort of verification if the commands that i did add are the correct ones. |
cb8ded0
to
cd222ef
Compare
@jessicaschilling I rebased from master just a while ago, one of the incoming changes were in |
Thanks, @jay-dee7! |
<CopyIcon | ||
onClick={setCliTutorModal} | ||
className='dib fill-current-color ph2 glow o-80 pointer' | ||
style={{ height: '28px', transform: 'scale(1.5)', verticalAlign: 'bottom', color: 'dodgerblue' }} |
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 scale can lead to some issues in Safari. Can you try and make it without the scale?
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.
for this, i have now added two options, one using just the bigger pixel size (height is increased) and another one using msTransform
and webkitTransform
. I can quickly stick to one solution but as far as i can tell, they both work as expected. webkitTransform
worked okay for me on safari too
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.
It works, the problem is that it renders a pixelated icon in safari (old issue unfortunately), so I would just stick with increasing the height
src/files/dropdown/Dropdown.js
Outdated
</button> | ||
<button {...props} className={`bg-animate hover-bg-near-white pa2 pointer flex items-center ${className}`}> | ||
<CopyIcon {...props} onClick={onCliTutorMode} className='dib fill-current-color ph2 glow o-80 pointer' | ||
style={{ height: '28px', transform: 'scale(1.3)', color: 'dodgerblue' }} |
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.
Try to avoid the transform (same as commented before)
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.
added a css class for this with webkitTransform
but it would also work if we simple increased the height by 1.3X. Lemme know which way we'd like to move forward with :)
Signed-off-by: Jasdeep Singh <[email protected]>
Co-authored-by: Jessica Schilling <[email protected]>
Co-authored-by: Jessica Schilling <[email protected]>
Signed-off-by: Jasdeep Singh <[email protected]>
Signed-off-by: Jasdeep Singh <[email protected]>
8890925
to
6ff45e4
Compare
After you remove the transforms, LGTM 😄 |
Signed-off-by: Jasdeep Singh <[email protected]>
6ff45e4
to
97a06b0
Compare
thanks for the amazing review @rafaelramalho19, i've change the css class to use just height and no transforms :) |
Sure @jessicaschilling I'll make the change ASAP :) |
@jay-dee7 And thanks for spotting the misaligned checkbox! Fixed it. 😊 |
Signed-off-by: Jasdeep Singh <[email protected]>
Signed-off-by: Jasdeep Singh <[email protected]>
…bui into jay-dee7/cli-tutor-mode
@jessicaschilling @lidel i've added both the requested points. Also, I've added a fix for rename command. I realized that we need to preserve the file path while renaming and we should wrap the full path path with quotes (""), because it'll throw errors if the full path contains spaces (for example a file named |
@lidel - I'm happy but will wait for your OK, please feel free to merge 😊 |
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.
@jay-dee7 nearly there! small asks inline 🙏
…dList Signed-off-by: Jasdeep Singh <[email protected]>
Without this below will fail: ipfs files rm -r /test/white space/flowers.jpeg
This removed CLI tutor from "API Adddress" selector because it does not make sense: "API ADDRESS" section does not change the config of IPFS node, but defines the API which WebUI will use when connecting to the node.
text between < and > won't be translated because Transifex blackboxes HTML tags, it is better to remove it
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 made small tweaks in 9821bc8, 7d71641 and 8cc6d85 and run all tests locally (because CI missed them: #1595).
Everything looks ok, but i'm afk till Tuesday so leaving this open in case someone has time to tackle i18n issue described below.
If not, ok to merge and tackle the problem in separate PR.
Note on i18n: Duplicated of translation keys (cliModal
and actions
) are not the best, but fallbackNS
does not work correctly in i18next for some reason, and I understand why it has to be like this for now. I spent some time today trying to find a fix but it proved to be huge time sink and a rabbit hole of i18next internals: we may need to leave duplicated keys as they are and revisit in separate PR.
Transifex will automatically fill all places when at least one of them is translated, so in practice it should not be a problem, and it will be easy to deduplicate keys in the future, if the issue is resolved upstream.
@lidel — Unless I'm missing something, I believe 881bcbf and 84b6cf4 take care of this ... per i18next docs we can explicitly reference a different namespace than the default one we declare for a given file. I added the i18n keys for If this approach makes sense to you, there's an opportunity to remove other duplicate keys throughout the project — especially in the |
The way import via Webui works is: 1. `ipfs add` produces CID 2. we create a reference to that CID in MFS We do this to produce the same CID as regular ipfs add from CLI would do, mainly to avoid issue described in: ipfs#676
Right now CLI tutor defaults to MFS root at /, this makes it easier to include current path in the future.
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 @jessicaschilling, I think the old i18next issue is gone, all looks good.
I've made a small fix in 5641184 to ensure CLI tutor lists import actions as the button in GUI
(ipfs add && ipfs files cp
, context: #676)
nit: CLI tutor for Import commands ignores the fact we may be in a subdirectory.
Ideally /<dest-name>
in import commands would be replaced with "${path}/<dest-name>"
where path
is the current dir in MFS. I started doing that in 3a337de but had no bandwidth to wire it up.
I think it's ok to merge with static destination, but if anyone has time to ensure path
is set for these actions that would be even better for user experience.
@lidel -- Thanks for calling the subdirectory detail out. I'm inclined to merge this as-is and address that in a separate issue (#1601), since I suspect we may want to make some tweaks to tutor mode overall after this gets into the hands of users for a bit. I've also opened #1600 for consolidating repeat-use i18n keys, which I can probably take care of in the next week or two. Thanks all (especially @jay-dee7!) for all of the work! |
Adds the CLI Tutor Mode, which can help with learning the IPFS Command Line Interface from the Webui/Desktop. This feature was requested in #1421
Done
copy-icon
📋 is shown next to the buttons/menus where those actions can be performed via IPFS' CLI+ Import
menu (Add File, Folder, Copy from IFPS)+ Add Connection
Reset
button in config edit boxSetting Page -> next toSubmit
button in API edit boxPending Work:
I recently discovered a state management issue with the modals, I couldn't find the root cause so far, it started happening after the refactor today (1st Aug 2020)After rebasing from master today, there's a small UI glitch (text in the modal actions is left aligned, I'll work it out before making this PR reviewable)I have added a bunch of TODO's in the code, which can potentially help with the code cleanupFiles component kind of looks like a mess right now, a lot of state is being shared across mulitple components (maybe we can refactor it to make it look neat)Here's a visual for how it looks in action: [Jessica note: these are a bit outdated now since commits for visual tweaks on 12 Aug]
Settings Page | Option to enable CLI Tutor Mode
Files Page | CLI Tutor Mode Enabled
Settings Page | CLI Tutor Mode - Open Modal
Signed-off-by: Jasdeep Singh [email protected]