Skip to content

custom commands - #388

Open
hamidb80 wants to merge 42 commits into
suchnsuch:mainfrom
hamidb80:cust
Open

custom commands#388
hamidb80 wants to merge 42 commits into
suchnsuch:mainfrom
hamidb80:cust

Conversation

@hamidb80

@hamidb80 hamidb80 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

demo for #367
comments are welcome


currently is tries to find .sh or .bat scripts in the workspace root directory

pc and others added 7 commits June 11, 2026 13:38
…ch#385)

* check to ask for workspace

* one line

* remove empty line from source code

* apply what taylor said

* fix typo

* better description

* reuse 'getGlobalSettings'

* remove unused import

* remove unsued import

* remove space

* move comment

* better naming

* remove string property that _can_ cuase bug when refactoring

* .

* naming

* better name

* do not use IPC

* remove extra spaces

* .

* add periods, American spell

* .

* remove comment

---------

Co-authored-by: pc <hamidb@aut.ac.ir>
* add checkbox checked glyph option

* ' -> " import quote

* follow style guide

* .

* syntax consistency

* capitalize

* fix grammer

* add period

* style consistency

* prefer const

* style guide

* remove dummy var

---------

Co-authored-by: pc <hamidb@aut.ac.ir>
…nt. Add optional debug logging for node handles.
@hamidb80
hamidb80 marked this pull request as draft June 16, 2026 14:57
@hamidb80

This comment was marked as resolved.

@hamidb80

This comment was marked as outdated.

@taylorhadden taylorhadden left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of stuff here. This is absolutely the right direction 🍻.

The largest point of single feedback is that I don't think we want to use "Rule"; we can just call these things "External Commands".

I also want to highlight the query about shell.ts. Why not use the referenced library?

Comment thread apps/tangent-electron/src/app/views/System/System.svelte Outdated
Comment thread apps/tangent-electron/src/common/markdownModel/templates.ts Outdated
Comment thread apps/tangent-electron/src/common/settings/ExternalCommand.ts Outdated
Comment thread apps/tangent-electron/src/main/messages/index.ts Outdated
Comment thread apps/tangent-electron/src/common/WindowApi.ts Outdated
Comment thread apps/tangent-electron/src/app/modal/ExecCommandDialog.svelte Outdated
Comment thread apps/tangent-electron/src/app/modal/ExecCommandDialog.svelte Outdated
Comment thread apps/tangent-electron/src/app/utils/shell.ts Outdated
@hamidb80
hamidb80 requested a review from taylorhadden July 7, 2026 04:29
Comment thread apps/tangent-electron/src/app/model/commands/ExecCliCommand.ts Outdated
Comment thread apps/tangent-electron/src/app/model/commands/ExecCliCommand.ts Outdated

export function nameFromRule(rule: ExternalCommandRule | ExternalCommandRuleDefinition, name?: string): string {
return (typeof rule.name == 'string' ? rule.name : rule.name.value) || name
export function nameFromCommand(command: ExternalCommand | ExternalCommandDefinition, name?: string): string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In place of some of this you can use rawOrStoreValue() in ReadableStore.ts.

Comment thread apps/tangent-electron/src/main/messages/index.ts Outdated
Comment thread apps/tangent-electron/src/main/messages/index.ts Outdated
Comment thread apps/tangent-electron/src/main/messages/index.ts Outdated
Comment thread apps/tangent-electron/package.json
Comment thread apps/tangent-electron/src/app/model/commands/ExecCliCommand.ts Outdated

export default class ExecuteExternalCommand extends WorkspaceCommand {
constructor(workspace: Workspace) {
super(workspace, { group: 'Notes' }) // <---- this makes it available when editing notes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having an empty group should be fine, and is probably what is desired. The groups are used to separate out groups of bindings that won't ever be in scope with each other.

function createAllCommands(workspace: Workspace) {
return {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this is just a whitespace change.

use:tooltip={"Define the name of the command. Set an emoji as the first character of the name to make an icon."}
></h2>
</header>
<label use:tooltip={"Defines how the note will be named. Refer to the Template Token list for available dynamic values."}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tooltip and label span are still mentioning the creation rules. It's also bound to the same value as the header. Seems like we don't need both. Is one of these supposed to be the command template?

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

Successfully merging this pull request may close these issues.

2 participants