This patch fixes tangled-cli issue list to properly deserialize issue records by making optional fields (createdAt, $type, owner, issueId) optional in the Issue struct, adds a --state filter to show only open or closed issues by querying issue state records and filtering client-side, and formats repository display as readable "handle/name" (e.g., "dunkirk.sh/thistle") instead of AT-URIs while using a cache to avoid repeated API calls for the same repository.
feat: improve how the issue command handles issue #6
expand 3 commits
hide 3 commits
Some issue records in the wild include optional fields that weren't
in the Issue struct, causing deserialization failures:
- createdAt: not present in all records
- $type: AT Protocol record type field
- owner: legacy field on some issues
- issueId: numeric ID on some issues
- cid: content identifier in listRecords response
This makes all these fields optional so the CLI can deserialize
any issue record regardless of which optional fields are present.
๐ Generated with Crush
Assisted-by: Claude Sonnet 4.5 via Crush <crush@charm.land>
Add support for filtering issues by state (open/closed) using the
--state flag on `tangled issue list`.
Implementation:
- Add list_issue_states() API method to fetch state records
- Add IssueState struct for sh.tangled.repo.issue.state records
- Filter issues client-side by fetching state records and matching
- Default to "open" state for issues without explicit state records
๐ Generated with Crush
Assisted-by: Claude Sonnet 4.5 via Crush <crush@charm.land>
Issue list now displays repo as "dunkirk.sh/thistle" instead of
"at://did:plc:.../sh.tangled.repo/rkey" for better readability.
Uses a cache to avoid repeated API calls for the same repo, making
the command fast even with many issues from the same repository.
Implementation:
- Add get_repo_by_rkey() to fetch repo record by DID and rkey
- Add resolve_did_to_handle() to convert DID to handle
- Cache repo AT-URI to formatted name mappings
- Parse AT-URI to extract DID and rkey, then resolve to handle/name
๐ Generated with Crush
Assisted-by: Claude Sonnet 4.5 via Crush <crush@charm.land>