Add built-in toolbar toggle in settings and improve toolbar styles; fix search panel menu logic

This commit is contained in:
Justice Vellacott 2025-12-15 07:10:34 -05:00
parent 5a5d33a5a0
commit 71c239537a
6 changed files with 46 additions and 3 deletions

View file

@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added
- **Settings**: Added built-in toolbar toggle to settings for enabling/disabling Obsidian's native mobile toolbar.
- **Styles**: Updated styles to improve toolbar appearance and compatibility with built-in toolbar toggle.
- **Toolbar**: Significantly expanded context-aware toolbars.
- Added new toolbars: `Table actions`, `Heading actions`, `Code block actions`, `Blockquote actions`, `Link actions`, `Selection`, and `All commands`.
- Added support for new contexts: `task`, `heading`, `code-block`, `table`, `blockquote`, and `link`.
@ -20,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Toolbar**: Improved toolbar rendering logic and context detection prioritization.
- **Toolbar**: Renamed `showTooltip` to `renderToolbar` for clarity.
### Fixed
- **Search**: Fixed search panel menu selection logic to correctly reflect file count and selection state.
## [1.2.4] - 2025-12-15
### Added

View file

@ -10,7 +10,8 @@
"lint": "eslint src/ --ext .ts",
"build": "npm run format && tsc -noEmit -skipLibCheck && node esbuild.config.mjs production",
"version": "node version-bump.mjs && git add manifest.json versions.json",
"release": "bash release.sh"
"release": "bash release.sh",
"verify-release": "bash verify-release.sh"
},
"keywords": [
"obsidian",

View file

@ -51,7 +51,10 @@ export default class MobilePlugin extends Plugin {
async onload() {
await this.loadSettings();
document.body.toggleClass(
'hidden-mobile-toolbar',
!this.settings.showBuiltInToolbar,
);
// Register wake lock toggle command
this.addCommand({
id: 'toggle-wake-lock',

View file

@ -86,6 +86,7 @@ export interface MobilePluginSettings {
commandIcons: Record<string, string>; // Map of command ID to icon name
enableHapticFeedback: boolean;
gestureCommands: GestureCommand[];
showBuiltInToolbar: boolean;
}
export const DEFAULT_SETTINGS: MobilePluginSettings = {
@ -116,6 +117,7 @@ export const DEFAULT_SETTINGS: MobilePluginSettings = {
'editor:toggle-highlight',
'editor:insert-link',
'editor:toggle-checklist-status',
'mobile:select-more',
'mobile:quick-audio-notes',
'mobile:keep-in-tablet-mode',
],
@ -183,6 +185,7 @@ export const DEFAULT_SETTINGS: MobilePluginSettings = {
commands: [
'editor:copy',
'editor:cut',
'mobile:select-more',
'editor:toggle-bold',
'editor:toggle-italics',
'editor:toggle-highlight',
@ -242,6 +245,7 @@ export const DEFAULT_SETTINGS: MobilePluginSettings = {
'editor:cut': 'lucide-scissors-line-dashed',
},
enableHapticFeedback: true,
showBuiltInToolbar: false,
};
/**
@ -539,6 +543,19 @@ export class MobileSettingsView {
.setValue(this.plugin.settings.showToolbars)
.onChange((value) => this.sett('showToolbars', value)),
);
new Setting(containerEl)
.setName('Show built-in toolbar')
.setDesc(
"Show Obsidian's built-in mobile toolbar at the bottom of the screen",
)
.addToggle((toggle) =>
toggle
.setValue(this.plugin.settings.showBuiltInToolbar)
.onChange((value) => {
this.sett('showBuiltInToolbar', value);
document.body.toggleClass('hidden-mobile-toolbar', !value);
}),
);
new Setting(containerEl)
.setName('Show floating action button')

View file

@ -61,10 +61,19 @@ Includes FAB and selection toolbar styles with mobile-friendly design
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE and Edge */
-webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
transition: height 0.3s ease, flex-wrap 0.3s ease, right 0.3s ease, max-width 0.3s ease;
transition:
height 0.3s ease,
flex-wrap 0.3s ease,
right 0.3s ease,
max-width 0.3s ease;
/* z-index: 1000; */
}
.hidden-mobile-toolbar .mobile-toolbar,
.hidden-mobile-toolbar .mobile-toolbar-spacer {
display: none;
}
/* Expand toolbar when FAB is hidden */
.workspace-leaf-content:not(:has(.mobile-fab)) .mobile-plugin-toolbar {
right: 10px;

7
verify-release.sh Normal file
View file

@ -0,0 +1,7 @@
# remove node_modules if it exists
if [ -d "node_modules" ]; then
rm -rf node_modules
fi
# install dependencies
npm run init