-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
💡 [FEAT] Ability to yank and paste entire todo's #76
Comments
Hi @atidyshirt! Thanks for the feature idea! I was actually wondering how to make such a feature to move the todos within the app! This sounds good and can be a great implementation!
Thanks, bud! I really appreciate it 😄
Of course, I am also willing to help if you need any 😄 |
Hi @kraanzu, Oh I have been working on this using the main branch, thanks for letting me know :) I will switch branches and take a look at how to bring my implementation across. (I have never used rich or TUI interfaces in python before, but starting to understand the code now). Hopefully I will be back with a PR soon |
Awesoome! Good luck :) Here's the documention for textual if you need any help: |
Quick question, I am guessing that the Just wondering as I have seen some weird events while debugging and am not sure if it is the new code or if I have configured something wrong or written some bad code 😄 |
Haha...thought so! But there aren't many now :( this is the test file I use which should run the app: from dooit.__init__ import main
main() Can I ask what Kind of issues are you facing? Have you upgraded textual to the latest version? |
I think I may have introduced one, not sure. I have experienced occasional freezing and sometimes Issues (at least in my build env...) first time using
Potentially its the way I am running it, my current method is using these three commands:
Do not feel pressured at all, I am in no rush 😄 , just curios if there was any known issues. Might also be note worthy that I am currently on a ARM Macbook |
Hmm.. This might be because well I'm updating the data and then re-updating the UI. I'll have to optimize this :)
Oh you can use ctrl+c for now. I thought I would take care of these stuffs in the end haha
Hmm...this should be running fine. Will check!
Haha Probably :) |
CHANGES: - Implemented `insert_item` method * NOTE: this should probably be updated to be independent of `Storage.clipboard` function as this might be nice to re-use. * TODO: Update this method to take in a parameter to insert a node and its sub-entities. - Added `Storage.clipboard` singleton class to store elements of any type on the clipboard. - Added wrapper functions in `todo_list` and `tree` for insert method
CHANGES: - Added a flag to be passed through to indicate whether to be pusing the result as a child node or as a parent node - Enforcing that we are clearing the paste bin on each paste - Refactored the `insert_item` method as a generic (independent of using clipboard or not), can now be re-used for future functionality
Thats all I have in me tonight! Couple of notes on this: If you can think of a better method to handle the clipboard management then the implemented method, I am all ears (i.e the following): @dataclass
class S_Storage:
instance = None
def __init__(self):
S_Storage.instance = self
self._clipboard = None
class Storage:
clipboard = S_Storage.instance._clipboard if S_Storage.instance else S_Storage()._clipboard There is still a couple of things to fix in here, will submit a PR when this is ready |
Awesome! This looks good. Thanks for the wonderful addition!
Yep Yep. I'll work on it too and hopefully remove some bugs along the way :) |
Done!
Fixed!
I've implemented lazy load. Can you check if it's still freezing for ya? Edit:
Nah Ig this ain't making any difference. It's the framework :( |
I will retest tomorrow and see if what problems are present, pasting todos is now functional, 'P' go paste as child, 'p' to paste as sibling, and todo's are copied using the 'remove' method ('x') (removed and copied node to the clipboard). I have a couple of questions about copying todo's, I have noticed that we cannot have two todos with the same description at the same level? So as far as implementing copy, I guess we want to achieve the following implementation:
Is this how you would want it to work? Possibly implemented with 'y' for copying the node and only description with 'Y' would be my personal preference of keybinds, but as they are interchangable I'm happy to set the defaults to anything 😀 |
Yes, that is correct! That makes some implementation stuff easier (when the todos are changed in some other instance or changed through some plugins i.e the change in data file is not done by the user using the current instance)
For that, I've implemented recurring tasks which when marked as completed just shift their date accordingly
I suppose we can include some of the special keybindings in the configuration file to tweak as per the user's preference |
Is your feature request related to a problem? 😢 Please describe.
I would like the ability to copy and paste entire todo's between topics, and have the ability to copy multiple todo's.
Describe the solution you'd like 🤔
I would like to have a solution that does the following:
Y
to yank entire todo'sY
if triggered on a parent todo, should copy all child todo's to the clipboardp
orP
to paste a todo that has been copiedDescribe alternatives you've considered 🧐
An extension of this idea would be to use
D
to delete and copy the selected todo, and of course I am open to alternative default bindings.Additional context 📝
I don't know how hard this is to implement as I have only recently started using the app and am loving it so far.
When I have some available time I will take a look at the code and if this is something you would like to include, I would be happy to help.
The text was updated successfully, but these errors were encountered: