Skip to content

Commit

Permalink
Alterations to how bug reports are handled
Browse files Browse the repository at this point in the history
- New field for log files in issue templates (which the exception dialog will directly fill out)
- Exception dialog lets you open the log file directly now that locating it isn't necessary anymore
  • Loading branch information
pizzaboxer committed Aug 29, 2024
1 parent fd290f9 commit 6738e09
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 29 deletions.
7 changes: 7 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ body:
description: Provide a comprehensive description of the problem you're facing. Don't forget to attach any additional resources you may have, such as log files and screenshots.
validations:
required: true
- type: textarea
id: log
attributes:
label: Bloxstrap Log
description: If you're getting a Bloxstrap Exception error, upload your log file here. Otherwise, just leave it empty.
value: "N/A"
render: text
27 changes: 9 additions & 18 deletions Bloxstrap/Resources/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions Bloxstrap/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ Your ReShade configuration files will still be saved, and you can locate them by
<data name="Common.ImportJson" xml:space="preserve">
<value>Import JSON</value>
</data>
<data name="Common.LocateLogFile" xml:space="preserve">
<value>Locate log file</value>
<data name="Common.OpenLogFile" xml:space="preserve">
<value>Open log file</value>
</data>
<data name="Common.Miscellaneous" xml:space="preserve">
<value>Miscellaneous</value>
Expand Down Expand Up @@ -268,9 +268,6 @@ Your ReShade configuration files will still be saved, and you can locate them by
<data name="ContextMenu.CopyDeeplinkInvite" xml:space="preserve">
<value>Copy invite deeplink</value>
</data>
<data name="ContextMenu.OpenLogFile" xml:space="preserve">
<value>Open log file</value>
</data>
<data name="ContextMenu.SeeServerDetails" xml:space="preserve">
<value>See server details</value>
</data>
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/UI/Elements/ContextMenu/MenuContainer.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ui:SymbolIcon Grid.Column="0" Symbol="DocumentCatchUp20"/>
<TextBlock Grid.Column="1" VerticalAlignment="Center" Margin="4,0,0,0" Text="{x:Static resources:Strings.ContextMenu_OpenLogFile}" />
<TextBlock Grid.Column="1" VerticalAlignment="Center" Margin="4,0,0,0" Text="{x:Static resources:Strings.Common_OpenLogFile}" />
</Grid>
</MenuItem.Header>
</MenuItem>
Expand Down
2 changes: 1 addition & 1 deletion Bloxstrap/UI/Elements/Dialogs/ExceptionDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

<Border Grid.Row="2" Padding="15" Background="{ui:ThemeResource SolidBackgroundFillColorSecondaryBrush}">
<StackPanel Orientation="Horizontal" FlowDirection="LeftToRight" HorizontalAlignment="Right">
<Button x:Name="LocateLogFileButton" Content="{x:Static resources:Strings.Common_LocateLogFile}" />
<Button x:Name="LocateLogFileButton" Content="{x:Static resources:Strings.Common_OpenLogFile}" />
<Button x:Name="CloseButton" MinWidth="100" Content="{x:Static resources:Strings.Common_Close}" Margin="12,0,0,0" />
</StackPanel>
</Border>
Expand Down
8 changes: 4 additions & 4 deletions Bloxstrap/UI/Elements/Dialogs/ExceptionDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public ExceptionDialog(Exception exception)
string wikiUrl = $"{repoUrl}/wiki";

string issueUrl = String.Format(
"{0}/issues/new?template=bug_report.yaml&title={1}&what-happened={2}",
"{0}/issues/new?template=bug_report.yaml&title={1}&log={2}",
repoUrl,
HttpUtility.UrlEncode($"[BUG] {exception.GetType()}: {exception.Message}"),
HttpUtility.UrlEncode($"Log:\n```\n{String.Join('\n', App.Logger.History)}\n```")
HttpUtility.UrlEncode(String.Join('\n', App.Logger.History))
);

string helpMessage = String.Format(Strings.Dialog_Exception_Info_2, wikiUrl, issueUrl);
Expand All @@ -43,8 +43,8 @@ public ExceptionDialog(Exception exception)

LocateLogFileButton.Click += delegate
{
if (App.Logger.Initialized)
Process.Start("explorer.exe", $"/select,\"{App.Logger.FileLocation}\"");
if (App.Logger.Initialized && !String.IsNullOrEmpty(App.Logger.FileLocation))
Utilities.ShellExecute(App.Logger.FileLocation);
else
Clipboard.SetDataObject(String.Join("\r\n", App.Logger.History));
};
Expand Down

0 comments on commit 6738e09

Please sign in to comment.