launchmenu / launchmenu Goto Github PK
View Code? Open in Web Editor NEWDo it. Do it now.
Home Page: http://launchmenu.github.io/
License: MIT License
Do it. Do it now.
Home Page: http://launchmenu.github.io/
License: MIT License
Add some UI system that can be used for showing notifications, which don't interrupt the user.
This should be some kind of overlay, separate window, or dedicated area that expands.
More thought must be put into this idea before implementation.
Add all local changes to the real model-react instance.
Also update all documentation for it.
Also add try catch clauses to invocation of listeners, such that listener errors don't prevent other listeners from getting called
Create some wrapper class or factory function to create menu actions intended for the context menu with less boilerplate
Will need to see how to best implement this. But ideally every keyPattern
can specify its own repeat time.
Make the actions system more general, by allowing them to return inputs for multiple super-actions (parent actions):
Then in order to execute an action X, one would:
1- Retrieve all action bindings from the items (or any other thing that has an actionBindings
property)
2- Group all action bindings by their actions
3- Recursively include all parent actions in the grouped collections
4- Take out an actions that don't contain X as an ancestor (step 3 and 4 might be combinable for efficiency)
5- Create a partial (or full) ordering of these collections, such that parents always come after their children
6- In sequence of the ordering, execute each action's core reducer on the input bindings, and add any resulting bindings to the binding's action's collection
7- Return the result of X's core reducer of step 6
Also while refactoring actions;
Cerebro is an application similar to LaunchMenu but has a significantly simplified plugin system. There are however 200 or so existing cerebro plugins. It would be really cool if we could build a simple applet which allows the installation of Cerebro-style plugins into the LaunchMenu environment with minimal effort.
Some applet examples:
See
src/index.js
for code
The basic layout of a cerebro plugin is as follows.
module.exports = {
fn: ({{term: string, display: function, update: function, actions: object }}) => {...},
name: 'Hash input...',
keyword: 'hash'
}
fn
appears to be ran whenever anything is typed into the searchbar. term
itself is the string containing the searched query. display
function is passed an object which contains information about a menu item to display. update
is used for updating the UI, including auto-completion of search term in query bar(I doubt this makes sense for launchmenu) but also the getPreview()
method returns a react element to preview in the contents pane.
The menu item would generally follow this structure.
Generally speaking I'm going to guess that this would be very simple to add into LaunchMenu, at least in a basic form, and would at least make the application quite usable soon after initial release
It's likely that not all functionality will be easily mirror-able, however this might be a great way of re-using existing works.
Create a dictionary applet
OSPasteHandler
Upgradesctrl+v
.InfoWorks ICM
has several Paste commands
found in the "File menu" but no specific keybinds to execute them.Currently the context menu just shows items in a semi-arbitrary order (based on order bindings of items are defined).
It would preferable to change this to a prioritized menu and have bindings for the context-menu contain a tag that includes a priority as well.
Create a notes applet with the following features:
Settings:
Currently situation:
Goal:
So basically, there should be a way of creating something like a combinedExecuteHandler
(action) given a execute handler and a configuration for it (input validity checker etc). Then this combined execute handler represents the input for a certain item type, such that when multiple of these items are selected, one UI is able to update them all at once.
This behavior should probably be optional though, so it would make sense for this combinedExecuteHandler
to create 2 context items; 1 for updating each item individually and 1 for updating them all at once (combined) Maybe even with a setting for which behavior should be the default execute behavior.
The ability to search the file system for files in LM.
.shp
and a .dbf
. Would want to be able to move them together, instead of individually etc. Would want to have them appear as 1 file (via a plugin) instead of 2 files.
some/file.shp
some/file.dbf
File
also e.g. a sewer asset survey:
someID
|- someID.docx
|- someID-in.jpg
|- someID-out.jpg
|- someID-chamber.jpg
|- telemetry
| |- dropTests.pdf
| |- scada
...
run
command for launching applications run:notepad
.Just a high level roadmap currently
I had Selulance test some of the application, here is some feedback to cover:
ctrl+left
for escape and ctrl+right
for enterLook for a nice TS fuzzy search library and either replace the current search by a fuzzy search handler, or add the fuzzy search handler
Create an applet to handle window concerns:
Create some applet repository to contain some boilerplate currently required to create an applet for LM.
This is a megathread to attempt to get full support of LM features on Mac OS.
Following are some OS specific issues we've identified already:
{Meta down}{a down}{a up}{meta up}
not picked up but {Meta down}{a down}{meta up}{a up}
is)Currently the search cache uses a queue to determine what item to remove from the cache.
However, when we have a cache hit, that item should actually be added to the end of the queue again (and removed from the current position).
Now if you have a cache of size 3, you would get the following result:
1. A - Miss
2. B - Miss
3. A - Hit
4. C - Miss
5. A - Hit
6. D - Miss
7. A - Miss
Where as really 7 should be a hit, since every second lookup included it. So the queue should really track how long ago an item was looked up, rather than how long ago it was added.
Relevant line: https://github.com/LaunchMenu/LaunchMenu/blob/master/packages/core/src/utils/search/SearchCache.ts#L50
Fix would probably involve creating a map to store the queue items, and turn the queue in a doubly linked list such that a item can be removed (and inserted at the back) when requested.
Currently the search executer only handles 1 item at a time. This is problematic if a search requires some async behavior s;uch as getting data from a server. Code should be adapted to continue onto the next item already when this is the case.
I believe this should be doable without many changes.
Unit tests should be updated to properly test this parallelism.
Currently an action can specify multiple parents, but bindings have no way of choosing what parent they are for.
Therefor if an action decides to have multiple parents, all bindings will become bindings for all those parents too.
We can improve this by allowing bindings to specify 'targets'. This will specify what actions the binding should directly or indirectly be used for.
We can then also increase flexibility even more by allowing actions to specify children, instead of only parents. Currently actions always specify their parents, such that new handlers can always be created without the parents having to know of their existence. But it would also be useful to allow for the opposite; Have a new action be able to use an already existing action as a handler.
This way you can reuse all possible action handlers of an already existing action.
An action binding couldn't usually be traced back to the source ancestor action this way however (since some action doesn't know about one of its parents, its parent only know about it), but this is where the targets
come in. When using this child behavior, the binding would have to specify the target
in addition in order to allow for the action to be used in the actrion tree creation.
All of this has to be thought trough a little better, but will allow for an even greater amount of flexibility in the action system.
Create an action that can be used to track what menus an item is a part of
onMenuChange(menu: IMenu, event: "added" | "removed"): void;
Update menu, prioritized menu and ordered list to accommodate for this event callback
And potentially some other things. It would be nice to support most features including advanced ones like this.
Can we use MDX with some special set components?
A search field that automatically creates and opens a menu with the search reults
It would be useful to be able to filter/prioritise LaunchMenu actions based on the previous opened application.
For instance if you're video editing you might have built a set of scripts to help you video edit faster. You might want to be able to prioritize your scripts instead of other items that may match your search term.
//Todo
let run = require("@jxa/run").run;
async function getActiveApp(){
return await run(function(data){
var proc = Application("System Events").processes().filter(e=>e.frontmost())[0]
var wnd = proc.windows()[0];
return {
process: {
name: proc.name(),
id: proc.id()
},
window: {
id: null,
name: wnd.name(),
pos: wnd.position(),
size: wnd.size(),
class: wnd.class(),
desc: wnd.description(),
role: wnd.role(),
roleDesc: wnd.roleDescription()
}
}
});
}
//Todo
Create a search menu that performs a search action on a set of given items and displays the ranked results
Might be useful for actions and handlers.... But not sure how needed it is.
It will be common for users to want to use some retrieved piece of text within the program they were using before opening LM.
So it would be useful to make some tooling in LM that can be used to easily copy some text, close LM, and paste the text.
Some libraries that could prove useful for this:
Add a layer type that can be used for simple dialogs, such confirmation prompts.
Also create simple confirmation execute handler using this UI
The user should be able to specify how many results to show per applet.
So to permit this, a maximum category size option should be introduced for prioritized menus, as well as some way of showing that there are more items, but those are hidden (possibly even make it possible to expand/collapse these).
An other interesting addition would be to add controls for the main search menu to 'tab' between different categories.
Currently we have an issue installing global hotkeys in LaunchMenu.
Currently we used Electron's global hotkey libraries but these are very limited as they use more restricted hotkey binding systems.
Problems: IOHook only supports a set of node and electron versions. Building is a bit of a nightmare.
This implementation is described here. I've included some pseudocode below.
const WH_GETMESSAGE = 3
function Register(){
this.hook = SetWindowHookEx(WH_GETMESSAGE, pointerTo(MyMsgProc), 0, 0)
}
function Unregister(){
if(!UnhookWindowsHookEx(this.hook)){
throw "Cannot unhook"
}
}
function MyMsgProc(code, wParam, lParam){
if(code == WM_KEYDOWN){
//Detect keycode in wParam
//Propogation
if(!stopPropogation){
CallNextHookEx(this.hook, code, wParam, lParam)
}
} else {
CallNextHookEx(this.hook, code, wParam, lParam)
}
}
The following is the implementation for Macs written in swift.
var gMyHotKeyID = EventHotKeyID()
gMyHotKeyID.signature = OSType("swat".fourCharCodeValue)
gMyHotKeyID.id = UInt32(keyCode)
var eventType = EventTypeSpec()
eventType.eventClass = OSType(kEventClassKeyboard)
eventType.eventKind = OSType(kEventHotKeyPressed)
// Install handler.
InstallEventHandler(GetApplicationEventTarget(), {(nextHanlder, theEvent, userData) -> OSStatus in
var hkCom = EventHotKeyID()
GetEventParameter(theEvent, EventParamName(kEventParamDirectObject), EventParamType(typeEventHotKeyID), nil, sizeof(EventHotKeyID), nil, &hkCom)
// Check that hkCom in indeed your hotkey ID and handle it.
}, 1, &eventType, nil, nil)
// Register hotkey.
let status = RegisterEventHotKey(UInt32(keyCode), UInt32(modifierKeys), gMyHotKeyID, GetApplicationEventTarget(), 0, &hotKeyRef)
The above could be implemented in Node-FFI. This could mean that we have a bit of a build nightmare though...
Currently all text in LM is selectable with the mouse. This by itself isn't awful, but it is a little unusual.
We however also prevent all key events, and right click events. So you can select text, but you can't even copy it, making it rather useless.
I think it would be best to disable text selection by default, but allow it in the content section (possibly definable with a flag when you create your content). Then allow for right click on the content section and allow for ctrl+c.
Improved listeners using IOHook so can listen to meta key and others.
Make the menu view automatically scroll to the selected item
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.