Skip to content
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: modular structure for adding APPS into TalonVoice framework #129

Closed
auphofBSF opened this issue Jun 3, 2020 · 11 comments
Closed
Assignees

Comments

@auphofBSF
Copy link
Contributor

auphofBSF commented Jun 3, 2020

The app folder structure as refactored by @knausj85 in bba1b56 for VSCODE is a step in the right direction for maintainability and extending. 🥇
updated from discussions below

app
  /<MYAPP>
            <MYAPP>.<OS>.talon  (implementation code - where <OS> is linux | mac | win)
            <MYAPP>.py (talon support python code for MYAPP)
            <MYAPP>.talon (Voice Commands for  MYAPP)

I still believe platform differences could be managed in 1 file, reducing the amount of duplicate work in building support for a cross platform app. This will however need extending the talon syntax to enable a line in the talon file to apply or be exempt from a specific platform context.

Additionally, the support, maintenance and monolithic nature of where this repository is heading should at some point be considered.
It seems a huge task for this one repo to hold all commands for all conceivable applications. . It is also conceivable a user does not want a blotted command set but wants to pick and choose modules.
The above structure that was introduced is in my opinion a great step forward. Together with some guidelines it will enable building on top of the great work the core of this repository has introduced with the awesome TalonVoice by @lunixbochs

my intent with this issue is a place holder FEATURE discussion around appropriate structuring

@knausj85
Copy link
Member

knausj85 commented Jun 3, 2020

Long term, I believe the plan is a package management/plugin system in talon of some sort, so starting from a huge repository like this won’t be a thing, fwiw.

I’ll definitely consolidate Talon files where possible if/when that’s implemented.

I won’t accept all PRs; I am more likely to accept PRs for more specific contexts. The less specific the context, the more selective I’ll be.

I generally prefer a flatter folder structure. vscode is probably the direction I’ll slowly move things. I’d like to get rid of the platform subfolders, but that can probably wait until the consolidation.

WIP.

@lunixbochs
Copy link
Collaborator

why app/vscode/mac/vscode.talon instead of app/vscode/mac.talon

@knausj85
Copy link
Member

knausj85 commented Jun 3, 2020

so searching for vscode finds everything vscode-related in most any app

the other option was
apps/vscode/vscode.mac.talon
apps/vscode/vscode.linux.talon
apps/vscode/vscode.win.talon
apps/vscode/vscode.talon

which is reasonable. can't remember why I didn't go this way now. :-/

@auphofBSF
Copy link
Contributor Author

auphofBSF commented Jun 3, 2020

I agree with flatter the better apps/vscode/vscode.mac.talon, is a further good move.
if no other immediate suggestions I can modify PR #128 to this as a trial ?

@knausj85
Copy link
Member

knausj85 commented Jun 3, 2020

works for me

@fidgetingbits
Copy link
Collaborator

so searching for vscode finds everything vscode-related in most any app

the other option was
apps/vscode/vscode.mac.talon
apps/vscode/vscode.linux.talon
apps/vscode/vscode.win.talon
apps/vscode/vscode.talon

fwiw i think I also prefer the quoted layout over os-specific sub-folders for each app.

i also like the move towards relevant .py files into the given apps folder, ex apps/vim/vim.py instead of planting everything in code/ which used to be done? (or at least it what I've been doing).

@knausj85
Copy link
Member

knausj85 commented Jun 4, 2020

yeah, i moved the relevant .py for vscode into apps/vscode too, so that's where we're headed.

@fidgetingbits
Copy link
Collaborator

Just mentioning this here, since it's technically part of the move towards a new structure. Moving vim.py to apps/vim/vim.py seems to result in errors about all the methods used in the .talon file not being defined:

10009 2020-06-05 17:06:07    IO EMIT ['split', 'right']                                                                                                                       
10010 2020-06-05 17:06:07    IO COMPILING                                                                                                                                     
10011 2020-06-05 17:06:07    IO dfa rules built in 0.101s                                                                                                                     
10012 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10013 2020-06-05 17:06:07    IO Rule not found: user.vim_text_objects                                                                                                         
10014 2020-06-05 17:06:07    IO Rule not found: user.vim_motions_all_adjust                                                                                                   
10015 2020-06-05 17:06:07    IO Rule not found: user.vim_unranged_surround_text_objects                                                                                       
10016 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10017 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10018 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10019 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10020 2020-06-05 17:06:07    IO Rule not found: user.vim_arrow                                                                                                                
10021 2020-06-05 17:06:07    IO Rule not found: user.vim_normal_counted_motion_command                                                                                        
10022 2020-06-05 17:06:07    IO Rule not found: user.vim_motions_all_adjust                                                                                                   
10023 2020-06-05 17:06:07    IO Rule not found: user.vim_normal_counted_action                                                                                                
10024 2020-06-05 17:06:07    IO Rule not found: user.vim_arrow                                                                                                                
10025 2020-06-05 17:06:07    IO Rule not found: user.vim_select_motion                                                                                                        
10026 2020-06-05 17:06:07    IO dfa rules linked 0.149s                                                                                                                       
10027 2020-06-05 17:06:08    IO minimize + cfg in 1.069s   

Though I confirm that it seems to load the vim.py at startup. I guess will be something to fix before we fully move stuff out of code/, guessing that's something that has to be fixed in talon maybe?

@knausj85
Copy link
Member

knausj85 commented Jun 5, 2020

Edit: scratch this, that looks like something else. I'd run that one by aegis.

@fidgetingbits - I believe Talon loads things alphabetically, so that's probably what you're running into.

e.g., the apps folder loads like this

C:\Users\ruhroh\AppData\Roaming\talon\user\knausj_talon\apps\file_manager.talon
C:\Users\ruhroh\AppData\Roaming\talon\user\knausj_talon\apps\generic_browser.talon
...
C:\Users\ruhroh\AppData\Roaming\talon\user\knausj_talon\apps\linux\firefox.talon
...
C:\Users\ruhroh\AppData\Roaming\talon\user\knausj_talon\apps\mac\app.talon

@knausj85 knausj85 self-assigned this Jun 25, 2020
@knausj85
Copy link
Member

Just mentioning this here, since it's technically part of the move towards a new structure. Moving vim.py to apps/vim/vim.py seems to result in errors about all the methods used in the .talon file not being defined:

10009 2020-06-05 17:06:07    IO EMIT ['split', 'right']                                                                                                                       
10010 2020-06-05 17:06:07    IO COMPILING                                                                                                                                     
10011 2020-06-05 17:06:07    IO dfa rules built in 0.101s                                                                                                                     
10012 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10013 2020-06-05 17:06:07    IO Rule not found: user.vim_text_objects                                                                                                         
10014 2020-06-05 17:06:07    IO Rule not found: user.vim_motions_all_adjust                                                                                                   
10015 2020-06-05 17:06:07    IO Rule not found: user.vim_unranged_surround_text_objects                                                                                       
10016 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10017 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10018 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10019 2020-06-05 17:06:07    IO Rule not found: user.vim_surround_targets                                                                                                     
10020 2020-06-05 17:06:07    IO Rule not found: user.vim_arrow                                                                                                                
10021 2020-06-05 17:06:07    IO Rule not found: user.vim_normal_counted_motion_command                                                                                        
10022 2020-06-05 17:06:07    IO Rule not found: user.vim_motions_all_adjust                                                                                                   
10023 2020-06-05 17:06:07    IO Rule not found: user.vim_normal_counted_action                                                                                                
10024 2020-06-05 17:06:07    IO Rule not found: user.vim_arrow                                                                                                                
10025 2020-06-05 17:06:07    IO Rule not found: user.vim_select_motion                                                                                                        
10026 2020-06-05 17:06:07    IO dfa rules linked 0.149s                                                                                                                       
10027 2020-06-05 17:06:08    IO minimize + cfg in 1.069s   

Though I confirm that it seems to load the vim.py at startup. I guess will be something to fix before we fully move stuff out of code/, guessing that's something that has to be fixed in talon maybe?

@fidgetingbits ^ fyi that looks like this issue talonvoice/beta#83, which is fixed in v1365

@fidgetingbits
Copy link
Collaborator

fidgetingbits commented Jun 26, 2020

@knausj85 yep that fixed it, thanks for filling that bug. i had no time to actually play around to figure out what the problem was yet.

knausj85 added a commit that referenced this issue Jul 1, 2020
@knausj85 knausj85 closed this as completed Jul 1, 2020
brxck pushed a commit to brxck/talon-config that referenced this issue Aug 8, 2020
jbarr21 pushed a commit to jbarr21/talon-user that referenced this issue Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants