Skip to content

Feature/add app config - #19

Merged
srcdev merged 4 commits into
mainfrom
feature/add-app-config
Jun 20, 2026
Merged

Feature/add app config#19
srcdev merged 4 commits into
mainfrom
feature/add-app-config

Conversation

@srcdev

@srcdev srcdev commented Jun 20, 2026

Copy link
Copy Markdown
Owner
## Summary

Introduces `app.config`-based defaults for four components — `DisplayDialog`, `DisplayPrompt`, `DisplayToast`, and `AlertContentInner` — so consumers can configure site-wide behaviour once in their own `app.config.ts` instead of repeating props at every usage site.

## Changes

- **`app/app.config.ts`** (new) — Layer defaults for all four components under the `srcdev.*` namespace. Nuxt deep-merges consumer overrides at build time.
- **`app/types/app-config.d.ts`** (new) — `AppConfigInput` module augmentation so consumer `defineAppConfig` calls are fully type-safe.
- **`DisplayDialog.vue`** — Props that had hardcoded `withDefaults` values now default to `undefined`; a `resolved` computed object applies the prop → app.config → fallback chain. `closeIcon` is now configurable.
- **`DisplayPrompt.vue`** — Same `resolved` computed pattern; `theme`, `dismissible`, `useAutoFocus`, and `masked` are all app.config-configurable.
- **`DisplayToast.vue`** — App.config fallback inserted into existing individual computed props (`theme`, `position`, `alignment`, `fullWidth`, `masked`, `autoDismiss`, `duration`, `revealDuration`). Per-instance `content` and `returnFocusTo` are excluded.
- **`AlertContentInner.vue`** — Theme icons and dismiss icon now resolved via `app.config.srcdev.alertContent`; one config change covers every toast, prompt, and alert in the app.
- **`.gitignore`** — Added `.claude/projects/` to prevent machine-specific Claude session data leaking into the repo.
- **`.claude/skills/`** — Skill docs updated/added for all four components documenting the app.config defaults section and resolution chain.

## Testing

- All existing unit tests pass (`npm run test:run`).
- Resolution chain (explicit prop wins over app.config wins over hardcoded fallback) verified manually.
- Boolean props use explicit `undefined` defaults in `withDefaults` to prevent Vue's boolean-casting from swallowing absent values before the `??` fallthrough fires.

## Notes

- `undefined as SemanticTheme | undefined` type assertion is required in `defineAppConfig` for optional fields that can be `undefined` — without it, Nuxt's generated `AppConfig` type omits the key entirely.
- The `alertContent` key is intentionally separate from `displayToast` because `AlertContentInner` is shared infrastructure beneath `AlertContent`, `AlertMaskedContent`, `DisplayToast`, and `DisplayPrompt`.

@vercel

vercel Bot commented Jun 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
srcdev-design-system Ready Ready Preview, Comment Jun 20, 2026 4:28pm
srcdev-design-system-storybook Ready Ready Preview, Comment Jun 20, 2026 4:28pm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds app.config-driven defaults under srcdev.* so consumers can set global behavior/appearance for DisplayDialog, DisplayPrompt, DisplayToast, and AlertContentInner once, while preserving per-instance overrides.

Changes:

  • Introduces layer-level app.config defaults and Nuxt AppConfigInput type augmentation for srcdev.*.
  • Updates the four components to resolve values via explicit prop/config → app.config → hardcoded fallback.
  • Updates repo hygiene/docs (.gitignore, .claude/skills/*) to document the new configuration surface.

Reviewed changes

Copilot reviewed 10 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
app/types/app-config.d.ts Adds AppConfigInput augmentation for typed srcdev.* defaults.
app/components/02.molecules/alert-content/AlertContentInner.vue Resolves theme/dismiss icons via app.config.srcdev.alertContent.
app/components/01.atoms/toast/DisplayToast.vue Adds app.config.srcdev.displayToast fallbacks into computed appearance/behavior values.
app/components/01.atoms/prompt/DisplayPrompt.vue Implements a resolved computed to apply prop → app.config → fallback resolution.
app/components/01.atoms/display-dialog/DisplayDialog.vue Implements a resolved computed and makes close icon configurable via resolved config.
app/app.config.ts Provides layer default values for all four components under srcdev.*.
.gitignore Ignores Claude session project data (.claude/projects/).
.claude/skills/index.md Adds index entry for AlertContentInner docs.
.claude/skills/components/display-toast.md Documents app.config defaults + resolution chain for DisplayToast.
.claude/skills/components/display-prompt.md Documents app.config defaults + resolution chain for DisplayPrompt.
.claude/skills/components/display-dialog.md Documents app.config defaults + closeIcon behavior for DisplayDialog.
.claude/skills/components/alert-content-inner.md New doc describing global icon configuration via app.config.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/components/01.atoms/display-dialog/DisplayDialog.vue
Comment thread app/components/01.atoms/display-dialog/DisplayDialog.vue Outdated
Comment thread app/components/01.atoms/display-dialog/DisplayDialog.vue
@srcdev
srcdev merged commit 6731c48 into main Jun 20, 2026
6 checks passed
@srcdev
srcdev deleted the feature/add-app-config branch June 20, 2026 16:29
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.

2 participants