Skip to content

Conversation

Copy link

Copilot AI commented Nov 11, 2025

Addresses feedback on PR #1: input signals were falling back to hardcoded defaults instead of user-provided config values when undefined.

Change
Modified the config merge in NgxMarkdownEditorComponent constructor to:

  1. Merge DEFAULT_EDITOR_CONFIG with user config() into baseConfig
  2. Apply input signals with baseConfig as fallback instead of hardcoded values

Before:

const mergedConfig = {
  ...DEFAULT_EDITOR_CONFIG,
  ...this.config(),
  showPreview: this.showPreviewInput() ?? true,  // Hardcoded fallback
};

After:

const baseConfig = { ...DEFAULT_EDITOR_CONFIG, ...this.config() };
const mergedConfig = {
  ...baseConfig,
  showPreview: this.showPreviewInput() ?? baseConfig.showPreview,  // Respects user config
};

This ensures precedence: defaults < user config < explicit input signals.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ovided

Co-authored-by: RockyCott <67379041+RockyCott@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on NgxMarkdownEditor style and functionality Fix config merge order to respect user config when input signals are undefined Nov 11, 2025
Copilot AI requested a review from RockyCott November 11, 2025 03:47
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