Skip to content

Conversation

@kubiix
Copy link

@kubiix kubiix commented Sep 23, 2025

This pull request refactors the logic for ensuring a project has at least one page by moving it from the UI layer to the model layer. The change improves code organization and encapsulation by centralizing this responsibility within the Project class.

Refactoring and Encapsulation:

  • Added the AssureFirstPage method to the Project class (Yafc.Model/Model/Project.cs) to handle the creation and initialization of the first page and its display mapping if none exist.
  • Updated the SetProject method in MainScreen.cs to call project.AssureFirstPage() instead of duplicating page initialization logic, removing redundant code from the UI layer.

@kubiix kubiix requested a review from shpaass as a code owner September 23, 2025 21:30
Copy link
Collaborator

@veger veger left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!
The code change looks fine to me.

Please add a changelog entry if you want, otherwise we can do it for you as well.

@kubiix
Copy link
Author

kubiix commented Sep 23, 2025

Changelog filled

Copy link
Collaborator

@DaleStan DaleStan left a comment

Choose a reason for hiding this comment

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

Thanks! That's been bothering me for a while, but never enough to actually fix it.

Everything looks good except that 63b7078 appears to have been committed with core.autocrlf or core.eol not set correctly. Do you want to fix that, or would you rather I do it?

@shpaass
Copy link
Owner

shpaass commented Sep 24, 2025

Thank you for the fix! I'll merge this one after other reviewers are done.

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.

4 participants