[feat] Add manager capability feature flags

Add support for manager v4 feature flag and client UI capability:
- MANAGER_SUPPORTS_V4: Server-side flag for v4 manager support
- supports_manager_v4_ui: Client-side flag for v4 UI support

These flags enable proper capability negotiation between frontend and
backend for manager UI selection (legacy vs v4).

Also fix TypeScript errors by adding @types/lodash.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
bymyself
2025-08-17 19:01:08 -07:00
parent 86baabc2d5
commit 642686165a
3 changed files with 23 additions and 2 deletions

View File

@@ -59,6 +59,21 @@ describe('useFeatureFlags', () => {
)
})
it('should access supportsManagerV4', () => {
vi.mocked(api.getServerFeature).mockImplementation(
(path, defaultValue) => {
if (path === ServerFeatureFlag.MANAGER_SUPPORTS_V4) return true as any
return defaultValue
}
)
const { flags } = useFeatureFlags()
expect(flags.supportsManagerV4).toBe(true)
expect(api.getServerFeature).toHaveBeenCalledWith(
ServerFeatureFlag.MANAGER_SUPPORTS_V4
)
})
it('should return undefined when features are not available and no default provided', () => {
vi.mocked(api.getServerFeature).mockImplementation(
(_path, defaultValue) => defaultValue as any
@@ -67,6 +82,7 @@ describe('useFeatureFlags', () => {
const { flags } = useFeatureFlags()
expect(flags.supportsPreviewMetadata).toBeUndefined()
expect(flags.maxUploadSize).toBeUndefined()
expect(flags.supportsManagerV4).toBeUndefined()
})
})