Skip to content

Implement GitHub Assigned PRs screen for TRMNL playlist #1

@bars0udin

Description

@bars0udin

What

A new TRMNL screen that displays a summary of GitHub pull requests assigned to the user (bars0udin). The screen will show the total count of assigned open PRs and a list containing each PR's title and a "time ago" string (e.g., "3 hours ago").

Implementation details:

  • A new Phoenix controller TrmnlWeb.GithubPrsController to handle the view request.
  • A new template lib/trmnl_web/templates/github_prs/show.html.heex optimized for the 800x480 monochrome TRMNL display.
  • A data fetching mechanism using System.cmd/3 to execute gh pr list --assignee=bars0udin --state=open --json number,title,url,createdAt.
  • Integration into the existing playlist via lib/trmnl/playlist.ex.

Why

The user requires a way to monitor their PR review queue on their TRMNL device. Using the gh CLI leverages the existing authentication on the system, significantly simplifying the implementation by avoiding manual token management or complex API client configuration.

Quality Attributes

  • Maintainability: Follows existing Phoenix controller/template patterns and uses the gh CLI for simplicity.
  • Reliability: The implementation must gracefully handle empty PR lists or failures in the gh command execution.
  • Performance: Data fetching via CLI should be efficient enough to ensure the screen regenerates within the expected TRMNL interval.

Verification

Automated Tests

  • test "parses JSON output from gh CLI command"
  • test "calculates relative time strings accurately (e.g., 'X hours ago')"
  • test "handles empty PR list response gracefully"

Manual Verification

  1. Access the screen via the /screens/:api_key route.
  2. Compare the displayed PR count and list with the output of gh pr list --assignee=bars0udin --state=open.
  3. Verify that the "time ago" information is correctly displayed for each item.
  4. Confirm the layout is legible and fits the 800x480 monochrome constraints.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions