feat: user-chosen browse views with grid/list toggle and profile sync
Build & Push Docker Image / build (push) Successful in 2m25s
Build & Push Docker Image / build (push) Successful in 2m25s
- view modes grid | table | rows + density cozy/compact, persisted via localStorage and shareable ?view=?density= URL params (URL wins) - table view: sortable columns (name, rating, reviews), new sort options name_asc/name_desc/recently_updated (backend enum + handler) - live debounced search, removable filter chips, '/' focuses search - virtualization via @tanstack/react-virtual for table and rows views - profile sync: users.preferences jsonb + GET/PUT /api/auth/me/preferences; preference precedence URL > server profile > localStorage > default - add local rollup/lightningcss/tailwindcss oxide native binaries for macos dev
This commit is contained in:
@@ -35,7 +35,7 @@ export const GetVersionResponse = zod.object({
|
||||
export const ListToolsQueryParams = zod.object({
|
||||
"category": zod.coerce.string().optional(),
|
||||
"search": zod.coerce.string().optional(),
|
||||
"sort": zod.enum(['newest', 'top_rated', 'most_reviewed']).optional()
|
||||
"sort": zod.enum(['newest', 'top_rated', 'most_reviewed', 'name_asc', 'name_desc', 'recently_updated']).optional()
|
||||
})
|
||||
|
||||
export const ListToolsResponseItem = zod.object({
|
||||
@@ -429,6 +429,29 @@ export const GetMeResponse = zod.object({
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* @summary Get current user's browse preferences
|
||||
*/
|
||||
export const GetMePreferencesResponse = zod.object({
|
||||
"view": zod.enum(['grid', 'table', 'rows']).optional(),
|
||||
"density": zod.enum(['cozy', 'compact']).optional()
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* @summary Update current user's browse preferences
|
||||
*/
|
||||
export const UpdateMePreferencesBody = zod.object({
|
||||
"view": zod.enum(['grid', 'table', 'rows']).optional(),
|
||||
"density": zod.enum(['cozy', 'compact']).optional()
|
||||
})
|
||||
|
||||
export const UpdateMePreferencesResponse = zod.object({
|
||||
"view": zod.enum(['grid', 'table', 'rows']).optional(),
|
||||
"density": zod.enum(['cozy', 'compact']).optional()
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* @summary List all local users (admin only)
|
||||
*/
|
||||
|
||||
@@ -41,6 +41,9 @@ export * from './user';
|
||||
export * from './userCreateInput';
|
||||
export * from './userCreateInputRole';
|
||||
export * from './userCreateInputTier';
|
||||
export * from './userPreferences';
|
||||
export * from './userPreferencesDensity';
|
||||
export * from './userPreferencesView';
|
||||
export * from './userRole';
|
||||
export * from './userRoleUpdate';
|
||||
export * from './userRoleUpdateRole';
|
||||
|
||||
@@ -13,4 +13,7 @@ export const ListToolsSort = {
|
||||
newest: 'newest',
|
||||
top_rated: 'top_rated',
|
||||
most_reviewed: 'most_reviewed',
|
||||
name_asc: 'name_asc',
|
||||
name_desc: 'name_desc',
|
||||
recently_updated: 'recently_updated',
|
||||
} as const;
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
/**
|
||||
* Generated by orval v8.9.1 🍺
|
||||
* Do not edit manually.
|
||||
* Api
|
||||
* ToolRate API — Tool listing and rating platform
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
import type { UserPreferencesDensity } from './userPreferencesDensity';
|
||||
import type { UserPreferencesView } from './userPreferencesView';
|
||||
|
||||
export interface UserPreferences {
|
||||
view?: UserPreferencesView;
|
||||
density?: UserPreferencesDensity;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Generated by orval v8.9.1 🍺
|
||||
* Do not edit manually.
|
||||
* Api
|
||||
* ToolRate API — Tool listing and rating platform
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type UserPreferencesDensity = typeof UserPreferencesDensity[keyof typeof UserPreferencesDensity];
|
||||
|
||||
|
||||
export const UserPreferencesDensity = {
|
||||
cozy: 'cozy',
|
||||
compact: 'compact',
|
||||
} as const;
|
||||
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Generated by orval v8.9.1 🍺
|
||||
* Do not edit manually.
|
||||
* Api
|
||||
* ToolRate API — Tool listing and rating platform
|
||||
* OpenAPI spec version: 0.1.0
|
||||
*/
|
||||
|
||||
export type UserPreferencesView = typeof UserPreferencesView[keyof typeof UserPreferencesView];
|
||||
|
||||
|
||||
export const UserPreferencesView = {
|
||||
grid: 'grid',
|
||||
table: 'table',
|
||||
rows: 'rows',
|
||||
} as const;
|
||||
Reference in New Issue
Block a user