Skip to content

feat(UI): project related enhancements#594

Open
kubiix wants to merge 3 commits intoYafc-CE:masterfrom
kubiix:dev/feature/project_tweaks
Open

feat(UI): project related enhancements#594
kubiix wants to merge 3 commits intoYafc-CE:masterfrom
kubiix:dev/feature/project_tweaks

Conversation

@kubiix
Copy link
Copy Markdown

@kubiix kubiix commented Mar 5, 2026

Features

  • Main window title now displays the current project name with * prefix when there are unsaved changes
  • Save in main dropdown is now disabled when there are no unsaved changes
  • Undo in main dropdown is now disabled when there is nothing to undo

Misc

  • Renamed SettingsDropdown -> MainDropdown and LoadProjectHeavy -> ReturnToWelcomeScreen

@kubiix kubiix requested a review from shpaass as a code owner March 5, 2026 00:01
@kubiix kubiix force-pushed the dev/feature/project_tweaks branch from 0ee107f to 7abfac7 Compare March 5, 2026 01:22
@shpaass
Copy link
Copy Markdown
Collaborator

shpaass commented Mar 11, 2026

In the meantime, you can squash the fixes and merges into the main commit if you want.

Copy link
Copy Markdown
Collaborator

@shpaass shpaass left a comment

Choose a reason for hiding this comment

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

The line endings in UndoSystem.cs are wrong, which resulted in every line in the the file being shown as changed. After running git add --renormalize Yafc.Model/Serialization/UndoSystem.cs, I was able to look at the actual diff of the changes.
The problem with the star (*) feature is that it depends on the Undo system, and I have questions to the Undo system in general. It's not about your change, but rather about if the Undo system is necessary at all. I'll start the discussion with the team.
The Save and Undo changes are fine concept-wise, but the implementation in the PR is not explained and is not separate from the other changes.
Overall, I reject the changes for the star (*) and ask for separate commits and explanations for the changes about the Undo and Save to continue the review.

@shpaass
Copy link
Copy Markdown
Collaborator

shpaass commented Mar 23, 2026

I have questions to the Undo system

After discussing the Undo in #596, we settled on that Undo stays.
What I need from this PR is separate commits for each feature and a proper diff.
Most importantly, perhaps you missed the introduction of the Feature Design step. In short, I need a refactor from you that reduces the code complexity of Yafc equivalently to your added features, so the overall complexity of code does not increase.

Copy link
Copy Markdown
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.

I was just recently wanting this *-means-edited title bar feature. I have a couple small changes I'd like to see, though.

project.saveStateChanged += ProjectSaveStateChanged;

_ = InputSystem.Instance.SetDefaultKeyboardFocus(this);
UpdateWindowTitle(false);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This call needs to check the undo state. If you specify a file that doesn't exist on the Welcome screen, the title bar doesn't get the *, but you do get prompted to save when you close, even before you close the Milestones panel.

var projectName = string.IsNullOrEmpty(project.attachedFileName)
? LSs.UntitledProject
: (unsavedChanges ? "*" : string.Empty) + Path.GetFileNameWithoutExtension(project.attachedFileName);
var title = $"{LSs.FullNameWithVersion.L(YafcLib.version.ToString(3))} - {projectName}";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The document name should come before the program name, so the * doesn't get clipped off when there's limited display space for the string.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As shpaass mentioned, this file needs to be recommitted with Linux line endings and/or a different local git configuration.

I can take care of that this time, if you'd like.

Comment on lines +761 to +762
// _ = SDL.SDL_SetTextureBlendMode(blurredFade.handle, SDL.SDL_BlendMode.SDL_BLENDMODE_BLEND);
// _ = SDL.SDL_SetTextureAlphaMod(blurredFade.handle, 160);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are these two lines helpful/necessary?

@shpaass
Copy link
Copy Markdown
Collaborator

shpaass commented Apr 8, 2026

Since the PR-review-requirements were erased during the migration, it seems that I have no option to dismiss my review. Feel free to dismiss it if necessary.

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.

3 participants