-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
View diagnostics #1082
View diagnostics #1082
Conversation
Fix Nexus-Mods#1084. Fixes the length check in `MissingSMAPIEmitter` for the amount of SMAPI installations. Adds a break, if SMAPI isn't installed, then it definitely won't be enabled.
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #1082 +/- ##
==========================================
- Coverage 54.73% 54.37% -0.36%
==========================================
Files 669 672 +3
Lines 21973 22160 +187
Branches 1704 1710 +6
==========================================
+ Hits 12026 12049 +23
- Misses 9554 9717 +163
- Partials 393 394 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
|
.AddView<DiagnosticEntryView, IDiagnosticEntryViewModel>() | ||
.AddViewModel<DiagnosticEntryViewModel, IDiagnosticEntryViewModel>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to register DiagnosticEntryViewModel
? It needs to be constructed from code as it takes a Diagnostic
in the constructor, is there an other reason to register it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just there to keep the services consistent. It'd look weird if we only register the View and not the View Model.
public static readonly IconValue DiagnosticIcon1 = new AvaloniaPathIcon(Geometry.Parse( | ||
"M9.07495 19.25C8.80828 19.25 8.56662 19.175 8.34995 19.025C8.13328 18.875 7.98328 18.6834 7.89995 18.45L5.47495 12.75H1.19995V11.25H6.52495L9.07495 17.275L13.75 5.60005C13.8333 5.36672 13.9833 5.17505 14.2 5.02505C14.4166 4.87505 14.6583 4.80005 14.925 4.80005C15.1916 4.80005 15.4333 4.87505 15.65 5.02505C15.8666 5.17505 16.0166 5.36672 16.1 5.60005L18.525 11.25H22.8V12.75H17.475L14.925 6.77505L10.25 18.45C10.1666 18.6834 10.0166 18.875 9.79995 19.025C9.58328 19.175 9.34162 19.25 9.07495 19.25Z" | ||
) | ||
); | ||
|
||
// From Design System "Custom Icons" section on Figma | ||
public static readonly IconValue DiagnosticIcon2 = new AvaloniaPathIcon(Geometry.Parse( | ||
"M2 9.87439V6.87439C2 6.32439 2.19583 5.85356 2.5875 5.46189C2.97917 5.07022 3.45 4.87439 4 4.87439H20C20.55 4.87439 21.0208 5.07022 21.4125 5.46189C21.8042 5.85356 22 6.32439 22 6.87439V9.87439H20V6.87439H4V9.87439H2ZM4 20.8744C3.45 20.8744 2.97917 20.6786 2.5875 20.2869C2.19583 19.8952 2 19.4244 2 18.8744V15.8744H4V18.8744H20V15.8744H22V18.8744C22 19.4244 21.8042 19.8952 21.4125 20.2869C21.0208 20.6786 20.55 20.8744 20 20.8744H4ZM10 17.8744C10.1833 17.8744 10.3583 17.8286 10.525 17.7369C10.6917 17.6452 10.8167 17.5077 10.9 17.3244L14 11.1244L15.1 13.3244C15.1833 13.5077 15.3083 13.6452 15.475 13.7369C15.6417 13.8286 15.8167 13.8744 16 13.8744H22V11.8744H16.625L14.9 8.42439C14.8167 8.24106 14.6917 8.11189 14.525 8.03689C14.3583 7.96189 14.1833 7.92439 14 7.92439C13.8167 7.92439 13.6417 7.96189 13.475 8.03689C13.3083 8.11189 13.1833 8.24106 13.1 8.42439L10 14.6244L8.9 12.4244C8.81667 12.2411 8.69167 12.1036 8.525 12.0119C8.35833 11.9202 8.18333 11.8744 8 11.8744H2V13.8744H7.375L9.1 17.3244C9.18333 17.5077 9.30833 17.6452 9.475 17.7369C9.64167 17.8286 9.81667 17.8744 10 17.8744Z" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not happy with this approach, we are duplicating the definition of the icons, which isn't great.
I think this is ok for this PR but we should think about a better approach for this.
I have thought about it over the weekend and I couldn't find many solutions that don't end with an untyped reference in the code to something that is in the Theme project.
Maybe we can have a chat about this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally, we'd have static values in the code project and the themes project would just import those as resources, but I haven't gotten that to work yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Icons should be defined in the Theme project, as those are likely to change with the theme.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the theme project imports everything else, the code won't be able to access those icons. One possible solution would be to use the styles for this and have the tabs set class names instead of icon values. The themes project could just style the tabs as usual using selectors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use theme resources from code without importing the theme project, as long as the resources are added to the App.xaml or whatever.
It isn't ideal because you have to reference them by key which is just a string. You also need to have access to a View, either from a codebehind or by getting the mainwindow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just have a question above, the rest is fine considering a lot of stuff is to be done later
Allows users to view and interact with diagnostics. Part of #327.
DiagnosticWriter
output is mangled #1083MissingSMAPIEmitter
#1084Stuff that needs to be done in other PRs: