Skip to content

Show custom app titles and logos from pyproject - #387

Open
abdullla00 wants to merge 1 commit into
frappe:developfrom
abdullla00:fix/custom-app-title-logo
Open

Show custom app titles and logos from pyproject#387
abdullla00 wants to merge 1 commit into
frappe:developfrom
abdullla00:fix/custom-app-title-logo

Conversation

@abdullla00

Copy link
Copy Markdown

Summary

  • Read [tool.bench].app_title (instead of package name) for custom/non-registry apps
  • Resolve local logo.svg / declared app_logo and serve via /api/v1/apps/<name>/logo
  • Marketplace "Your custom apps" cards keep the real title and pass logo_url through

Why

Custom GitHub apps currently render as sentence-cased package names (e.g. rozh_fieldops → "Rozh fieldops") with a letter avatar, even when app_title and a logo exist in the repo.

Test plan

  • Import a custom app whose pyproject.toml has [tool.bench] app_title = "Rozh Field Operations" and app_logo = "logo.svg"
  • Confirm Marketplace → Your custom apps shows Rozh Field Operations (not "Rozh fieldops")
  • Confirm the card shows the SVG logo instead of the letter avatar
  • Confirm registry apps (HRMS etc.) are unchanged

Made with Cursor

Read `[tool.bench].app_title` and local logo.svg for non-registry apps so Pilot marketplace cards match hooks/pyproject branding instead of sentence-casing the package name.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment on lines 96 to +129
return title, description

def find_logo_path(self, app_path: Path, name: str) -> Path | None:
"""Resolve a local app logo for Pilot marketplace / apps list."""
pyproject = app_path / "pyproject.toml"
declared = ""
if pyproject.exists():
try:
data = tomllib.loads(pyproject.read_text())
declared = str((((data.get("tool") or {}).get("bench") or {}).get("app_logo") or "")).strip()
except (tomllib.TOMLDecodeError, OSError):
declared = ""

candidates: list[Path] = []
if declared:
# Paths in pyproject are usually relative to the repo root.
candidates.append(app_path / declared)
# Also accept module-relative paths written as rozh_fieldops/public/...
if declared.startswith(f"{name}/"):
candidates.append(app_path / declared)
candidates.extend(
[
app_path / "logo.svg",
app_path / "logo.png",
app_path / name / "public" / "logo.svg",
app_path / name / "public" / "logo.png",
app_path / name / "public" / "images" / f"{name.replace('_', '-')}-logo.svg",
app_path / name / "public" / "images" / f"{name}-logo.svg",
]
)
for path in candidates:
if path.is_file():
return path
return None

@tanmoysrt tanmoysrt Aug 15, 2026

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.

Better to not introduce any custom block in pyproject.yaml. Also, avoid any random search for logo.

In frappe apps, their are multiple ways to set app logo is by setting app_logo_url or add_to_app_screen in hooks.py . We should interpret those.

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