Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 13, 2025

Problem

The welcome message in the LearningMapEditor was only checking if there were no nodes or edges to determine visibility. This meant that even when users modified settings like the background color, title, or language, the welcome message would still appear on an empty canvas. This behavior was confusing and not future-proof for additional settings.

Solution

Introduced a new helper function isDefaultRoadmapData() that checks whether the roadmap is in its complete default state. The function evaluates:

  • Whether there are no nodes or edges (excluding debug edges)
  • Whether settings are at their default values (no custom title, language, or background modifications)

The welcome message now only appears when the roadmap data is truly in its default state, making the behavior consistent and predictable.

Changes

  • Added isDefaultRoadmapData() helper function in helper.ts
  • Updated LearningMapEditor to use the new helper function for determining welcome message visibility
  • The solution is future-proof: new settings can be easily added to the default state check

Testing

// Before: welcome message would appear even with custom background
isDefaultRoadmapData([], [], { background: { color: "#ff0000" } })  // Now returns false

// After: welcome message only appears with default state
isDefaultRoadmapData([], [], { background: { color: "#ffffff" } })  // Returns true

This ensures users get a clean editing experience once they've made any customizations to their learning map.

Fixes #<issue_number>

Original prompt

This section details on the original issue you should resolve

<issue_title>Welcome message does not disappear when background is set</issue_title>
<issue_description>The welcome message should disappear, when the background is set. Only if the roadmap data is the default one, the welcome message should appear. This makes is future proof. I we added another setting in the future.</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #13


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

@vercel
Copy link

vercel bot commented Oct 13, 2025

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

Project Deployment Preview Comments Updated (UTC)
learningmap Ready Ready Preview Comment Oct 13, 2025 9:09am

Co-authored-by: mikebarkmin <2592379+mikebarkmin@users.noreply.github.com>
Co-authored-by: mikebarkmin <2592379+mikebarkmin@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix welcome message display issue with background settings Fix welcome message visibility when background or other settings are changed Oct 13, 2025
Copilot AI requested a review from mikebarkmin October 13, 2025 06:32
@mikebarkmin mikebarkmin marked this pull request as ready for review October 13, 2025 09:12
@mikebarkmin mikebarkmin merged commit 76fe607 into main Oct 13, 2025
3 checks passed
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.

Welcome message does not disappear when background is set

2 participants