Skip to content

fix(kudos): parse the real wall-of-fame payload and render the leaderboard - #71

Merged
xergioalex merged 1 commit into
mainfrom
fix/kudos-wall-of-fame-rendering
Jul 14, 2026
Merged

fix(kudos): parse the real wall-of-fame payload and render the leaderboard#71
xergioalex merged 1 commit into
mainfrom
fix/kudos-wall-of-fame-rendering

Conversation

@xergioalex

Copy link
Copy Markdown
Member

Summary

dailybot kudos wall-of-fame rendered an almost-empty panel — Top receiver —, Top giver —, and a meaningless Leaderboard entries 4 — even though the API returns full data. Found during a live end-to-end audit of the read surface.

Before:

╭─ Kudos — Wall of Fame ─╮
│ Top receiver         — │
│ Top giver            — │
│ Leaderboard entries  4 │
╰────────────────────────╯

After: the panel shows top receiver/giver with their counts and the caller's ranking, followed by the company-values (kudos DNA) distribution and the full ranked leaderboard table with a Showing X of N footer.

Root cause

The renderer misread the GET /v1/kudos/wall-of-fame/ payload on three counts:

  1. Names are nested: the person lives at top_receiver.user.full_name; the code read top_receiver.full_name → always None.
  2. The leaderboard is an envelope: { count, next, previous, results }; the code did len() on that dict, so "4" was literally the number of keys in the envelope — and the actual entries were never rendered.
  3. leaderboard_summary is the caller's own standing ({ position, total }); the code overwrote that concept with its local count.

The test fixture used a flat/invented payload shape, which is why the bug shipped green — the fixture is now a mirror of the real response.

Changes

  • New display.py::print_kudos_wall_of_fame owns all rendering (rule 9); the command callback now only dispatches JSON vs. human output.
  • Renders: summary panel (top receiver/giver + your position), kudos-DNA table, ranked leaderboard table, pagination footer.
  • Partial/unknown payload shapes degrade to dim dashes instead of crashing (with a top-level full_name fallback).
  • --json passthrough unchanged.
  • docs/API_REFERENCE.md: documents the real response shape (both the command section and the endpoint table row, which previously described the response as a plain list envelope).
  • Tests: real-shape fixture + partial-payload tolerance + --json passthrough (tests/kudos_read_commands_test.py), full suite at 1037 passed.

Verification

Ran against the live API (org Dailybot): panel, DNA table, and 11-entry leaderboard all render correctly; --json output unchanged.

Out of scope (observed while testing)

?limit= is sent by the client but the server returns the full leaderboard regardless — API-side, tracked separately.

Risks

None for --json consumers. Human output intentionally changes shape (that's the fix).

🤖 Generated with Claude Code

…board

## Summary
`kudos wall-of-fame` showed "Top receiver —" / "Top giver —" and a
meaningless "Leaderboard entries 4" because the renderer misread the
API payload on three counts.

## Change Log
- top_receiver / top_giver: read the name from the nested user.full_name
  (the old code looked for a top-level full_name that never exists)
- leaderboard: unwrap the { count, next, previous, results } envelope
  (the old code did len() on the dict, counting its 4 keys)
- leaderboard_summary: surface it as "Your position: N of M" instead of
  overwriting it with a local count
- Render the ranked leaderboard table and the company-values (kudos DNA)
  distribution, both previously dropped on the floor
- Move all rendering into display.py::print_kudos_wall_of_fame (rule 9);
  the command callback now only dispatches JSON vs. human output
- Rewrite the wall-of-fame test fixture to mirror the real payload shape
  (the old fixture was flat, which is why the bug shipped) + 2 new tests
- Document the response shape in docs/API_REFERENCE.md

## Risks
- None for --json users: the payload passthrough is unchanged
- Human output changes shape (panel + 2 tables instead of a 3-row panel),
  which is the point of the fix

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@xergioalex
xergioalex merged commit 689dc49 into main Jul 14, 2026
4 checks passed
xergioalex added a commit to DailybotHQ/agent-skill that referenced this pull request Jul 14, 2026
…f-fame version note

The wall-of-fame rendering fix (DailybotHQ/cli#71) is now published as
v3.7.2 on PyPI, so the version note links to the concrete release
instead of describing the behavior as a bare version floor.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant