Return clickable file:// locations for generated HTML/PDF reports - #24
Merged
YashvantHange merged 1 commit intoJul 18, 2026
Merged
Conversation
Surface each generated report as a clickable file:// URL so it opens in the default app on click — for the HTML and the PDF alike. - export.file_url(path): one absolute, percent-escaped file:// URL builder, reused by the headless-Chrome loader so a click opens exactly what was written. - models: new ExportedFile; ExportResult gains file_url + files (a PDF export lists both the pdf and its html sidecar); AnalysisReport gains html_report_url. - server: analyze_company's auto-HTML records html_report_url; export_report returns file_url + files for html and pdf. - cli: analyze prints the clickable file:// URL for every written artifact (plus the html sidecar location for --pdf). Nothing opens on its own — the file opens when the user clicks the link.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The report tools write files to disk but only surface a bare path string, so a user has to hunt the path down and open it manually. This makes each generated file's location a clickable
file://link — for the HTML and the PDF — so clicking it opens the file in the default app (browser for HTML, viewer for PDF). Nothing opens on its own; the file opens on click.Changes
export.py— one helperfile_url(path)= absolute, percent-escapedfile:///…(reused by the headless-Chrome loader, so a click opens exactly the file that was written).save_html/save_pdfunchanged — no side effects.models.py— newExportedFile;ExportResultgainsfile_url+ afileslist (a PDF export lists both the pdf and its html sidecar);AnalysisReportgainshtml_report_url.server.py—analyze_company's auto-HTML recordshtml_report_url;export_reportreturnsfile_url+filesfor html and pdf.cli.py—investo analyzeprints the clickablefile://URL for every written artifact (and the html sidecar's URL for--pdf). No--no-openflag — nothing auto-opens.Verification
ruff check .,mypy,pytest -q— all green (285 tests; addedfile_url+ URL-surfacing coverage).file://link opens the report in the default app.