Specify recent profile identity for /profile/recent

Add DB Gherkin for GET /profile/recent joining each profile's display
name (names store) and avatar URL (profilePics store), null when absent.
Add client Gherkin for the new leftmost Account column showing the
display name and avatar, linking to the profile, with truncated-address
and identicon fallbacks and the existing columns preserved.

By specifier.
This commit is contained in:
Chris Troutner
2026-09-20 12:24:19 -07:00
parent 761d5268d0
commit dda94b1a81
2 changed files with 93 additions and 0 deletions
@@ -0,0 +1,55 @@
# Scenarios: Recent Profile Display - 1, Recent Profile Display - 2, Recent Profile Display - 3, Recent Profile Display - 4, Recent Profile Display - 5
#
# The /profile/recent page renders each recent profile in a table. A new
# leftmost "Account" column shows the profile's display name and avatar, ahead
# of the existing Address, Bio, Block, Seen, and TXID columns. The display name
# and avatar link to the profile. When a profile has no display name the account
# shows the truncated address; when it has no avatar the account shows an
# identicon. This is a read-only rendering feature: it broadcasts no Memo action
# and writes no DB data.
#
# Fixture "recent-profiles-identities" (the GET /profile/recent response: each
# profile carries the display name and avatar URL joined from the names and
# profilePics stores, as null when absent):
# bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy (alice) { text: alice bio, name: alice, profilePicUrl: https://example.com/alice.png }
# bitcoincash:qqq3728yw0y47sqn6l2na30mcw6zm78dzqre909m2r (bob) { text: bob bio, name: bob, profilePicUrl: https://example.com/bob.jpg }
# bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a (carol) { text: carol bio, name: carol, profilePicUrl: null }
# bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d (dave) { text: dave bio, name: null, profilePicUrl: https://example.com/dave.png }
Feature: Recent Profile Display
Background:
Given the psf-memo-db API serves the recent profiles fixture "recent-profiles-identities"
Scenario Outline: Recent Profile Display - 1 the account column shows each profile's display name and avatar
When I open the recent profiles page
Then the recent profiles account for the address <addr> shows the display name "<name>"
And the recent profiles account for the address <addr> shows the avatar "<avatar>"
Examples:
| addr | name | avatar |
| bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | alice | https://example.com/alice.png |
| bitcoincash:qqq3728yw0y47sqn6l2na30mcw6zm78dzqre909m2r | bob | https://example.com/bob.jpg |
Scenario Outline: Recent Profile Display - 2 the account avatar and display name link to the profile
When I open the recent profiles page
Then the recent profiles account for the address <addr> links the avatar to "<profile_path>"
And the recent profiles account for the address <addr> links the display name to "<profile_path>"
Examples:
| addr | profile_path |
| bitcoincash:qr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy | /profile/bitcoincash%3Aqr95sy3j9xwd2ap32xkykttr4cvcu7as4y0qverfuy |
| bitcoincash:qqq3728yw0y47sqn6l2na30mcw6zm78dzqre909m2r | /profile/bitcoincash%3Aqqq3728yw0y47sqn6l2na30mcw6zm78dzqre909m2r |
Scenario: Recent Profile Display - 3 a profile without an avatar shows an identicon
When I open the recent profiles page
Then the recent profiles account for the address bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a shows an identicon avatar
And the recent profiles account for the address bitcoincash:qpm2qsznhks23z7629mms6s4cwef74vcwvy22gdx6a shows the display name "carol"
Scenario: Recent Profile Display - 4 a profile without a display name shows the truncated address
When I open the recent profiles page
Then the recent profiles account for the address bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d shows the display name "bitcoincas...py26r63g3d"
And the recent profiles account for the address bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d shows the avatar "https://example.com/dave.png"
Scenario: Recent Profile Display - 5 the account column is the first column and the other columns remain
When I open the recent profiles page
Then the recent profiles table has the column headers "Account", "Address", "Bio", "Block", "Seen", "TXID"
@@ -0,0 +1,38 @@
# Scenarios: Recent Profile Identity - 1
#
# GET /profile/recent returns each recent profile's current display name and
# avatar URL alongside the profile text and provenance it already returns. The
# names store (newest setName, 0x6d01) and the profilePics store (newest
# setProfilePic, 0x6d0a) are keyed by address, so the route joins each record
# into its profile by address. A profile with no name record reports a null
# display name, and a profile with no picture record reports a null avatar URL.
# The join does not change the profile order (block height descending) or the
# pagination metadata.
#
# Fixture "profiles-with-identities" (profiles, names, and profilePics stores):
# profiles:
# bitcoincash:qaddr-alice { text: alice bio, txid: profile-alice, blockHeight: 600300, seen: 3 }
# bitcoincash:qaddr-bob { text: bob bio, txid: profile-bob, blockHeight: 600200, seen: 2 }
# bitcoincash:qaddr-carol { text: carol bio, txid: profile-carol, blockHeight: 600100, seen: 1 }
# names:
# bitcoincash:qaddr-alice { name: alice, txid: name-alice, blockHeight: 600250 }
# bitcoincash:qaddr-carol { name: carol, txid: name-carol, blockHeight: 600050 }
# profilePics:
# bitcoincash:qaddr-alice { url: https://example.com/alice.png, txid: pic-alice, blockHeight: 600260 }
# bitcoincash:qaddr-bob { url: https://example.com/bob.jpg, txid: pic-bob, blockHeight: 600150 }
Feature: Recent Profile Identity
Background:
Given a psf-memo-db instance with profiles, names, and profilePics stores
Given the fixture "profiles-with-identities" is loaded into the profiles, names, and profilePics stores
Scenario Outline: Recent Profile Identity - 1 GET /profile/recent returns each profile's display name and avatar
When the client requests /profile/recent
Then the response profile for <addr> has display name "<name>"
And the response profile for <addr> has avatar "<avatar>"
Examples:
| addr | name | avatar |
| bitcoincash:qaddr-alice | alice | https://example.com/alice.png |
| bitcoincash:qaddr-bob | | https://example.com/bob.jpg |
| bitcoincash:qaddr-carol | carol | |