Skip to content

Commit efa33c4

Browse files
committed
Merge branch 'main' of https://github.com/NotePlan/plugins
2 parents 6c430c5 + 9724478 commit efa33c4

68 files changed

Lines changed: 4674 additions & 1233 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.cursor/rules/html-react-rules.mdc‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ alwaysApply: true
1313

1414
## Promise Polyfills
1515

16-
NotePlan's JSContext may not have `Promise.resolve()` or `Promise.all()`. Use polyfills from `@helpers/promisePolyfill.js`: `initPromisePolyfills()`, `promiseResolve()`, `promiseAll()`, `waitForCondition()`, `setTimeoutPolyfill()`. After creating/modifying notes, call `DataStore.updateCache(note, true)`.
16+
**Do not use raw `Promise.resolve`, `Promise.all`, or `Promise.race` in plugin code—NotePlan's JSContext may not have them.** Use polyfills from `@helpers/promisePolyfill.js`: `initPromisePolyfills()`, `promiseResolve()`, `promiseAll()`, `promiseRace()`, `waitForCondition()`, `setTimeoutPolyfill()`. After creating/modifying notes, call `DataStore.updateCache(note, true)`.
1717

1818
## React Function Memoization (CRITICAL)
1919

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## About Plugins/package.json / package-lock.json
44

5+
## [Unreleased]
6+
7+
### Helpers
8+
9+
- **helpers/NPnote.js** — `getNoteFromIdentifier` improvements:
10+
- Resolve by filename first when the identifier ends with `DataStore.defaultFileExtension` (e.g. `Note.md` or `folder/Note.md`) via `DataStore.noteByFilename(identifier, 'Notes')`.
11+
- Fallback chain for project note by title: exact title, then quoted title (e.g. `"Title"`), then case-insensitive + search all folders.
12+
- Clearer error message when the identifier is neither a project note nor a valid date/interval (no longer reports title strings as "not a valid date string").
13+
514
## [3.20.0] - 2024-02-15 (@dwertheimer)
615

716
- added clof to eslint and flow rc

‎dwertheimer.Forms/CHANGELOG.md‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,64 @@
44

55
See Plugin [README](https://github.com/NotePlan/plugins/blob/main/dwertheimer.Forms/README.md) for details on available commands and use case.
66

7+
## [1.0.25] 2026-02-06 @dwertheimer
8+
9+
### Merged
10+
- **Merge of fix/conditional-values-bgcolor-and-button-group-default into main.** This release combines all changes from the fix branch (conditional-values, button-group default, Form Browser overlay, simplified submit response, frontmatter allowlist) with main's 1.0.24 fixes (Processing Template dropdown, GenericDatePicker Safari, formProcessorTitle eliminated). See 1.0.21–1.0.24 below for details.
11+
12+
## [1.0.24] 2026-02-05 @dwertheimer
13+
14+
### Fixed
15+
- **Processing Template dropdown selection**: Selecting a new Processing Template from the dropdown now correctly shows the newly selected item instead of the previous value. Root cause: SearchableChooser only matched note objects by filename; NoteChooser passes the note title as value, so the match failed and the display reverted to the old value.
16+
- **GenericDatePicker (Safari/WebKit)**:
17+
- **Uncontrolled input**: Switched to uncontrolled `<input type="date">` (defaultValue only, no value=) so the native control owns segment state; prevents React from overwriting with empty and fixes month/day resetting and year showing 0001/0002 while typing.
18+
- **No clear on empty onChange**: Safari often fires change with an empty value when focusing the year segment or mid-typing; we no longer clear or call onSelectDate(cleared) in onChange. Clearing only happens on blur (field left empty) or Clear button.
19+
- **Partial-year guard**: Only accept dates with year 1000–9999 in change/blur; ignore placeholder years (0002, 0020, 0202) so we don’t overwrite the field or steal focus when typing the year digit-by-digit.
20+
- **Sync effect**: When `startingSelectedDate` is falsy or invalid, the effect no longer clears the input (user may be mid-typing). We only push from parent when the prop has a valid date; sync is done by writing to `inputRef.current.value`.
21+
- **Clear button**: When clearing, we set `inputRef.current.value = ''` so the DOM stays in sync.
22+
- **Blur**: On blur with empty value we clear and notify parent; on blur with valid full date (year 1000–9999) we commit and call onSelectDate.
23+
24+
### Documentation
25+
- **GenericDatePicker Safari limitation**: Documented that in Safari/WebKit, typing in the native date input with a pause in a segment (e.g. year) can cause the next keystroke to replace rather than append (e.g. "0" then "2" may show "2" instead of "02"). This is browser behavior. Workaround: type the segment without pausing, or use the calendar picker. A text-field alternative (parse on blur) is noted as a possible future improvement in the component header.
26+
27+
## [1.0.23] 2026-01-27 @dwertheimer
28+
29+
### Changed
30+
- **Simplified form submission response handling**: `handleSubmitButtonClick` and related functions now return only the necessary information (`success`, `formSubmissionError`, `aiAnalysisResult`) instead of the full `reactWindowData` object. This simplifies the code and avoids unnecessary data passing. The window only needs to know what happened, not all the window data.
31+
32+
### Fixed
33+
- **Form Browser "Submitting..." overlay**: The overlay now appears reliably when submitting a form from the Form Browser. Uses `flushSync` so React commits the overlay to the DOM before the async request runs (avoids WebView/rAF timing issues). Added a minimum display time of 400 ms so the overlay is always visible even when the request completes quickly.
34+
35+
### Edited in this release
36+
- `dwertheimer.Forms/src/formSubmission.js` — Simplified `handleSubmitButtonClick` and processing functions to return `{ success: boolean, formSubmissionError?: string, aiAnalysisResult?: string }` instead of full `PassedData`. Removed unnecessary `withPluginDataUpdates` usage.
37+
- `dwertheimer.Forms/src/formSubmitHandlers.js` — Updated to handle simplified return type from `handleSubmitButtonClick`.
38+
- `dwertheimer.Forms/src/formBrowserHandlers.js` — Updated to handle simplified return type from `handleSubmitButtonClick`.
39+
- `dwertheimer.Forms/src/components/FormBrowserView.jsx` — Submitting overlay: use `flushSync` to commit overlay before request; `hideOverlay()` with 400 ms minimum display time; `overlayShownAtRef` for timing.
40+
41+
## [1.0.22] 2026-01-27 @dwertheimer
42+
43+
### Changed
44+
- **ValueInsertButtons use shared constants**: The +Color, +Icon, +Pattern, and +IconStyle insert buttons (ValueInsertButtons) now import `PATTERNS`, `ICON_STYLES`, and `FA_ICON_NAMES` from `@helpers/react/DynamicDialog/valueInsertData`, so they use the same options as the color/icon/pattern/icon-style choosers in the Form Builder.
45+
46+
### Edited in this release
47+
- `dwertheimer.Forms/src/components/ValueInsertButtons.jsx` — Replaced inline PATTERNS, ICON_STYLES, FA_ICON_NAMES with imports from valueInsertData.
48+
49+
## [1.0.21] 2026-01-27 / 2026-02-03 @dwertheimer
50+
51+
### Fixed (from fix branch)
52+
- **Conditional-values excluded from form until submit**: Fields with type `conditional-values` (e.g. `bgColor` derived from a button-group) are no longer added to form state, autosave, or the submit payload until the backend runs `resolveConditionalValuesFields` in `prepareFormValuesForRendering`. Previously they appeared with empty values in the form and autosave.
53+
- **Button-group default applied on open and submit**: When a form field has type `button-group` and an option with `isDefault: true`, that option's value is now used as the initial value when the form opens and when building the submit payload, so the source field (e.g. `theType`) is set correctly and conditional-values (e.g. `bgColor`) resolve as intended.
54+
55+
### Changed (from main)
56+
- **formProcessorTitle eliminated**: Deprecated `formProcessorTitle` in favor of `receivingTemplateTitle` as the single canonical field. The two were redundant and could get out of sync. Going forward only `receivingTemplateTitle` is used/written.
57+
- **Backward compatible**: Forms with only `formProcessorTitle` (legacy) are still read correctly everywhere. On save, the value is migrated to `receivingTemplateTitle` and `formProcessorTitle` is removed from the note.
58+
- TemplateRunner and form submission have always used `receivingTemplateTitle`; `formProcessorTitle` was only used in the Form Builder UI and could cause duplication.
59+
60+
### Edited in this release
61+
- `dwertheimer.Forms/src/formSubmission.js` — `ensureAllFormFieldsExist` and `handleSubmitButtonClick` skip conditional-values when adding missing fields.
62+
- `dwertheimer.Forms/src/formBrowserHandlers.js` — `handleSubmitForm` skips conditional-values when adding missing fields.
63+
- `helpers/react/DynamicDialog/DynamicDialog.jsx` — `getInitialItemStateObject`, "ensure all fields" effect, and `handleSave` skip conditional-values and apply button-group `isDefault` when initializing or filling missing keys.
64+
765
## [1.0.20] 2026-01-26 @dwertheimer
866

967
### Fixed

0 commit comments

Comments
 (0)