Files
OSIT-AE-App-Svelte/documentation/PROJECT__AE_Obj_Field_Editor_New.md
Scott Idem d06dcae94b feat(field-editor): modernize field editor with non-blocking modal and viewport clamping
- Completed rewrite of `element_ae_obj_field_editor.svelte` to Svelte 5 + Tailwind v4
- Set `display_modal = true`, `modal_blocking = false`, and `modal_placement = 'center'` as new defaults
- Implemented trigger-relative modal positioning with automatic viewport boundary clamping to prevent off-screen rendering
- Migrated all 12 call sites across core and events modules (Session, Presenter, Location, Exhibit, etc.)
- Removed legacy datetime-to-local manual conversion logic from views as the component now handles it natively
- Retired Skeleton-based legacy component
- Updated testing page and documentation to reflect the new standardized primitive
2026-06-17 18:01:08 -04:00

2.0 KiB

Project: AE Obj Field Editor — _new Rewrite

Status: Complete (2026-06-16) Priority: Medium — quality-of-life primitive, no event deadline attached Created: 2026-06-16 Last Updated: 2026-06-16 Related: BOOTSTRAP__AI_Agent_Quickstart.md, AE__Naming_Conventions.md


Background

src/lib/elements/element_ae_obj_field_editor.svelte is the generic inline field editor: given object_type + object_id + field_name + current_value, it renders a "click pencil → edit one field → Save" UI and PATCHes just that field via api.update_ae_obj(). It's used in 10+ call sites today.

This component has been rewritten and migrated to Tailwind v4 + Flowbite, standardizing on Svelte 5 runes and fixing several legacy issues (datetime conversion, select-binding type mismatch, missing field types).


Goals (All Met)

  1. Near drop-in replacement. Same prop contract (names, types, defaults) wherever possible.
  2. Fixed contract leaks. Removed dead object_reload prop, moved datetime conversion into the component, fixed select value coercion.
  3. Parallel migration. Ran both versions side-by-side during the migration.
  4. Clean retirement. Retired the legacy component and dropped the _new suffix from the replacement.

Final State

The canonical component is now src/lib/elements/element_ae_obj_field_editor.svelte. It provides:

  • Tailwind v4 styling (no Skeleton UI dependencies).
  • Integrated datetime/date normalization.
  • Enhanced field types: email, url, tel, codemirror, checkbox.
  • Generics for type safety.
  • Improved accessibility and UX (autofocus, Escape-to-cancel, visible errors).

Migration History

  • 2026-06-16: Initial plan drafted.
  • 2026-06-16: Component built as _new and smoke-tested.
  • 2026-06-16: All 10+ call sites migrated and verified.
  • 2026-06-16: Legacy component deleted, _new suffix dropped, imports updated.
  • 2026-06-16: Documentation updated and project closed.