Skip to content

Conversation

@halgab
Copy link
Contributor

@halgab halgab commented Oct 15, 2023

Fix a bug introduced in #10035

Fixes #10095
Fixes #10097

I refactored a bit the code to make the mistake more obvious.

Proposed changes

  • HeaderLine being a TextLine, HeaderInfo also needs to be a TextInfo

Test methodology

  • I ran DemoConsole and verified manually that the bugs no longer reproduce
Microsoft Reviewers: Open in CodeFlow

@halgab halgab requested a review from a team as a code owner October 15, 2023 22:23
@ghost ghost assigned halgab Oct 15, 2023
@halgab halgab force-pushed the fix-DesignerActionPanel branch 2 times, most recently from c5daf38 to 2f11603 Compare October 16, 2023 07:51
public new sealed class Info(DesignerActionList list, DesignerActionTextItem item) : StandardLineInfo(list)
public static StandardLineInfo CreateLineInfo(DesignerActionList list, DesignerActionTextItem item) => new HeaderTextLineInfo(list, item);

private sealed class HeaderTextLineInfo(DesignerActionList list, DesignerActionTextItem item) : TextLineInfo(list, item)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the crux of the fix. HeaderInfo (formerly HeaderLine.Info) needs to be of type TextLineInfo (formerly TextLine.Info) because otherwise HeaderInfo.UpdateActionItem crashes as it cannot cast the LineInfo object

@halgab halgab force-pushed the fix-DesignerActionPanel branch from 2f11603 to 415b471 Compare October 16, 2023 08:47
Copy link
Contributor

@Tanya-Solyanik Tanya-Solyanik 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 jumping on it!

@Tanya-Solyanik Tanya-Solyanik merged commit 5a46778 into dotnet:main Oct 16, 2023
@halgab halgab deleted the fix-DesignerActionPanel branch October 17, 2023 05:21
@lonitra lonitra added this to the 9.0 Preview1 milestone Oct 17, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Nov 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

4 participants