refactor: rename cache keys to follow naming convention

- Remove redundant 'ui.activeTabId' from UseCacheSchema (already in TabsState)
- Rename 'tabs_state' to 'ui.tab.state' to follow ESLint naming rule
- Update useTabs hook to use new cache key

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
MyPrototypeWhat
2025-11-26 15:10:12 +08:00
parent 9d6a8f9225
commit cf7801f8ec
5 changed files with 12 additions and 38 deletions
+3 -9
View File
@@ -48,9 +48,6 @@ export type UseCacheSchema = {
'topic.active': CacheValueTypes.CacheTopic | null
'topic.renaming': string[]
'topic.newly_renamed': string[]
// UI State
'ui.activeTabId': string
}
export const DefaultUseCache: UseCacheSchema = {
@@ -81,10 +78,7 @@ export const DefaultUseCache: UseCacheSchema = {
// Topic management
'topic.active': null,
'topic.renaming': [],
'topic.newly_renamed': [],
// UI State
'ui.activeTabId': ''
'topic.newly_renamed': []
}
/**
@@ -123,11 +117,11 @@ export interface TabsState {
* This ensures type safety and prevents key conflicts
*/
export type RendererPersistCacheSchema = {
tabs_state: TabsState
'ui.tab.state': TabsState
}
export const DefaultRendererPersistCache: RendererPersistCacheSchema = {
tabs_state: { tabs: [], activeTabId: '' }
'ui.tab.state': { tabs: [], activeTabId: '' }
}
/**