Skip to content

Allow clearing old LBC comment limits from Odysee#3408

Merged
tzarebczan merged 4 commits intomasterfrom
fix-old-lbc-limit-bug
Feb 2, 2026
Merged

Allow clearing old LBC comment limits from Odysee#3408
tzarebczan merged 4 commits intomasterfrom
fix-old-lbc-limit-bug

Conversation

@keikari
Copy link
Contributor

@keikari keikari commented Feb 2, 2026

If user has set LBC comment limits in the past, we show $0.01 limit on UI.
There wasn't a way to clear that from settings, so updated settings to match the other UI.

-If user has LBC min tip set, it shows as the $0.01 in settings too.
-Changing the minUSD tip/hyperchat, will set both LBC limits to 0.

Summary by CodeRabbit

  • Bug Fixes
    • Improved creator settings for minimum tip amounts: added debounced updates, cross-field clearing between LBC and USD tip fields, and safer initialization during full sync. Fields now respect focus to avoid overwriting active input, and USD tip displays a sensible fallback when an LBC limit is present. Overall stability of multi-currency tip handling was improved.

@coderabbitai
Copy link

coderabbitai bot commented Feb 2, 2026

📝 Walkthrough

Walkthrough

Adds debounced LBC min-tip updates and cross-field synchronization between LBC and USD tip/super fields; full-sync now sets LBC fields (minTip, minSuper) when appropriate and USD changes clear legacy LBC values to avoid conflicting inputs.

Changes

Cohort / File(s) Summary
Creator Settings Tip Amount Management
ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/creatorSettingsTab/view.jsx
Adds pushMinTip and pushMinTipDebounced; on full sync also assigns minTip and minSuper (guarded by focus checks). Implements cross-field clearing: updating minUSDTip or minUSDSuper clears minTip/minSuper. Adjusts USD field value logic to fallback to minTip ? 0.01 : undefined when LBC limits exist. Minor reordering of debounced calls and added comments for clearing old LBC values.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I nibble keys and debounce hops,

Clearing old crumbs as new value drops,
LBC and USD in tidy array,
Fields sync softly — hooray, hooray! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title directly and clearly summarizes the main objective: enabling users to clear old LBC comment limits that were previously set and are now showing as $0.01.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-old-lbc-limit-bug

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/creatorSettingsTab/view.jsx`:
- Around line 168-170: The file uses Flow type annotations in the function
pushMinTip (parameters value: number and activeChannelClaim: ChannelClaim) which
Biome isn't configured to parse; either enable Flow support in the Biome parser
config or remove/replace the Flow annotations in this file (e.g., strip the ":
number" and ": ChannelClaim" from pushMinTip and any other Flow types, or add
Flow parser/enablement to biome.json) so the parser no longer fails when
handling updateCreatorSettings and pushMinTip.

Comment on lines +168 to +170
function pushMinTip(value: number, activeChannelClaim: ChannelClaim) {
updateCreatorSettings(activeChannelClaim, { min_tip_amount_comment: value });
}
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Inspect Biome configuration to verify Flow/JSX parsing support.

echo "=== Searching for Biome config files ==="
fd -a -t f 'biome.json' -x sh -c 'echo "---- $1 ----"; cat "$1"' sh {} \;
fd -a -t f 'biome.jsonc' -x sh -c 'echo "---- $1 ----"; cat "$1"' sh {} \;
fd -a -t f 'biome.json5' -x sh -c 'echo "---- $1 ----"; cat "$1"' sh {} \;

echo ""
echo "=== Checking target file ==="
cat -n ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/creatorSettingsTab/view.jsx | sed -n '160,180p'

Repository: OdyseeTeam/odysee-frontend

Length of output: 2930


Biome parser configuration missing Flow support — will cause CI failures.

The biome.json configuration lacks Flow parser enablement, but this .jsx file uses Flow type annotations (value: number, activeChannelClaim: ChannelClaim). Configure Biome to support Flow syntax or remove the Flow annotations from this file.

🧰 Tools
🪛 Biome (2.3.13)

[error] 168-168: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.

TypeScript only syntax

(parse)


[error] 168-168: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax.

TypeScript only syntax

(parse)

🤖 Prompt for AI Agents
In
`@ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/creatorSettingsTab/view.jsx`
around lines 168 - 170, The file uses Flow type annotations in the function
pushMinTip (parameters value: number and activeChannelClaim: ChannelClaim) which
Biome isn't configured to parse; either enable Flow support in the Biome parser
config or remove/replace the Flow annotations in this file (e.g., strip the ":
number" and ": ChannelClaim" from pushMinTip and any other Flow types, or add
Flow parser/enablement to biome.json) so the parser no longer fails when
handling updateCreatorSettings and pushMinTip.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In
`@ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/creatorSettingsTab/view.jsx`:
- Around line 404-405: The input's value prop for the USDT tip field (using
minUSDTip and minTip) can flip between controlled and uncontrolled because it
returns undefined for empty values; change the value expression so it never
yields undefined (use an empty string '' for empty state) and ensure the
corresponding onChange handlers and state (minUSDTip) accept/normalize '' vs
numeric values; apply the same change to the other occurrence around the
minUSDTip/minTip value usage at the referenced second site (lines 450-451) so
both inputs remain controlled.
🧹 Nitpick comments (1)
ui/page/claim/internal/claimPageComponent/internal/channelPage/tabs/creatorSettingsTab/view.jsx (1)

415-423: Optional: dedupe legacy LBC clearing logic.
The same block is repeated in both handlers; a helper reduces duplication and future drift.

♻️ Suggested refactor
+  function clearLegacyLbcLimits() {
+    if (minTip !== 0) {
+      setMinTip(0);
+      pushMinTipDebounced(0, activeChannelClaim);
+    }
+    if (minSuper !== 0) {
+      setMinSuper(0);
+      pushMinSuperDebounced(0, activeChannelClaim);
+    }
+  }
...
-                        if (minTip !== 0) {
-                          setMinTip(0);
-                          pushMinTipDebounced(0, activeChannelClaim);
-                        }
-                        if (minSuper !== 0) {
-                          setMinSuper(0);
-                          pushMinSuperDebounced(0, activeChannelClaim);
-                        }
+                        clearLegacyLbcLimits();
...
-                        if (minTip !== 0) {
-                          setMinTip(0);
-                          pushMinTipDebounced(0, activeChannelClaim);
-                        }
-                        if (minSuper !== 0) {
-                          setMinSuper(0);
-                          pushMinSuperDebounced(0, activeChannelClaim);
-                        }
+                        clearLegacyLbcLimits();

Also applies to: 456-464

@tzarebczan tzarebczan merged commit 488c5a4 into master Feb 2, 2026
3 checks passed
@tzarebczan tzarebczan deleted the fix-old-lbc-limit-bug branch February 2, 2026 15:02
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.

2 participants