feat(view): links open the viewer's /view page - #67
Merged
Merged
Conversation
`xbrlkit view` and the MCP `view_filing` tool now open `https://xbrlkit.com/view?url=…` instead of `/?url=…`. The viewer reads both paths the same way, so nothing changes for the person opening it. The path is what lets the viewer count opens from xbrlkit apart from report links on the web: its page-view analytics record the path and drop the query string, so a query-string marker would never be seen. Earlier releases keep opening `/?url=`, which the viewer serves for good. The CORS header is unchanged: it names the viewer's origin, and the path does not enter into it.
jfrench9
added a commit
to RoboFinSystems/xbrlkit-viewer
that referenced
this pull request
Sep 16, 2026
xbrlkit's `view` command and its MCP `view_filing` tool now open `/view?url=…` (RoboFinSystems/xbrlkit#67), so the analytics, which record the path and drop the query string, can count those opens apart from report links on the web. The viewer already opened that link, but only by accident: an unknown path serves the apex page after a bucket miss, and a `?url=` there shows the File lane. This names the path so a later routing change cannot quietly break installed releases: - `VIEW_PATH` in the route module documents it as the apex page under a second name, with the apex head and canonical. - The CloudFront function maps `/view` to the apex index.html directly. - Tests pin that `/view?url=` opens the File lane with the apex head, and that the app renders it.
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.
Summary
xbrlkit viewand the MCPview_filingtool now openhttps://xbrlkit.com/view?url=…instead ofhttps://xbrlkit.com/?url=…. The viewer reads both paths the same way, so the person opening the link sees no difference.The reason is measurement. xbrlkit.com now carries Cloudflare Web Analytics, and its beacon records the page path but drops the query string. A query marker such as
&src=cliwould never be seen. A distinct path is seen, so opens from xbrlkit become countable apart from report links on the web, which keep using/?url=.Changes
xbrlkit/view.py:viewer_urlbuilds the link on a newVIEWER_PAGE = "view"constant. The module docstring says what the path is for and that earlier releases'/?url=links keep working.ReportServer,ViewerHost, and so both the CLI andview_filing, all go through this one function.tests/test_view.pyandtests/test_serve.pynow expect/view?url=, plus a test that pins the path and its reason.viewsection names the new link and notes that earlier releases'/?url=keeps working.The CORS header is unchanged. It names the viewer's origin, and the path plays no part in it.
Output Impact
CHANGED OUTPUT, narrowly. The URL that
xbrlkit viewprints and opens, and theviewer_urlthatview_filingreturns, now use the/viewpath. Anything that opens the link sees the same report.Two edge cases:
/?url=would need updating.--viewerpointed at a host without a single-page-app fallback would now 404 on/view. The hosted viewer, its CloudFront distribution, andnpm run previewall serve it.No filing's serialization changes.
Testing
just test-allgreen: ruff, format, basedpyright, and pytest with 530 passed and 2 skipped.End to end against production on this branch:
uv run xbrlkit view <a tavi.json> --as tavi --no-openprintedhttps://xbrlkit.com/view?url=http://127.0.0.1:<port>/<token>/….tavi.json.https://xbrlkit.com/."location": "https://xbrlkit.com/view"with a 204. An earlier probe of/?src=probereported plainhttps://xbrlkit.com/, which is why a path rather than a query.No viewer deploy is needed first. The live viewer already opens
/view?url=correctly. A companion viewer PR makes the path explicit and tested there.🤖 Generated with Claude Code