Skip to content

MENU-HELP-REPORTBUG: Help ▸ Report a Bug… (#1015) - #1128

Open
LloydNicholson wants to merge 1 commit into
storytold:mainfrom
LloydNicholson:report-a-bug-1015
Open

LloydNicholson wants to merge 1 commit into
storytold:mainfrom
LloydNicholson:report-a-bug-1015

Conversation

@LloydNicholson

Copy link
Copy Markdown

Closes #1015 (first version; the later items are listed below)

Help ▸ Send Feedback… opens a blank GitHub issue, so bug reports often arrive without the version, system or log. This adds Help ▸ Report a Bug… next to it. Send Feedback… is unchanged, for feature requests and questions.

The dialog:

  • a "what happened" field
  • Hide my home folder and photo file names, on by default: the home folder becomes ~ and photo and sidecar names become <photo>.ext (~/Pictures/<photo>.CR2), in the log and in the system info (the library path, say)
  • Also attach the logs of the two previous runs (lightcraft.1.log, .2.log), shown when they exist
  • a reminder for raw bugs: name the camera model and share the file by a link
  • a preview of the issue exactly as it will be filled in, the report file's logs and their sizes, and Copy to Clipboard (for Discord or an existing issue)

Create Report:

  1. writes lightcraft-report-<time>.txt next to the logs: what happened, the System Info rows, and each chosen log up to its last 4 MB (logs are capped at 16 MB)
  2. reveals it in Finder / Explorer, so it can be dragged into the issue
  3. opens issues/new?title=…&body=… with the title ("Bug: " and the first line), what happened, the system info, the last 40 lines of this run's log, and a note to attach the file. The link stays under 8,000 characters: the log excerpt loses its oldest lines first, then a very long description is shortened.

Nothing is sent by the app; the reporter checks and submits the issue on GitHub. No issue template is needed. Without a log file (the web build, --memory, LIGHTCRAFT_NO_PREFS), no file is written and the issue holds the system info only.

Choices:

  • One .txt instead of the proposed .zip. The zip crate is only in the tree through candle, and a direct dependency risks C compression back ends. GitHub accepts .txt attachments.
  • The system info is the Help ▸ System Info… rows, moved into bug_report::system_rows and shared by both dialogs. OS version, CPU model and RAM aren't among them and would need a new dependency or platform calls.
  • The dialog reads each log's size and last 40 lines once, when it opens, and the full logs only on Create Report, so it doesn't reread up to 16 MB every frame. It keeps the rows it opened with, so the preview is what gets submitted.
  • app.reportBug {create: true, what?, previousLogs?, private?} does the same without the dialog, for agents and tests.
  • The new strings aren't translated yet (tr() falls back to English). No new tr_format! messages, so the format catalogs are unchanged.

Not in this PR (from the issue's list): offering a report at the next launch after a crash, a link to search for duplicates, a hosted service for reporting without a GitHub account, and sharing the system block with EffectCraft and FilmCraft.

Tests

Docs: new row MENU-HELP-REPORTBUG in docs/parity-checklist.md, docs/whats-new.md.

🤖 Generated with Claude Code

A new Help item next to Send Feedback… (which stays a plain new issue). The
dialog takes what happened, hides the home folder and photo file names by
default, can add the two previous runs' logs, and previews the issue. Create
Report writes lightcraft-report-<time>.txt next to the logs (what happened,
the System Info rows and the logs, each up to its last 4 MB), reveals it, and
opens a new GitHub issue pre-filled with the same and the end of this run's
log; the link is kept under 8,000 characters. Nothing is sent by the app.
Without a log (web, --memory) the issue holds the system info only.

The System Info rows move to `bug_report::system_rows`, shared by both dialogs.
`app.reportBug {create: true}` does it without the dialog (agents, tests).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@AlexChambers AlexChambers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm a fellow contributor, not a maintainer. I'm using Codex to help review PRs and checking potential findings with focused tests where possible.

Reviewed pinned head 693f0ef74ed283361265a6c1bf75fa1919a1d2dd.

[P2] Preserve punctuation inside photo names during redaction

The default privacy option leaves complete photo names visible when the basename ends in a legal punctuation character. For example, redact("import /Users/ann/Pictures/Private Client (1).CR2: no preview", Some("/Users/ann")) returns import ~/Pictures/Private Client (1).CR2: no preview. Resetting the candidate at ) makes the name before the extension empty, so it is never replaced. Import warnings log unquoted paths directly, and both the GitHub issue and attached report use this helper. Treat punctuation within a path basename as part of the filename, with regression cases for parentheses, brackets and apostrophes, so the enabled privacy option hides the promised names.

Changed lines.

Exact-source redaction helper plus exact import extension registry compiled and executed in redaction-probe.rs. It confirms full names remain for (1).CR2 and [final].jpg; O'Brien.CR2 is only partially hidden. Engine import.rs:1007 logs import {path}: {e}. No native UI run.

[P2] Keep the bug-report dialog open when creation fails

If writing the report fails, for example because the log folder is unwritable or the disk is full, create() returns Err through the new Dialog::ReportBug arm. However, show() only displays errors and keeps the dialog for its existing explicit list, which omits ReportBug; this result falls through to _ => close = true. The dialog therefore disappears without an error and discards the reporter's typed description before opening the GitHub issue. Add ReportBug to the error-preserving path and show the error so the user can copy the text or retry. The same recovery is needed when reveal or browser opening returns an error.

Changed lines.

Source trace: bug_report.rs:336,338,344 propagate errors; dialogs.rs:1300-1338 handles only enumerated dialog errors, then closes all other results and sets app.ui.dialog=None. Description exists only in the discarded ReportBug options. No filesystem-failure or native dialog execution.

elrumo pushed a commit to elrumo/lightcraft that referenced this pull request Oct 19, 2026
# Conflicts:
#	docs/parity-checklist.md
#	docs/whats-new.md
@echelon

echelon commented Oct 23, 2026

Copy link
Copy Markdown
Member

Thanks for this, the report flow is well thought out. Before we can review it: (1) Redaction: names with punctuation in the basename stay visible, e.g. Private Client (1).CR2, [final].jpg, O'Brien.CR2. Please treat punctuation inside a basename as part of the name, and add regression cases for parentheses, brackets and apostrophes. (2) If writing the report (or the reveal or browser open) fails, the dialog closes silently and the description is lost. Please keep ReportBug on the error-preserving path in dialogs.rs and show the error. (3) Please rebase onto main; the branch conflicts.

If you haven't already, come and say hi on our Discord: https://discord.gg/artcraft

@Harrison-Booth

Copy link
Copy Markdown

@LloydNicholson @echelon

GridCraft, PdfCraft and DeckCraft are adding a Help item that opens a prefilled GitHub issue (no dialog, nothing sent: version, OS, graphics adapter, interface language and the document's file type, never its name or contents). We plan to use the label "Report an Issue…" (already in craft-i18n's common.tsv in 20 locales) and PhotoCraft 1312's issue-form field ids (version, os, system-info). Your report file and log redaction go further than we do; we'd follow your System Info field names and order so maintainers see the same block. Question: would you consider the same form field ids for LightCraft's prefill, so all apps' links look alike? Happy to follow yours if you'd rather keep title/body.

@Bruno-Alumn

Copy link
Copy Markdown
Contributor

@LloydNicholson thanks for this. echelon asked for three things on 23 Oct (punctuation in photo names during redaction, keeping the dialog open when the report fails, and a rebase), and the branch has been quiet since. So I've opened #3763, which carries your commit unchanged and with your authorship and does those three. With that, this PR can be closed. If you'd rather finish it here yourself, just say so and I'll close mine.

@wanikhawar wanikhawar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This conflicts with main now. Please rebase so CI can run on the merged result.

@wanikhawar

Copy link
Copy Markdown
Contributor

Please rebase. The redaction only hides the home folder and photo file names. It misses the library path outside $HOME (such as /Volumes/<name>), album, folder and keyword names, photo names without an extension, and a differently-cased Windows home path (replace is case-sensitive). Please either widen it or say plainly what is not hidden, since it is on by default. Please also confirm app.reportBug {create:true} is subject to the automation roots.

This branch has not been deployed

No deployments
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.

Help ▸ Report a Bug… next to Send Feedback…: version, system info and a log file to attach

7 participants