Repository navigation
Don't truncate URLs in formatted output - #273
Merged
Merged
Conversation
formatCell truncates strings longer than 40 runes, which destroys URLs in output fields like todolists_url and app_todolists_url. Add an isURL helper that recognizes http(s):// prefixes and bypass truncation for those values.
Cover formatCell unit cases (long URL preserved, non-URL still truncated, short URL passthrough, http scheme) and regression tests for all four render paths: styled/markdown × object/table.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the output rendering pipeline to preserve full HTTP(S) URLs in formatted output, preventing URL fields from becoming unusable due to truncation in formatCell.
Changes:
- Skip the existing 40-rune truncation behavior for strings that look like HTTP(S) URLs.
- Add
isURL()helper used byformatCellto detect URL strings. - Add unit/regression tests ensuring URLs are preserved across styled/markdown and object/table render paths.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| internal/output/render.go | Updates formatCell truncation logic and adds isURL() helper. |
| internal/output/output_test.go | Adds coverage for URL preservation in formatCell and end-to-end render outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
After newline collapsing, a string like "https://example.com\n(extra)" becomes "https://example.com (extra)" — not a real URL. Reject strings containing spaces so they still get truncated.
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
formatCelltruncates any string over 40 runes, which destroys URL fields liketodolists_urlandapp_todolists_url— a truncated URL can't be clicked, copied, or navigatedisURL()helper to skip truncation forhttp://andhttps://prefixesformatCellTest plan
bin/cigreenSummary by cubic
Skip truncation of http(s) URLs in formatted output so links stay usable across styled and markdown, for both object and table views.
formatCellto skip truncation forhttp:///https://and reject values with spaces viaisURL()to avoid false positives.formatCell.Written for commit 8d3d5f8. Summary will update on new commits.