Skip to content

waves: warn that a wave too short to earn points will not count - #1400

Merged
feruzm merged 1 commit into
developfrom
bugfix/short-wave-quest-hint
Aug 11, 2026
Merged

waves: warn that a wave too short to earn points will not count#1400
feruzm merged 1 commit into
developfrom
bugfix/short-wave-quest-hint

Conversation

@feruzm

@feruzm feruzm commented Aug 11, 2026

Copy link
Copy Markdown
Member

Closes #1399.

A wave is a comment on the chain, so the points backend applies the same minimum length to it as to a reply: at or under the threshold once URLs are stripped, it earns nothing and never reaches the daily comment quest. #1392 closed this for the reply composer and left waves out of scope.

About one in six waves posted from Ecency falls under the threshold. Waves are short by design, which is exactly why the rule bites here. The indexer and the points backend agree on the same set over the same window, so that is a count rather than an estimate.

Shared, not duplicated

Adding the hint here would have written the same predicate a second time, on a rule the backend owns and can move. So it moves to shouldShowShortContentHint, and the reply composer now uses it too. The two composers cannot drift apart, and the rule is testable without standing up either of them.

The hint is deliberately not gated on the reply case: a reply to a wave is a comment as well and earns on the same rule.

Same behaviour as the reply composer: it does not block submitting, and it stays quiet for logged-out users, on an empty composer, and while editing (the original already claimed the reward).

No SDK change needed. earnsQuestContentCredit and QUEST_MIN_CONTENT_LENGTH landed with #1394 and are already in the committed dist, so typecheck is green without a label this time.

Verification

pnpm test       Test Files 271 passed (271)   Tests 2596 passed (2596)
pnpm typecheck  clean across all packages
pnpm lint       0 errors

The new spec covers the refused cases, the link-only case, emoji counted as code points rather than UTF-16 units, a body long enough to earn, an untouched composer, and the logged-out and editing gates. The existing reply composer render tests still pass unchanged through the shared helper, which is what confirms the refactor is behaviour-preserving.

Not covered by tests: the wave form's own rendering, which needs the full composer stood up. Worth a look that the hint sits sensibly next to the streak chip and reads right alongside the character counter at the other end of the range.

Mirrored for the app in ecency/vision-mobile#3485.

Summary by CodeRabbit

  • New Features

    • Added a localized notice explaining when short content does not earn points, including the minimum character requirement and link exclusions.
    • Short-content guidance now appears while composing comments and wave posts when applicable.
    • The guidance accounts for emoji characters and excludes edits, untouched composers, and logged-out users.
  • Bug Fixes

    • Standardized short-content eligibility checks across supported posting experiences.

A wave is a comment on the chain, so the points backend applies the same minimum
length to it as to a reply: at or under the threshold once URLs are stripped, it
earns nothing and never reaches the daily comment quest. #1392 closed this for
the reply composer and left waves out of scope.

Measuring it since: about one in six waves posted from Ecency falls under the
threshold. Waves are short by design, which is exactly why the rule bites here.
The indexer and the points backend agree on the same set over the same window,
so that is a count rather than an estimate.

The predicate moves to a shared helper instead of being written a second time.
The reply composer now uses it too, so the two composers cannot drift apart on a
rule the backend owns, and the rule is testable without standing up either
composer. The hint is not gated on the reply case: a reply to a wave is a
comment too and earns on the same rule.

Closes #1399
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 1b1f25e0-0c36-4b3a-ad11-6dcdff763241

📥 Commits

Reviewing files that changed from the base of the PR and between d003a38 and 6e12585.

📒 Files selected for processing (5)
  • apps/web/src/features/i18n/locales/en-US.json
  • apps/web/src/features/shared/comment/index.tsx
  • apps/web/src/features/waves/components/wave-form/index.tsx
  • apps/web/src/specs/utils/short-content-hint.spec.ts
  • apps/web/src/utils/short-content-hint.ts

📝 Walkthrough

Walkthrough

The change adds a shared short-content hint predicate, applies it to replies and waves, adds wave-form hint rendering, localizes the message, and tests content eligibility cases.

Changes

Short-content quest hints

Layer / File(s) Summary
Shared short-content predicate
apps/web/src/utils/short-content-hint.ts, apps/web/src/specs/utils/short-content-hint.spec.ts
The new helper checks authentication, edit mode, blank content, and quest-credit eligibility. Tests cover short text, links, emoji, long content, and suppressed cases.
Reply composer integration
apps/web/src/features/shared/comment/index.tsx
Reply hint eligibility now uses the shared helper.
Wave composer hint
apps/web/src/features/waves/components/wave-form/index.tsx, apps/web/src/features/i18n/locales/en-US.json
The wave form displays a localized hint when content is below the quest-credit threshold.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

Suggested labels: patch

Poem

A rabbit checks the words you write,
Short waves glow with gentle light.
Links and emojis count with care,
Quest hints appear when points are rare.
Hop, submit, and know the rule!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: warning users when a wave is too short to earn points.
Linked Issues check ✅ Passed The changes add the requested wave warning and preserve the required behavior for signed-in users, empty drafts, logged-out users, edits, and submissions [#1399].
Out of Scope Changes check ✅ Passed The localization, shared helper, reply integration, wave integration, and tests directly support the linked issue objectives [#1399].
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/short-wave-quest-hint

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@feruzm
feruzm merged commit 0f7f1cf into develop Aug 11, 2026
8 checks passed
@feruzm
feruzm deleted the bugfix/short-wave-quest-hint branch August 11, 2026 12:23
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.

Wave composer: warn that a wave too short to earn points will not count

1 participant