Commit graph

147 commits

Author SHA1 Message Date
johnny1093
445a378a0d lint: scope off no-command-in-command-id for the settings command
The "open-commander-settings" command id predates this lint rule.
Renaming it would silently break any existing user's saved hotkey
binding for opening Commander's settings, so we keep the id and
scope the rule off for src/main.ts instead of renaming or disabling
inline (obsidianmd disallows inline-disabling this rule).
2026-07-11 09:26:25 -04:00
johnny1093
8c08808823 fix: correct ribbon item matching and stray global app references
- leftRibbonManager was comparing i.name === i.name (always true)
  instead of i.name === pair.name when locating a ribbon item to
  recolor/remove, so items sharing an icon with a different-named
  command could be matched incorrectly. Now compares against pair.name.
- Replace two stray references to the global `app` with the plugin's
  own `app` reference (this.plugin.app / plugin.app), consistent with
  the rest of the codebase.
- Use Object.prototype.hasOwnProperty.call() instead of calling
  hasOwnProperty directly on values that may not inherit from
  Object.prototype.
- Import Command/PluginManifest in types.ts so the Obsidian module
  augmentation resolves them instead of relying on ambient globals.
- Drop a leftover console.log of an expected/benign cancellation
  error in the "Add command" menu action.
2026-07-11 09:26:19 -04:00
johnny1093
ebeae5c6c8 lint: add explicit return types and drop redundant/unnecessary type constructs
- Add explicit `(): void` return types to several useEffect cleanup
  callbacks (settingTabComponent, ColorPicker, AdvancedToolbarSettings,
  mobileModifyComponent).
- Widen Mode's literal union with `(string & {})` instead of a bare
  string constituent, preserving autocomplete without the redundant
  type warning.
- Drop an unnecessary `as ItemView` cast in pageHeaderManager now that
  the preceding instanceof guard already narrows the type.
- Switch eslint.config.mts from the deprecated tseslint.config() to
  eslint's own defineConfig().

Type-level only, no runtime behavior change.
2026-07-11 09:23:02 -04:00
johnny1093
85da080ae4 lint: add explicit types to Obsidian test mocks
Adds public/return type annotations and a type-only declare
property (to keep FuzzySuggestModal/SuggestModal's generic
parameter meaningfully typed) so the mock classes satisfy
explicit-member-accessibility, explicit-function-return-type, and
no-unused-vars. No behavior change to the mocks.
2026-07-11 09:21:17 -04:00
johnny1093
505d7d4956 lint: clean up stale eslint-disable directives
Removes eslint-disable comments left over from the pre-flat-config
setup that no longer suppress anything (mostly no-unused-vars on
unused function params, which typescript-eslint doesn't flag by
default) and adds required descriptions to the handful that are
still load-bearing. Also replaces an `as any` cast for the
text-formatting-toolbar third-party API with a locally-typed cast,
since disabling no-explicit-any isn't allowed by the obsidianmd
config. Comment/typing only, no behavior change.
2026-07-11 09:19:04 -04:00
johnny1093
b3af074174 test: add vitest suite for macros, icons, modes, styles, and locales
Adds coverage for executeMacro, injectIcons, isModeActive, updateStyles/
removeStyles, and locale completeness, plus the Obsidian API mocks and
setup needed to run them under jsdom. Updates a stale fr.json key to
match the current English source string.
2026-07-11 09:13:56 -04:00
johnny1093
3bd5395f09 Migrate ESLint to flat config with eslint-plugin-obsidianmd
Replaces the legacy .eslintrc/.eslintignore (typescript-eslint 5.x) with a
flat eslint.config.mts on typescript-eslint 8.x, preserving the existing
return-type/accessibility rules and adding the obsidianmd recommended rules.
Also bumps the minimatch override, which was pinned to an old major that's
incompatible with the new ESLint 9 toolchain.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-10 12:09:46 -04:00
johnny1093
0bfd4624eb
Merge pull request #199 from na7710/Add-Traditional-Chinese-(zh-TW)-translation 2026-06-24 21:22:18 -04:00
Sana
229a510b7c
i18n: add Traditional Chinese (zh-TW) translation 2026-06-18 22:31:59 +08:00
John Morabito
ed357a9a6f fix: roll back manifest version to 0.5.5 to match latest stable release
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 08:21:25 -04:00
John Morabito
6fe2d99626 fix: patch security vulnerabilities via npm audit fix
- shell-quote: critical — quote() failed to escape newlines in .op values
- esbuild: high — missing binary integrity verification (bumped to 0.28.1)
- Fix two return type errors in MacroBuilder.tsx exposed by stricter tsc

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 21:06:30 -04:00
John Morabito
d80ce5c86f Merge fix/eslint-compliance: resolve all ESLint errors 2026-06-13 20:57:02 -04:00
John Morabito
31ea9c9c45 fix: resolve all ESLint errors across the codebase
- Remove unused imports (getIconIds, setIcon, exp, arrayMoveMutable, etc.)
- Add missing explicit return types on functions and arrow functions
- Add public accessibility modifier to PageHeaderManager.buttons
- Fix mixed spaces/tabs in constants.ts and commandComponent.tsx
- Wrap case block declaration in MacroBuilder.tsx to fix no-case-declarations
- Add eslint-disable comments for false-positive no-unused-vars on
  function type annotation parameter names and TypeScript enum members
- Remove dead forceUpdate reference in MacroBuilder.tsx (was referencing
  this in a function component)

Reduces from 64 errors + 2 warnings to 0 errors + 2 warnings (the remaining
warnings are intentional non-null assertions).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 20:55:23 -04:00
johnny1093
092d6a534e
feat: Text Formatting Toolbar integration (#197)
feat: Text Formatting Toolbar integration
2026-06-13 19:48:26 -04:00
John Morabito
88a857cfab chore: correct version to 0.5.6
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 19:46:22 -04:00
John Morabito
a6eca8e2dd chore: bump version to 0.5.7
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 19:44:21 -04:00
John Morabito
cbcbc026b7 fix: update Text Formatting Toolbar plugin ID reference
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 19:39:21 -04:00
John Morabito
a2dcc97f3e feat: add Text Toolbar plugin integration
Commander now detects the standalone Text Toolbar plugin at load time and:
- Pushes saved commands into the toolbar via its public API (setCommands)
- Shows a "Text Toolbar" tab in Commander settings when the plugin is installed,
  using the existing CommandViewer UI for add/remove/reorder

The tab is hidden when the Text Toolbar plugin is not installed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 19:31:17 -04:00
John Morabito
606593e16a feat: remove text toolbar from Commander (extracted to standalone plugin)
The text toolbar feature has been moved to the standalone obsidian-text-toolbar
plugin at plugins/text-toolbar. This commit removes leftover staging artifacts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 19:25:09 -04:00
John Morabito
c8207d8693 Merge fix/macro-icons: Fix macro icons not showing up (PR #149)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 11:37:47 -04:00
John Morabito
b4ae810c84 fix: macro icons now display correctly in all UI contexts
Set icon directly on addCommand so it appears in the command palette,
status bar, and mobile toolbar. Also fixes removeCommand referencing
bare `app` instead of `plugin.app`, and replaces Array.remove() during
forEach iteration (mutation hazard) with a filter in injectIcons.

Fixes #149 (cherry-picked from PR by Anton/Lyqed)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 11:37:39 -04:00
John Morabito
13c5c1e1b2 Merge PR #177: Fixed status bar bug
Fixed bug where status bar commands would be deleted from the list when
the command stopped being available (e.g. from other plugins that hadn't
loaded yet at onLayoutReady time).

Co-authored-by: davidvkimball <davidvkimball@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 11:29:54 -04:00
johnny1093
f13537701f
Merge pull request #195 from jsmorabito/dependabot-alert-fixes
fix: pin esbuild-sass-plugin to 3.3.1 to resolve CI peer dep conflict
2026-06-04 20:39:14 -04:00
John Morabito
125306e4b1 fix: pin esbuild-sass-plugin to 3.3.1 to resolve CI peer dep conflict
esbuild-sass-plugin@^3.3.1 resolved to 3.7.0 in CI, which requires
esbuild>=0.27.3. Our esbuild is ^0.25.0, causing ERESOLVE. Pinning
to exactly 3.3.1 keeps compatibility with esbuild 0.25.x.
2026-06-04 20:31:56 -04:00
johnny1093
8a33a5a0fd
Merge pull request #194 from jsmorabito/dependabot-alert-fixes
Dependabot alert fixes
2026-06-04 20:24:19 -04:00
John Morabito
92653481f2 security: upgrade esbuild 0.15→0.25, esbuild-sass-plugin 2→3
Fixes moderate severity Dependabot alert:
- esbuild <=0.24.2: dev server could be queried by any website
  (GHSA-67mh-4wv8-2f99)

Changes:
- esbuild: ^0.15.16 → ^0.25.0
- esbuild-sass-plugin: ^2.4.2 → ^3.3.1 (required for esbuild compat)
- sass-embedded: ^1.71.1 added (peer dep for esbuild-sass-plugin 3.x)
- scripts/esbuild.config.mjs: replaced removed watch:boolean option with
  esbuild.context() + ctx.watch() API (changed in esbuild 0.17)

All changes are dev/build toolchain only and do not affect the
compiled main.js shipped to users.
2026-06-05 00:04:54 +00:00
John Morabito
3a9e8a8c3a security: add npm overrides to fix 15 transitive dep vulnerabilities
All affected packages are development dependencies only and do not
affect the compiled plugin that users install.

Overrides added (minimum safe versions):
- ajv: ^6.14.0 (was 6.12.6, ReDoS)
- brace-expansion: ^1.1.13 (was 1.1.11, ReDoS)
- braces: ^3.0.3 (was 3.0.2, uncontrolled resource consumption)
- cross-spawn: ^7.0.5 (was mixed 6/7, ReDoS)
- flatted: ^3.4.2 (was 3.2.7, prototype pollution + DoS)
- immutable: ^4.3.8 (was 4.1.0, prototype pollution)
- js-yaml: ^4.1.1 (was 4.1.0, prototype pollution)
- micromatch: ^4.0.8 (was 4.0.5, ReDoS)
- minimatch: ^3.1.5 (was 3.1.2, ReDoS)
- nanoid: ^3.3.8 (was 3.3.4, predictable output)
- picomatch: ^2.3.2 (was 2.3.1, method injection + ReDoS)
- postcss: ^8.5.10 (was 8.4.20, parsing error + XSS)
- semver: ^7.5.2 (was mixed, ReDoS)
- word-wrap: ^1.2.4 (was 1.2.3, ReDoS)
- yaml: ^1.10.3 (was 1.10.2, stack overflow)
2026-06-04 23:59:10 +00:00
johnny1093
a3f6240f77
Update GitHub Sponsors username in FUNDING.yml 2026-04-21 10:51:54 -04:00
johnny1093
e26a450840 Update manifest.json 2026-04-12 19:06:22 -04:00
johnny1093
8ab02a116c
Merge pull request #164 from Moyf/add-zh-cn
chore: add missing localization for zh-cn
2026-04-12 19:01:46 -04:00
johnny1093
8ac02b72a7
Merge pull request #170 from Ace-Kyle/main
Add new suppport language for Vietnamese
2026-04-12 19:01:11 -04:00
johnny1093
aa3b14c214
Merge pull request #112 from grvn/patch-1
Added swedish locale
2026-04-12 19:00:46 -04:00
johnny1093
a63339b6a1
Merge pull request #150 from niaodan2b/patch-1
Update zh-cn.json
2026-04-12 19:00:14 -04:00
johnny1093
78fd1e702f
Merge pull request #156 from hartegg/patch-1
Create hr.json
2026-04-12 18:59:42 -04:00
David V. Kimball
513454bc2d Fixed tooltip position for status bar commands. 2025-11-26 15:20:30 -08:00
David V. Kimball
7e38ed7169 Fixed bug where status bar commands would be deleted from the list when the command stopped being available. 2025-11-25 23:24:17 -08:00
TinyFox
ac754f08c1
Add new suppport language for Vietnamese
- Language: Vietnamese
- Language code: vi (vn)
2025-08-13 04:20:48 +07:00
Moy
8f30a624c5 chore: add missing localization for zh-cn 2025-07-03 13:17:00 +08:00
Phillip
27d0e167ce
chore: bump version 2025-06-12 11:31:42 +00:00
Phillip
11b829713d
Merge pull request #161 from Quorafind/main
Fix issue padding on mobile in 1.9.0
2025-06-12 13:29:03 +02:00
quorafind
119ccead08 style: revert the padding-bottom in AT-multirow 2025-06-12 19:15:39 +08:00
quorafind
a33189237d Integrate Kevin Woo's iOS mobile toolbar fix 2025-06-12 19:07:01 +08:00
quorafind
1be36a83fb Merge kevinawoo/patch-1: fix additional mobile toolbar space issue in iOS 2025-06-12 19:06:30 +08:00
quorafind
e5904608ed revert: seems like set the padding-bottom to be zero should fix the issue that huge spacing of toolbar 2025-06-12 18:51:25 +08:00
quorafind
2f5b75df08 revert: back to typescript 4.9.3 to prevent issue with preact 2025-06-12 18:26:59 +08:00
quorafind
b394ec8037 fix: rebase issue 2025-06-12 18:22:54 +08:00
Kevin Woo
a6e9a972b2
fix: additional mobile toolbar space issue in 1.9.0
On iOS, the fix introduced in #158, didn't actually fix it for me.

This resolves the issue for me on iOS, Obsidian v1.9.1 (207)
2025-06-12 00:48:02 -07:00
Phillip
3df5067e82
fix: release workflow 2025-06-12 06:52:27 +00:00
Phillip
3171e52a61
chore: bump version 2025-06-12 06:43:42 +00:00
Phillip
fd312506b6
Merge pull request #158 from Quorafind/main
fix: mobile toolbar space issue in 1.9.0
2025-06-12 08:40:12 +02:00