mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-02 08:33:36 +00:00
docs: enhance docstrings to reach 80% coverage threshold
- Expanded docstrings in use-settings-migration.ts for parseLocalStorageSettings, localStorageHasMoreData, mergeSettings, and performSettingsMigration - Expanded docstrings in use-settings-sync.ts for getSettingsFieldValue and hasSettingsFieldChanged helper functions - Added detailed parameter and return value documentation - Improved clarity on migration flow and settings merging logic This brings docstring coverage from 77.78% to 80%+ to satisfy CodeRabbit checks. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -81,7 +81,15 @@ const SETUP_FIELDS_TO_SYNC = ['isFirstRun', 'setupComplete', 'skipClaudeSetup']
|
||||
|
||||
/**
|
||||
* Helper to extract a settings field value from app state
|
||||
* Handles special cases for nested/mapped fields
|
||||
*
|
||||
* Handles special cases where store fields don't map directly to settings:
|
||||
* - currentProjectId: Extract from currentProject?.id
|
||||
* - terminalFontFamily: Extract from terminalState.fontFamily
|
||||
* - Other fields: Direct access
|
||||
*
|
||||
* @param field The settings field to extract
|
||||
* @param appState Current app store state
|
||||
* @returns The value of the field in the app state
|
||||
*/
|
||||
function getSettingsFieldValue(
|
||||
field: (typeof SETTINGS_FIELDS_TO_SYNC)[number],
|
||||
@@ -98,6 +106,16 @@ function getSettingsFieldValue(
|
||||
|
||||
/**
|
||||
* Helper to check if a settings field changed between states
|
||||
*
|
||||
* Compares field values between old and new state, handling special cases:
|
||||
* - currentProjectId: Compare currentProject?.id values
|
||||
* - terminalFontFamily: Compare terminalState.fontFamily values
|
||||
* - Other fields: Direct reference equality check
|
||||
*
|
||||
* @param field The settings field to check
|
||||
* @param newState New app store state
|
||||
* @param prevState Previous app store state
|
||||
* @returns true if the field value changed between states
|
||||
*/
|
||||
function hasSettingsFieldChanged(
|
||||
field: (typeof SETTINGS_FIELDS_TO_SYNC)[number],
|
||||
|
||||
Reference in New Issue
Block a user