Skip to content

Commit 9cc67ee

Browse files
committed
Squashed commit of the following:
commit fbcb690b2732da309eda0ead7c640c86c1929865 Merge: f1243772 1712b51 Author: David Wertheimer <[email protected]> Date: Sun Jan 4 10:50:05 2026 -0800 Merge branch 'dashboard-settings-centering-fix' of https://github.com/NotePlan/plugins into dashboard-settings-centering-fix commit f12437729ec3bf8994584b5d81c2a8ecde7a3ef6 Author: David Wertheimer <[email protected]> Date: Sun Jan 4 10:50:03 2026 -0800 Add examples to form builder; clean up css commit 1712b51 Merge: 724ab0e 79e3e44 Author: Jonathan Clark <[email protected]> Date: Sat Jan 3 19:54:08 2026 +0000 Merge branch 'main' into dashboard-settings-centering-fix commit 724ab0e Author: David Wertheimer <[email protected]> Date: Sat Jan 3 11:21:35 2026 -0800 Fix SettingsDialog vertical centering
1 parent 79e3e44 commit 9cc67ee

File tree

16 files changed

+469
-60
lines changed

16 files changed

+469
-60
lines changed

dwertheimer.Forms/src/FormFieldRenderTest.js

Lines changed: 366 additions & 35 deletions
Large diffs are not rendered by default.

dwertheimer.Forms/src/components/FieldEditor.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,9 @@ export function FieldEditor({ field, allFields, onSave, onCancel, requestFromPlu
11911191
<option value="title">Note by Title</option>
11921192
<option value="field">Note from Another Field</option>
11931193
</select>
1194-
<div className="field-editor-help">Choose how to get the markdown content to display</div>
1194+
<div className="field-editor-help">
1195+
Choose how to get the markdown content to display. <strong>Note:</strong> This is a very basic markdown renderer that does not display full NotePlan formatted tasks and items. It's intended for a quick preview, not a faithful rendering.
1196+
</div>
11951197
</div>
11961198

11971199
{(() => {

dwertheimer.Forms/src/components/FormBuilder.jsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,11 +631,12 @@ export function FormBuilder({
631631
handleOpenForm()
632632
}}
633633
title={hasUnsavedChanges ? 'Open form (you have unsaved changes - you will be warned)' : 'Open this form in a new window'}
634+
style={{ marginRight: '0.5rem' }}
634635
>
635636
Open Form
636637
</button>
637638
) : null}
638-
<button className="PCButton cancel-button" onClick={onCancel}>
639+
<button className="PCButton cancel-button" onClick={onCancel} style={{ marginRight: '0.5rem' }}>
639640
Cancel
640641
</button>
641642
<button
@@ -693,6 +694,7 @@ export function FormBuilder({
693694
onDragLeave={handleDragLeave}
694695
onDrop={handleDrop}
695696
onDragEnd={handleDragEnd}
697+
requestFromPlugin={requestFromPlugin}
696698
/>
697699
</Panel>
698700
<PanelResizeHandle className="form-builder-resize-handle" />

dwertheimer.Forms/src/components/FormFieldsList.jsx

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type FormFieldsListProps = {
1919
onDragLeave: () => void,
2020
onDrop: (e: any, index: number) => void,
2121
onDragEnd: () => void,
22+
requestFromPlugin?: (command: string, data?: any) => Promise<any>,
2223
}
2324

2425
export function FormFieldsList({
@@ -34,15 +35,34 @@ export function FormFieldsList({
3435
onDragLeave,
3536
onDrop,
3637
onDragEnd,
38+
requestFromPlugin,
3739
}: FormFieldsListProps): Node {
3840
return (
3941
<div className="form-builder-main">
4042
<div className="form-builder-editor">
4143
<div className="form-section-header">
4244
<h3>Form Fields</h3>
43-
<button className="add-field-button-small" onClick={onAddField}>
44-
+ Add Field
45-
</button>
45+
<div style={{ display: 'flex', gap: '0.5rem', alignItems: 'center' }}>
46+
<button className="add-field-button-small" onClick={onAddField}>
47+
+ Add Field
48+
</button>
49+
{requestFromPlugin && (
50+
<button
51+
className="PCButton"
52+
onClick={async () => {
53+
try {
54+
await requestFromPlugin('testFormFieldRender', {})
55+
} catch (error) {
56+
console.error('Error opening form field examples:', error)
57+
}
58+
}}
59+
title="Open a test form showing examples of all field types"
60+
style={{ fontSize: '0.85rem', padding: '4px 8px' }}
61+
>
62+
Examples
63+
</button>
64+
)}
65+
</div>
4666
</div>
4767
<div className="form-fields-list">
4868
{fields.length === 0 ? (

dwertheimer.Forms/src/components/fieldTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const FIELD_TYPES: Array<FieldTypeOption> = [
2727
{ value: 'space-chooser', label: 'Space Chooser', description: 'Select a Space (Private or Teamspace)' },
2828
{ value: 'heading-chooser', label: 'Heading Chooser', description: 'Select a heading from a note (static or dynamic based on note-chooser)' },
2929
{ value: 'event-chooser', label: 'Event Chooser', description: 'Select a calendar event for a specific date' },
30-
{ value: 'markdown-preview', label: 'Markdown Preview', description: 'Display markdown content (static text, note by filename/title, or note from another field)' },
30+
{ value: 'markdown-preview', label: 'Markdown Preview', description: 'Display markdown content (static text, note by filename/title, or note from another field). Note: This is a very basic markdown renderer that does not display full NotePlan formatted tasks and items. It\'s intended for a quick preview, not a faithful rendering.' },
3131
{ value: 'heading', label: 'Heading', description: 'Section heading' },
3232
{ value: 'separator', label: 'Separator', description: 'Horizontal line' },
3333
{ value: 'button', label: 'Button', description: 'Clickable button' },

dwertheimer.Forms/src/requestHandlers.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import { parseObjectString } from '@helpers/stringTransforms'
3333
import { replaceContentUnderHeading, removeContentUnderHeading } from '@helpers/NPParagraph'
3434
import { initPromisePolyfills, waitForCondition } from '@helpers/promisePolyfill'
3535
import { keepTodayPortionOnly } from '@helpers/calendar.js'
36+
import { testFormFieldRender } from './FormFieldRenderTest'
3637
// Form-specific handlers are now in their respective handler files:
3738
// - formBrowserHandlers.js: getFormTemplates, getFormFields, handleSubmitForm, handleOpenFormBuilder
3839
// - formBuilderHandlers.js: handleCreateProcessingTemplate, handleOpenNote, handleCopyFormUrl, handleDuplicateForm
@@ -1370,6 +1371,14 @@ export async function handleRequest(requestType: string, params: Object = {}): P
13701371
return createNote(params)
13711372
case 'saveAutosave':
13721373
return await saveAutosave(params)
1374+
case 'testFormFieldRender':
1375+
// Open the form field render test window
1376+
await testFormFieldRender()
1377+
return {
1378+
success: true,
1379+
message: 'Form field examples opened',
1380+
data: null,
1381+
}
13731382
// Form-specific handlers are now in their respective handler files:
13741383
// - formBrowserHandlers.js handles: getFormTemplates, getFormFields, submitForm, openFormBuilder
13751384
// - formBuilderHandlers.js handles: createProcessingTemplate, openNote, copyFormUrl, duplicateForm

helpers/react/DynamicDialog/DropdownSelectChooser.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,23 @@
9595
transform: translateY(-50%) rotate(180deg);
9696
}
9797

98+
/* Value display - show selected value for debugging */
99+
/* Base styles (non-compact) */
100+
.dropdown-select-chooser-container .dropdown-select-chooser-value-display {
101+
margin-top: 0.25rem;
102+
font-size: 0.85em;
103+
color: var(--fg-placeholder-color, rgba(76, 79, 105, 0.7));
104+
font-family: Menlo, monospace;
105+
}
106+
107+
/* In compact mode, value display should be on a new line below the field */
108+
/* The value display is a direct child of searchable-chooser-base.compact */
109+
/* Use !important to override inline styles and ensure it breaks out of flex layout */
110+
.dropdown-select-chooser-container .searchable-chooser-base.compact .dropdown-select-chooser-value-display {
111+
width: 100% !important;
112+
flex-basis: 100% !important;
113+
margin-left: 0 !important;
114+
margin-top: 0.5rem !important; /* Override inline style */
115+
padding-left: calc(8rem + 1rem) !important; /* Align with input field: 8rem (label width) + 1rem (label padding-right) */
116+
}
117+

helpers/react/DynamicDialog/DynamicDialog.css

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@
77
/* background-color: var(--bg-main-color); */
88
background-color: var(--bg-mid-color);
99
position: fixed;
10-
top: calc(50% + var(--noteplan-toolbar-height, 0)/2); /* TEST: */
10+
top: 50vh; /* Center in viewport */
1111
height: 90vh;
1212
max-height: calc(92vh - var(--noteplan-toolbar-height, 0));
13-
/* max-height: calc(92% - var(--noteplan-toolbar-height, 0)); TEST: */
1413
left: 50%;
1514
/* width: 90vw; */
1615
/* max-width: 90vw; */
1716
width: clamp(380px, 86%, 700px);
18-
/* transform: translate(-50%, -50%); */
19-
transform: translate(-50%, 0%); /* TEST: */
17+
transform: translate(-50%, -50%); /* Center both horizontally and vertically */
2018
border: none;
2119
box-shadow: 0 8px 16px rgba(0 0 0 / 0.2);
2220
/* z-index: 1000; */
@@ -635,6 +633,11 @@
635633
opacity: 0.8;
636634
}
637635

636+
/* JSON Editor container - ensure consistent spacing */
637+
.ui-json-container {
638+
margin-bottom: 0; /* Match input-box-container - no extra margin, spacing handled by .dynamic-dialog-item gap */
639+
}
640+
638641
/* Style for Section headings */
639642
.ui-heading {
640643
font-size: 130%;

helpers/react/DynamicDialog/ExpandableTextarea.css

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

33
.expandable-textarea-container {
44
width: 100%;
5-
margin-bottom: 1rem;
5+
margin-bottom: 0; /* Match input-box-container - no extra margin, spacing handled by .dynamic-dialog-item gap */
66
}
77

88
.expandable-textarea-container.compact {
99
display: flex;
1010
flex-direction: row;
1111
align-items: flex-start;
1212
gap: 1rem; /* Match input-box-container-compact gap */
13-
margin-bottom: 0.5rem;
13+
margin-bottom: 0; /* Match input-box-container-compact - no extra margin */
1414
}
1515

1616
.expandable-textarea-container.compact .expandable-textarea-label {

helpers/react/DynamicDialog/MarkdownPreview.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/* MarkdownPreview Component Styles */
22

33
.markdown-preview-container {
4-
margin-bottom: 1rem;
4+
margin-bottom: 0; /* Match input-box-container - no extra margin, spacing handled by .dynamic-dialog-item gap */
55
}
66

77
.markdown-preview-container.compact {
8-
margin-bottom: 0.5rem;
8+
margin-bottom: 0; /* Match input-box-container-compact - no extra margin */
99
}
1010

1111
.markdown-preview-label {

0 commit comments

Comments
 (0)