Skip to content

[TAS-6594] ✨ Rank staked books ahead of the rest in the For You feed - #1621

Merged
williamchong merged 2 commits into
likecoin:developfrom
williamchong:main
Sep 23, 2026
Merged

williamchong merged 2 commits into
likecoin:developfrom
williamchong:main

Conversation

@williamchong

Copy link
Copy Markdown
Member

No description provided.

@williamchong
williamchong requested review from a team and nwingt and a lite review from Copilot September 21, 2026 18:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Four moderate findings must be addressed before approval.

Review effort: Lite
Findings: None

What changed in this PR

Updates the For You storefront feed to prioritize staked books while hiding latest from visible tags.

Changes:

  • Adds a latest-list constant while preserving API fallback behavior.
  • Fetches staking data and promotes staked books in For You results.
  • Hides latest from tag navigation and exposes feed state.
File Summary
shared/​utils/​bookstore.ts Defines the latest-list constant.
server/​api/​store/​products.get.ts Preserves the latest listing as the API fallback.
app/​pages/​store/​index.vue Applies staking promotion. Four moderate findings (1 vote each) concern analytics identity, incomplete ranking coverage, request races, and impressions recorded before staking data settles.
app/​composables/​use-store-tags.ts Controls tag visibility and staking-based feed state.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@nwingt nwingt changed the title ✨ Rank staked books ahead of the rest in the For You feed [TAS-6594] ✨ Rank staked books ahead of the rest in the For You feed Sep 23, 2026
@notion-workspace

Copy link
Copy Markdown

@nwingt nwingt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it is better to hide the latest tag in Airtable

Comment thread app/pages/store/index.vue
Comment on lines +487 to +490
const stakedItems = items.filter(item => item.totalStaked > 0n)
if (stakedItems.length && stakedItems.length < items.length) {
items = [...stakedItems, ...items.filter(item => item.totalStaked <= 0n)]
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So items are not sorted by staking amount, just move staked item to the front right?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes for this PR

The personalized feed was the one listing that never saw staking at all: its
branch in fetchTagItems returned before the staking fetch, so every item
rendered with totalStaked 0n and the server's ranking stood alone.

It now lifts staked books to the front rather than re-sorting by amount, so
the personalized order survives inside each group — a plain sort by stake
would have left the feed indistinguishable from the 質押 tab, filtered to the
reader's candidates. The lift lives in cmsProducts, not in the fetch, so a
staking response that lands after the feed still reorders what is on screen.

Only the store's feed lifts; the library's keeps the server order, mirroring
the staking tabs the library tab already drops. The fetch is page-one-only —
fetchStakingBooks pages deeper whenever it still holds a cursor, and since
For You is the signed-in landing tab, letting it advance the cursor would have
sent the next CMS tag to an uncached page two for no extra staked books. It is
also unawaited: the lift is reactive, so making the feed's own error modal and
scroll restore wait on the indexer only cost latency. A staking failure just
means no lift.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Three unresolved moderate issues affect impression accuracy, malformed data handling, and ranking completeness.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

Comment thread app/pages/store/index.vue
The staking fetch is unawaited, so the impression could record the
server order before the lift reordered the grid. Hold the view key
until the first staking fetch settles; refreshes don't hold it, so
they can't re-log the view.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🔵 Needs a closer look

Three moderate issues remain in feed completeness and staking-fetch coordination.

Review effort: Lite
Findings: None

Resolved since last review (1)

@williamchong
williamchong merged commit 6ab4430 into likecoin:develop Sep 23, 2026
1 check passed
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.

3 participants