Skip to content

Refactoring - #14

Merged
idle-river merged 3 commits into
mainfrom
refactoring
Oct 2, 2026
Merged

idle-river merged 3 commits into
mainfrom
refactoring

Conversation

@idle-river

Copy link
Copy Markdown
Owner

This pull request refactors the CLI and TUI code to consistently use the Silicate struct for all password manager operations, improving code organization and encapsulation. Instead of calling free functions from silicate_core, the CLI and TUI now create a Silicate instance and use its methods, which simplifies dependency management and makes the codebase more modular and maintainable.

Refactoring to use the Silicate struct for all operations:

  • Replaced all direct calls to silicate_core free functions in main.rs with corresponding methods on a Silicate instance, including password encryption/decryption, key management, password listing, tag management, and stats retrieval. A single Silicate instance is now created at the start of main() and passed where needed. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22]

  • Updated helper functions such as get_key to accept a &Silicate parameter and use its methods for key retrieval and derivation, further centralizing logic within the struct.

TUI integration improvements:

  • Modified the TUI App struct to store a Silicate instance, and updated its constructor and usage to accept and use this instance, ensuring all TUI operations also go through the unified interface. [1] [2]

Code style and minor cleanups:

  • Applied minor formatting and style improvements in the TUI code for better readability, such as expanding certain statements for clarity. [1] [2]

Dependency and import adjustments:

  • Updated imports in both CLI and TUI modules to import Silicate and its error types directly, removing unused or redundant imports. [1] [2]

Initialization consistency:

  • Ensured that Silicate is always initialized with the configuration directory, and that all file and password operations are routed through the struct for consistency and future extensibility. [1] [2]

@idle-river idle-river self-assigned this Oct 2, 2026
Copilot AI balanced review requested due to automatic review settings October 2, 2026 15:48

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@idle-river
idle-river merged commit 63efe45 into main Oct 2, 2026
1 check passed
@idle-river
idle-river deleted the refactoring branch October 2, 2026 15:50
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