Skip to content

Warn when an app description exceeds the recommended length#2869

Open
Labib-Bin-Salam wants to merge 1 commit into
beeware:mainfrom
Labib-Bin-Salam:2864-warn-long-description
Open

Warn when an app description exceeds the recommended length#2869
Labib-Bin-Salam wants to merge 1 commit into
beeware:mainfrom
Labib-Bin-Salam:2864-warn-long-description

Conversation

@Labib-Bin-Salam
Copy link
Copy Markdown

@Labib-Bin-Salam Labib-Bin-Salam commented Jun 4, 2026

Changes

Partially addresses #2864.

That issue notes that a description longer than 256 characters silently corrupts the shortcut icon path in Windows MSI installers, and lists three required fixes. This PR implements the Briefcase-side fix:

A patch to Briefcase that does a check when a project configuration is parsed. [...] if the description field is longer than 80 chars, we should output a warning to the user that their description is longer than it should be, may be truncated under some circumstances, and longer descriptions should be in the long_description field.

Specifically:

  • Added a MAX_DESCRIPTION_LENGTH (80) constant to briefcase.config.
  • parse_config() now emits a console.warning(...) when an app's description exceeds that length, pointing the user at long_description. The description value itself is preserved as-is, so this is purely advisory and non-breaking.
  • Added tests covering both the over-length (warns) and at-limit (no warning) cases.
  • Added a change note.

The two remaining fixes from the issue — capping the description at 256 characters in the briefcase-windows-app-template and briefcase-windows-visualstudio-template — live in separate repositories and are out of scope for this PR.

PR Checklist:

  • I will abide by the BeeWare Code of Conduct
  • I have read and have followed the CONTRIBUTING.md file
  • This PR was generated or assisted using an AI tool
    Assisted-by: Claude Opus 4.8

Copy link
Copy Markdown
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution. A couple of suggestions inline, mostly related to keeping comments terse. There's no need to provide multiple copies of a long description in the code.

The CI failure on documentation will be resolved after merging with main - we landed a change today that made a change to how documentation is structured. Don't worry about the Pyside6 failures - those tests have a tendency to be unstable for a reason that we haven't quite determined yet.

Comment thread src/briefcase/config.py
# the shortcut icon path in Windows MSI installers.
description = config.get("description")
if isinstance(description, str) and len(description) > MAX_DESCRIPTION_LENGTH:
console.warning(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

When a warning is long, we can now use the console.warning_banner() helper. That helper automatically wraps the the content, as well as standardising the presentation of config issues.

Comment thread src/briefcase/config.py
Comment on lines +44 to +48
# The `description` is a short, single-line summary of the app. Longer values
# belong in `long_description`. Some packaging formats embed the description in
# length-limited fields (e.g. Windows MSI shortcuts truncate at 256 characters,
# corrupting the icon path), so Briefcase warns when it exceeds this length.
MAX_DESCRIPTION_LENGTH = 80
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This doesn't need to be factored out like this. It's used in exactly one place.

Comment thread src/briefcase/config.py
Comment on lines +1472 to +1475
# The description should be a short, single-line summary. Warn (but don't
# fail) if it's too long, as some packaging formats embed it in
# length-limited fields; for example, an over-long description corrupts
# the shortcut icon path in Windows MSI installers.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We don't need excessively long comments explaining code, especially when the warning message explains the underlying problem.

Suggested change
# The description should be a short, single-line summary. Warn (but don't
# fail) if it's too long, as some packaging formats embed it in
# length-limited fields; for example, an over-long description corrupts
# the shortcut icon path in Windows MSI installers.

A `description` longer than 256 characters silently corrupts the shortcut
icon path in Windows MSI installers (the path prefix is truncated by the
overflow amount). Descriptions are meant to be short, single-line summaries;
longer text belongs in `long_description`.

Briefcase now emits a warning during config parsing when an app's
`description` is longer than 80 characters, pointing the user at
`long_description`. The value is still preserved as-is.

Refs beeware#2864.
@Labib-Bin-Salam Labib-Bin-Salam force-pushed the 2864-warn-long-description branch from c2850fc to 1d7a87e Compare June 5, 2026 22:45
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.

2 participants