Skip to content

[6.x] Add Info fieldtype - #15368

Open
joshuablum wants to merge 4 commits into
6.xfrom
info-fieldtype
Open

[6.x] Add Info fieldtype#15368
joshuablum wants to merge 4 commits into
6.xfrom
info-fieldtype

Conversation

@joshuablum

@joshuablum joshuablum commented Sep 4, 2026

Copy link
Copy Markdown
Member

Adds a non-data Info fieldtype for displaying visual guidance in Control Panel publish forms. It supports sanitized Markdown, built-in icon selection, and five states:

  • Notice (gray)
  • Tip (blue)
  • Warning (yellow)
  • Important Warning (red)
  • Success (green)
image image image

Closes statamic/ideas#1359.

@joshuablum joshuablum changed the title Add Info fieldtype [6.x] Add Info fieldtype Sep 4, 2026
@joshuablum
joshuablum marked this pull request as draft September 4, 2026 15:07
Base automatically changed from alert-tip-variant to 6.x September 7, 2026 18:12
@jasonvarga

Copy link
Copy Markdown
Member

@joshuablum I merged the other PR in this stack. Since this one is still in a draft, I unstacked it, and updated it for 6.x. It's standalone now ready for you to continue when you want.

@joshuablum
joshuablum marked this pull request as ready for review September 9, 2026 13:21
@jasonvarga

Copy link
Copy Markdown
Member

I wonder if we should call this "Alert" since it's really just a wrapper around the UI component already named Alert.

And maybe change the state config field to variant to match the prop.

@jackmcdade ?

@jackmcdade

Copy link
Copy Markdown
Member

I think "info" still makes more sense because that's how you'd use it - vs an "alert" which feels like describing a pop-up when in this user context.

@jasonvarga jasonvarga left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I see that you named a field alert_icon just because icon was sorta reserved and getting wiped out. Instead of this workaround, I'm gonna resolve it in a separate PR. Then we can go back to using icon in here.

Also the naming I brought up earlier is fine based on what Jack said 👍

</script>

<template>
<Alert :variant="variant" :icon="config.alert_icon">

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Warning — static field content rendered into a live ARIA region

Alert derives its ARIA semantics from the variant (resources/js/components/ui/Alert.vue:18-26): warning and error get role="alert" + aria-live="assertive", everything else role="status" + aria-live="polite". Those roles are for messages that appear in response to something the user did.

An Info field is static blueprint content. Because the publish form is client-rendered, the Alert is inserted into the DOM after load, which is exactly the case screen readers announce — so every entry-edit page load will announce the field's text, assertively for the warning and important states. A blueprint with two or three of these gets noisy fast.

Alert itself is unchanged by this PR and is fine for its existing dynamic uses; it's the new static use that doesn't fit the semantics. Suggest giving Alert an opt-out (e.g. a static / live=false prop that omits role and aria-live) and setting it from InfoFieldtype.vue.

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.

Implement an "Instruction" or "Tip" fieldtype for a more prominent authoring notice

3 participants