Add toast notification component with JS init, template, examples, migration, and tests - #1360
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f551bc483
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 500e2f39e0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 93c9f08843
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
276b968 to
6cbb525
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b29821716d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <div | ||
| {{~#if id}} id="{{id}}"{{/if}} | ||
| {{~#if trigger}} data-toast-trigger="{{trigger}}"{{/if}} class="toast | ||
| {{~#if color}} toast-colored bg-{{color}} text-{{#if (eq color 'white')}}light{{else}}{{color}}{{/if}}-fg{{/if}} |
There was a problem hiding this comment.
Add an explicit mapping for the gray toast color
When color = 'gray'—a color listed in examples/official-site/colors.sql—this emits bg-gray text-gray-fg, but neither the bundled Tabler 1.4 stylesheet nor sqlpage.css defines those utilities. The toast consequently retains its neutral background instead of rendering gray; map gray to an available gray shade, define the missing utilities, or explicitly exclude it from the documented toast colors.
Useful? React with 👍 / 👎.
addresses #1358
small.mp4
Motivation
alertusages with a dedicatedtoastcomponent that supports auto-dismiss, manual dismissal, positions, icons, colors, Markdown, and URL-fragment triggers.Description
toastHandlebars template (sqlpage/templates/toast.handlebars) that supportstitle,description,description_md,icon,color,dismissible,duration,position,trigger,id, andclassproperties.sqlpage/sqlpage.jsto initialize toasts, create per-position containers, manage stacking and automatic/manual dismissal, and open toasts via URL fragment triggers withopen_toasts_for_hashandsqlpage_toastinitialization hooks.examples/official-site/sqlpage/migrations/76_toast.sql) that registers thetoastcomponent, its parameters, and multiple examples in the component registry.toastinstead of transientalertentries and add a component rendering test file attests/sql_test_files/component_rendering/toast.sql.CHANGELOG.md) to document the newtoastcomponent.Testing
tests/end-to-end/official-site.spec.tsthat verifies initialization, stacking, dismiss behavior, Markdown rendering, fragment-trigger behavior, and positioning of toasts, and the new test passed in the test run.tests/sql_test_files/component_rendering/toast.sqlto validate server-side output for various toast configurations and it passed in automated checks.Codex Task