Skip to content

Comply with Obsidian coding patterns#5

Merged
Rynaro merged 3 commits into
mainfrom
fix/obsidian-bot-review-fixes
Dec 3, 2025
Merged

Comply with Obsidian coding patterns#5
Rynaro merged 3 commits into
mainfrom
fix/obsidian-bot-review-fixes

Conversation

@Rynaro
Copy link
Copy Markdown
Owner

@Rynaro Rynaro commented Dec 3, 2025

This pull request primarily focuses on refactoring and improving code consistency, command naming, and UI styling for the Lockdown plugin. The most significant changes include standardizing command IDs, improving asynchronous handling, refining UI feedback and styling, and enhancing code readability. Below are the top changes grouped by theme:

Command Naming and Consistency

  • Standardized command IDs in main.ts (e.g., lockdown-toggle-locktoggle-lock, lockdown-locklock) for clarity and consistency. [1] [2]

Async Handling and Code Readability

  • Replaced direct async calls with void operator in multiple places to clarify intentional fire-and-forget behavior and avoid unhandled promise warnings (e.g., void this.handleSessionTimeout(), void this.lockFile(...), etc.). [1] [2] [3] [4] [5]
  • Refactored event handlers to remove unnecessary async usage and improved error handling by catching errors without variable assignment. [1] [2] [3] [4] [5] [6] [7]

UI and Styling Improvements

  • Enhanced file explorer indicators and overlays by using CSS classes instead of inline styles, and added encrypted state styling for locked files and folders. [1] [2] [3] [4] [5] [6] [7]
  • Updated status bar and modal titles to use CSS classes and more consistent capitalization (e.g., Locked items manager, Password required). [1] [2] [3]

User Feedback and Messages

  • Improved user-facing messages for clarity and consistency (e.g., "Please open a Markdown file to lock/unlock", "Warning: could not create backup before encryption"). [1] [2] [3] [4] [5] [6]

Settings UI Enhancement

  • Changed settings section header in the settings tab to use a heading-style setting for improved appearance.

These changes collectively improve code maintainability, user experience, and plugin reliability.

- Remove 'lockdown-' prefix from all command IDs
- Obsidian handles command ID namespacing automatically
- Affects 9 commands: toggle-lock, lock, unlock, set-root-password, show-locked-files, change-password, unlock-all, lock-folder, unlock-folder
- Change 'Password Required' to 'Password required'
- Change 'Confirm Password' to 'Confirm password'
- Change 'Locked Items Manager' to 'Locked items manager'
- Change 'Session timeout: Locking...' to 'Session timeout: locking...'
- Change 'Warning: Could not...' to 'Warning: could not...'
- Capitalize 'Markdown' in user-facing messages
- Replace element.style.* with CSS classes for better theming
- Add CSS classes: ld-overlay-container, ld-overlay-container-isolated, ld-file-explorer-indicator--encrypted
- Use addClass/removeClass instead of direct style manipulation
- Update status bar to use ld-status-bar class
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 3, 2025

🔍 Code Quality Report

Check Status
TypeScript ✅ Passed
ESLint ✅ Passed
Architecture ✅ Passed

✅ All checks passed!

Code quality meets all standards. Ready to merge! 🚀

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 3, 2025

✅ Quality Gate Summary

Checks

  • ✅ TypeScript compilation
  • ✅ ESLint validation
  • ✅ Build successful

PR Stats

  • Files: 5
  • Lines: +112 / -92

All quality checks passed! 🚀

@Rynaro Rynaro merged commit 2cd9342 into main Dec 3, 2025
2 checks passed
@Rynaro Rynaro deleted the fix/obsidian-bot-review-fixes branch December 3, 2025 01:34
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.

1 participant