krupkat/xpano

Bug report window

Closed this issue · 10 comments

Add a bug report window accessible from the Help menu:

help

  1. Put the BugReportPane object in PanoGui here, with implementation similar to the existing AboutPane.

  2. Window contents

  3. There should be "copy to clipboard" buttons next to actionable items.

  4. Stretch goal: Parse the log file from the previous launch (xpano.1.log) and if there is an [error] entry show the bug report window indicating that there was an error in the last run.

    • Add a toggle "don't show this again", which will need to persist its state in the config

This issue will likely be split into multiple pull requests.

Hi! I would like to work on this, but it would be great if I could clarify a few things first. This is what I understand by the issue:

  1. A BugReportPane class has to be created with a similar implementation to the AboutPane class.
  2. The contents of the BugReportPane should include a link to https://github.com/krupkat/xpano/issues and to your email.
  3. The path to the log file directory should also be displayed.
  4. There should be a copy to clipboard button beside the github link and the path to the log file.
  5. The log file from the previous launch should be parsed and any error should be displayed in the BugReportPane.

If I have understood the issue correctly, then please assign me to it. Thank you!

Excellent, thank you! Your understanding is correct, I have assigned the issue to you now.

  • For part 2 I'd add a sentence in the window, explaining what the user can do to report a bug
  • Parts 1-4. will likely be in a single PR, but feel free to split in two if you feel like.
  • Part 5. is a separate PR for sure and you can keep working on it / leave it for someone else, both is fine.

Please feel free to ask clarifying questions if anything pops up.

One more pointer, here you can add a new button for opening the bug report window:

if (ImGui::MenuItem("About")) {

Okay, I will follow these guidelines and keep you updated. Thank you!

@krupkat To display the log file path, is it okay if I create a static member in the Logger class, which will store the path of the log file as soon as the path is initialized here ? Then I can use that member in the BugReportPane class and display. This will work because the BugReportPane class is always going to be instantiated after the path has been initialized.

Or do you think I should use the xpano::utils::sdl::InitializePrefPath() function again in the BugReportPane class?

You can make the log file directory a member of Logger, yes. Please don't make it static though, you can save the member right where the log_path is being computed:

auto log_path = *app_data_path / kLogFilename;

Also no need to call InitializePrefPath again.

Please note that InitializePrefPath can actually fail (https://wiki.libsdl.org/SDL_GetPrefPath), in which case the app actually doesn't log to a file at all. In that case, maybe show a message that log saving failed. This should be very unusual.

Sorry I already made a pr before I saw this message. I have used InitializePrefPath because if I create a non-static member of Logger, I think I would have to have some way to pass the Logger instance to the BugReportPane class (I might be wrong, I am new to C++). Please review the pr and let me know if any changes need to be made.

No worries, I'll put comments on the PR, it looks good!

This issue can be closed now.

Thanks for your contribution!