Skip to content

Comments

Merge np.Shared and Forms improvements#712

Merged
dwertheimer merged 35 commits intomainfrom
forms-improvements
Jan 3, 2026
Merged

Merge np.Shared and Forms improvements#712
dwertheimer merged 35 commits intomainfrom
forms-improvements

Conversation

@dwertheimer
Copy link
Collaborator

No description provided.

- Add trigger: triggerOpenForm to auto open the form when you open the note
- Rename getTemplateFormData to openTemplateForm
- Remove Form Heading fallback in preview
…peSelector

- Add includeAllOption prop to SpaceChooser component (default: false)
- When enabled, adds 'All Private + Spaces' option that returns '__all__'
- Add space-chooser to TSettingItemType union
- Add checkbox in FieldEditor for space-chooser fields to enable includeAllOption
- Add space-chooser to fieldTypes.js so it appears in field type selector
- Add filter functionality to FieldTypeSelector with auto-focus
- Filter searches across field type value, label, and description
- Update dialogElementRenderer to pass through includeAllOption prop
- Set fixed height (600px) on field-type-selector-modal to prevent shrinking
- Remove min-height constraints from content and list areas
- Use proper flexbox scrolling with min-height: 0
- Add note about handling '__all__' value in FieldEditor help text
The requestFromPlugin function resolves with just the data portion, not a wrapper object. Since the promise only resolves on success, we don't need to check for success. This fixes the false 'Unknown error' message when removing favorites.
… to top, and focus filter after 1min idle

- Copy IdleTimer component to helpers/react
- Add IDLE_TIMEOUT_MS constant (60000ms = 1 minute)
- Add filterInputRef and update FilterableList to accept it
- Update handleIdleTimeout to reset showNotes, clear filter, scroll to top, and focus filter
- Add showTitleOnly prop to NoteChooser to show only note title (not path/title)
- Update note-chooser in add favorite dialog to use 2-line layout (shortDescriptionOnLine2) and showTitleOnly
- Add new AutosaveField component for automatic periodic form state saving
- Support form title and window title in autosave filename patterns (<formTitle>, <FORM_NAME>)
- Add invisible prop to hide autosave UI while still performing saves
- Change default autosave interval from 5 to 2 seconds
- Fix trash folder note finding by using searchAllFolders parameter
- Add autosave field type to Form Builder with configuration UI
- Include lastUpdated timestamp in saved form state
- Use windowTitle as fallback when formTitle is empty
- Support code block replacement for autosave content in same note
- Add toolbar height offset calculation when scrolling to top in FavoritesView
- Use same calculation as Toast.css: calc(1rem + var(--noteplan-toolbar-height, 0))
- Add showReloadButton: false to hide reload button in favorites sidebar
- Change icon color to use theme variable var(--tint-color) instead of hardcoded blue-500
- Change iconColor from hardcoded 'blue-500' to theme variable 'var(--tint-color, #dc8a78)'
- Add AutosaveField component with debounced autosave (default 2s interval)
- Autosave saves form state to code block in @trash by default
- Support for custom autosave filename patterns with <FORM_NAME> and <ISO8601> placeholders
- Add invisible autosave option for silent background saves
- Add global autosave setting in plugin.json (default: true) to auto-add invisible autosave to all forms
- Add 'Restore form from autosave' command to restore form with saved data
- Autosave includes form title, template filename, and template title for restoration
- Add x-callback URL restore link in autosave notes (inserted after title, preserving note structure)
- Fix debounce to prevent saving on every keystroke
- Fix @trash folder note search to find existing autosave files
- Add final autosave before form submission
- Pass templateFilename and templateTitle through to autosave field
- Pass defaultValues to DynamicDialog for form pre-population on restore
…Dialog input widths

- Replace CalendarPicker (react-day-picker) with GenericDatePicker using native HTML date input
- Standardize all input field widths using --dynamic-dialog-input-width CSS variable (180px default)
- Fix validation messages to appear inline to the right of fields with triangle icon
- Add transparent placeholder divs to reserve space for validation messages and prevent input shrinking
- Fix chooser alignment and add consistent 1rem gap in compact mode
- Update FormBuilder documentation with CSS override instructions
- Fix Safari calendar icon visibility in date picker
- Remove unused CalendarPicker options (buttonText, showCalendarByDefault) from Form Builder editor
- Add filter: opacity(0.7) to calendar picker indicator for Safari compatibility
- Safari's native UI elements may not respect opacity property, but filter works
- Set opacity to 0.7 for more subtle calendar icon appearance
- Add text-indent: 1rem to chooser inputs for left spacing without affecting border
- Add vertical padding (4px) to match other input field heights
- Fix arrow/icon positioning to be inside input border (right: 0.5rem)
- Adjust input padding (4px 1.75rem 4px 0) to accommodate arrow inside border
- Reset text-indent on dropdown options (they already have padding)
- Ensure input uses full wrapper width with box-sizing: border-box
- Match input height calculation to other inputs (line-height + padding)
- Fix DropdownSelectChooser arrow positioning to match SearchableChooser
- Add findDuplicateFormTemplates() helper to detect duplicate form titles
- Update openTemplateForm() and openFormBuilder() to check for duplicates and show MESSAGE_BANNER
- Update getFormFields() to detect duplicates when template is selected in Form Browser
- Update Form Browser's 'Edit Existing Form' flow to use chooseNoteV2 for decorated display
- Filter form templates from all spaces (Private and Teamspaces) in Form Builder chooser
- Find forms in both @Forms and @templates folders across all spaces
- Show warning banners when duplicate forms are detected to prevent user confusion
- Fix Toast.css: Change descendant selectors (.toast .border-success) to class combinators (.toast.border-success) so color and border styles apply correctly
- Fix toast positioning: Use calc(1rem + var(--noteplan-toolbar-height, 0px)) to properly account for toolbar height when variable exists
- Add debug mode to Form Builder window initialization
- Add Test Toast button in Root.jsx debug section that cycles through all toast types sequentially
- Toast now displays at top of viewport with proper styling applied
- Update getFolders to properly handle null space parameter (show all folders)
- Update FormView and FormBrowserView to load all folders (space: null) so folder-choosers can filter client-side
- Fix dialogElementRenderer to handle 'Private' display value conversion to empty string
- Improve space value conversion logic to handle display values vs IDs
- Add enhanced debug logging for spaceFilter and spaceValue in folder-chooser
- Ensure FolderChooser properly filters when spaceFilter is set to empty string (Private), teamspace ID, or null (all spaces)
- Add Source Space Field dropdown in FieldEditor for folder-chooser fields to configure space dependency
- Add --fg-placeholder-color, --fg-error-color, --bg-error-color, --fg-disabled-color, --bg-disabled-color to standard color list
- Update NPThemeToCSS.js to generate these new colors using color-mix and rgba functions
- These colors are now part of the standard NotePlan theme color system
- Replace --text-color with --fg-main-color (20+ uses)
- Replace --border-color with --divider-color (15+ uses)
- Replace --hover-bg with --bg-alt-color (8+ uses)
- Replace --icon-color with --item-icon-color (4+ uses)
- Replace --dropdown-bg with --bg-main-color (5+ uses)
- Replace --bg-color with --bg-main-color (4 uses)
- Replace --gray-500/--gray-600 with --fg-placeholder-color (13+ uses)
- Replace --text-muted/--text-secondary-color/--fg-secondary-color with --fg-placeholder-color (8+ uses)
- Replace --error-color with --fg-error-color (1 use)
- Replace --primary-color with --tint-color (1 use)
- Replace disabled text variants with --fg-disabled-color (4 uses)
- Replace --disabled-bg/--bg-disabled with --bg-disabled-color (3 uses)
- Replace --selected-bg with --bg-alt-color (1 use)
- Replace --text-placeholder-color with --fg-placeholder-color (1 use)
- Remove --tint-color-hover, use CSS filter: brightness(90%) instead (4 uses)
- Update dynamic calendar color fallback in EventChooser.jsx

All files updated: DynamicDialog components, Forms components, InfoIcon, and other React components
…d test coverage

- Add width property to TSettingItem for SearchableChooser-based fields
  (folder-chooser, note-chooser, space-chooser, heading-chooser,
  dropdown-select, event-chooser)
- Add width input field in FieldEditor with CSS validation
- Update all chooser components to accept and apply custom width
- Width overrides default even in compact mode
- Support all valid CSS width values (px, %, vw, calc(), etc.)

Form Field Render Test improvements:
- Add missing field types: space-chooser, event-chooser, markdown-preview, autosave
- Add dependency variants: folder→space, event→date, markdown→note
- Update to use new dependency property names (sourceSpaceKey, sourceDateKey, etc.)
- Add width examples: compact with 80vw, non-compact with 79%, 300px, calc()

UI styling improvements:
- GenericDatePicker: Use tint-color for calendar icon (0.6 opacity) and selected date
- SearchableChooser: Apply 0.6 opacity to icons/arrows with hover states
- Apple switch: Add border using --border-color, fix checked state to fill completely
- EventChooser: Fix date parsing to handle string dates from JSON serialization
Change top position from 50% to 56% for better visual alignment of:
- Manual entry indicator
- Chooser icons
- Chooser arrows
- Add className="template-form" to DynamicDialog in FormPreview and FormView
- Add left/right padding (1rem) to dynamic-dialog-content via style prop
- Use padding instead of margin to prevent content overflow
- Keep Forms-specific styling out of shared DynamicDialog.css
- Add changelog entry for version 0.9.0 documenting recent changes:
  - Toast notification CSS selector fixes
  - Toast positioning improvements for toolbar height
  - MessageBanner component updates
  - JSDoc updates
  - minAppVersion update to 3.20.0
- Update plugin.json version to 0.9.0
@dwertheimer dwertheimer merged commit e3e9588 into main Jan 3, 2026
2 of 4 checks passed
@dwertheimer dwertheimer deleted the forms-improvements branch January 3, 2026 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant