Skip to content

feat: add tabbed input field groups in form builder left panel#56

Merged
choonkeat merged 2 commits intomainfrom
field-group-tabs
Mar 3, 2026
Merged

feat: add tabbed input field groups in form builder left panel#56
choonkeat merged 2 commits intomainfrom
field-group-tabs

Conversation

@choonkeat
Copy link
Copy Markdown
Owner

@choonkeat choonkeat commented Mar 3, 2026

Add inputFieldGroups flag that organizes the Add Form Field panel into tabbed groups.

The old shortTextTypeList format continues to work unchanged via a backward-compatible decoder. When multiple groups are provided, a tab bar appears; with a single group, no tabs are shown.

Screen.Recording.2026-03-03.at.9.28.50.AM.mov.mp4
inputFieldGroups: [
	{
		heading: 'Basic',
		fields: [
			{ type: 'Dropdown', choices: ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet'] },
			{ type: 'ChooseOne', choices: ['Yes', 'No'] },
			{ type: 'ChooseMultiple', choices: ['Apple', 'Banana', 'Cantaloupe', 'Durian'] },
			{ type: 'LongText', maxLength: 160 },
			{ type: 'ShortText', inputType: 'Single-line free text', attributes: { type: 'text' } },
		],
	},
	{
		heading: 'Advanced',
		fields: [
			{ type: 'ShortText', inputType: 'Custom Element', inputTag: 'validated-input', attributes: { type: 'url' } },
			{ type: 'ShortText', inputType: 'Email', attributes: { type: 'email' } },
			{ type: 'ShortText', inputType: 'Emails', attributes: { type: 'email', multiple: 'true' } },
			{ type: 'ShortText', inputType: 'Telephone', attributes: { type: 'tel' } },
			{ type: 'ShortText', inputType: 'URL', attributes: { type: 'url' } },
			{ type: 'ShortText', inputType: 'Color', attributes: { type: 'color' } },
			{ type: 'ShortText', inputType: 'Date', attributes: { type: 'date' } },
			{ type: 'ShortText', inputType: 'Time', attributes: { type: 'time' } },
			{ type: 'ShortText', inputType: 'Date & Time', attributes: { type: 'datetime-local' } },
		],
	}

tiny-form-fields Chat Export.pdf

Add inputFieldGroups flag that organizes the "Add Form Field" panel into
tabbed groups. The old shortTextTypeList format continues to work unchanged
via a backward-compatible decoder. When multiple groups are provided, a tab
bar appears; with a single group, no tabs are shown.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 3, 2026

Deploy Preview for tiny-form-fields ready!

Name Link
🔨 Latest commit 06fb9db
🔍 Latest deploy log https://app.netlify.com/projects/tiny-form-fields/deploys/69a6ea6934868a00083236dc
😎 Deploy Preview https://deploy-preview-56--tiny-form-fields.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread input.css
Comment on lines +837 to +864
/* Field group tab bar styles */
.tff-field-group-tabs {
@apply flex;
@apply flex-row;
@apply border-b;
@apply border-gray-200;
@apply overflow-x-auto;
@apply mb-2;
}

.tff-field-group-tab {
@apply px-3;
@apply py-2;
@apply text-sm;
@apply text-gray-600;
@apply border-b-2;
@apply border-transparent;
@apply cursor-pointer;
@apply whitespace-nowrap;
@apply hover:text-gray-800;
@apply hover:border-gray-300;
}

.tff-field-group-tab-active {
@apply text-blue-600;
@apply border-blue-500;
@apply font-semibold;
}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any stylesheet loaded after tiny-form-fields.min.css can easily override them. No !important needed.

Comment thread src/Main.elm
Comment on lines 90 to 92
, formValues : Json.Encode.Value

-- List because order matters
, shortTextTypeList : List CustomElement
, inputFieldGroups : List InputFieldGroup
}
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config type changes (init)

Comment thread src/Main.elm
Comment on lines 100 to 106
, trackedFormValues : Dict String (List String)

-- List because order matters
, shortTextTypeList : List CustomElement
, inputFieldGroups : List InputFieldGroup

-- Dict to lookup by `inputType`
, shortTextTypeDict : Dict String CustomElement
, activeFieldGroupIndex : Int
, selectedFieldIndex : Maybe Int
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

model type change

@choonkeat choonkeat merged commit 1d38a93 into main Mar 3, 2026
5 of 6 checks passed
@choonkeat choonkeat deleted the field-group-tabs branch March 3, 2026 14:06
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