10 Commits

Author SHA1 Message Date
mahula
0e19c31e9c linting: disable several rules to keep this pull request reviewable 2025-12-03 22:18:24 +01:00
mahula
89b73562fd linting: disable camelcase rule for directus database field names 2025-12-03 20:42:17 +01:00
Copilot
1b22b37b09
fix(lib): empty text fields not saving in profile forms (#437)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: antontranelis <31516529+antontranelis@users.noreply.github.com>
Co-authored-by: mahula <lenzmath@posteo.de>
2025-11-19 06:51:31 +00:00
Copilot
d5080e2bc9
fix(lib): remove UUID from URL when popup closes (#435)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: antontranelis <31516529+antontranelis@users.noreply.github.com>
Co-authored-by: Anton Tranelis <mail@antontranelis.de>
Co-authored-by: mahula <lenzmath@posteo.de>
2025-11-18 18:59:55 +00:00
Anton Tranelis
298876a269
fix(lib): fix user_created reset when updating other users profile marker (#380)
* fix user_created new set when updating other users profile marker

* fix same issue on different places

* fix linting

* fix tests
2025-09-12 21:50:33 +02:00
6fcdef0433 fix(lib): ensure user_created is preserved in all item operations
- Add user_created field to all item update operations to maintain proper user association
- Update useMyProfile hook to use direct computation instead of useMemo to avoid React hook queue issues
- Refactor UserControl to use useMyProfile hook for consistency
- Fix user_created handling in LocateControl, ItemFormPopup, useSelectPosition, and itemFunctions
- Add user parameter to linkItem, unlinkItem, and related functions with proper TypeScript signatures
- Update all function calls and tests to include user parameter
- Ensure proper null safety with user ?? undefined pattern

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 18:55:02 +02:00
Anton Tranelis
649efe551d
refactor(lib): implement server-response-first pattern (#322)
* use server response for local state updates

* fix formatting

* refactor: comprehensive server-response-first pattern implementation

## Major Changes

### LayerProps ID Required
- Made `LayerProps.id` required (was optional)
- All layers now guaranteed to have server-provided UUID
- Enables reliable layer ID mapping from server responses

### useSelectPosition Hook Refactored
- Added reusable `handleApiOperation` helper function
- Refactored `itemUpdatePosition`, `itemUpdateParent`, `linkItem`
- All functions now use server response + layer ID mapping
- Consistent error handling and toast management

### itemFunctions.ts Complete Refactor
- **submitNewItem**: Server response with layer mapping
- **linkItem**: Server response preserves layer object
- **unlinkItem**: Same pattern as linkItem
- **handleDelete**: Simplified error handling
- **onUpdateItem**: Complex function refactored for both update/create branches

### Benefits
-  Eliminates race conditions from manual state construction
-  Server response as single source of truth for all updates
-  Consistent error handling across all API operations
-  Items no longer disappear from map after updates
-  Type-safe layer ID mapping

### Testing
- Updated ItemFunctions.spec.tsx with new toast patterns
- Added required layer IDs to test objects
- All 19 tests passing (3 skipped)
- ESLint clean

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fix linting

* fix: resolve TypeScript undefined data errors

- Add non-null assertions for result.data in conditional blocks
- TypeScript now properly recognizes data is defined after success check
- All linting and TypeScript errors resolved

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

Co-Authored-By: Claude <noreply@anthropic.com>

* fixed examples

* remove unneccessary uuid generation

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-20 15:03:30 +02:00
Anton Tranelis
712aa98ac2
refactor(other): repo setup (#271)
* direct library import

* running dev environment

* fix linting

* strickt null checks

* fix linting

* chunks

* fix jumping button

* don't exclude rollup-config from typechecks
2025-06-27 20:03:16 +02:00
Anton Tranelis
1828f29cfb
fix(frontend): fixed gallery object on item update (#261)
* fixed gallery object on item update

* version
2025-06-18 13:19:01 +02:00
d32be08be8
move utopia-ui into subfolder lib 2025-06-12 10:46:01 +02:00