Skip to content

Thumbnail Waves and hivesigner fix#728

Merged
feruzm merged 7 commits intodevelopfrom
thumb
Mar 31, 2026
Merged

Thumbnail Waves and hivesigner fix#728
feruzm merged 7 commits intodevelopfrom
thumb

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Mar 31, 2026

Summary by CodeRabbit

  • New Features

    • Hivesigner callback page (success/error UI, TX ID, redirect countdown) and utility to build callback URLs.
  • New Features / Enhancements

    • Optional direct video embedding and automatic 3Speak thumbnail injection.
    • Post renderer accepts image metadata and render options to improve image/video rendering.
  • Improvements

    • Video upload: abortable extraction with 15s timeout and more robust thumbnail handling.
    • Unified CSS class/styling updates across renderer extensions for consistency.
  • Tests

    • Added hs-callback route tests.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 31, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • ✅ Review completed - (🔄 Check again to review again)
📝 Walkthrough

Walkthrough

Threads post image metadata and render options into the renderer, injects 3Speak thumbnails and supports direct iframe embeds with orientation handling, adds a HiveSigner callback URL builder and client callback page, and refactors 3Speak thumbnail extraction/upload to use AbortController and timeouts.

Changes

Cohort / File(s) Summary
Post image metadata propagation
apps/web/src/app/(dynamicPages)/entry/.../entry-page-body-viewer.tsx, apps/web/src/app/decks/_components/.../deck-post-viewer.tsx, apps/web/src/app/decks/_components/.../deck-thread-item-body.tsx, apps/web/src/app/waves/[author]/[permlink]/_components/wave-view-details.tsx, apps/web/src/app/waves/_components/waves-list-item.tsx, apps/web/src/features/shared/discussion/discussion-item-body.tsx
Pass images (from entry.json_metadata?.image) into post content renderer calls.
Post renderer API & core changes
apps/web/src/features/shared/post-content-renderer.tsx, apps/web/src/features/post-renderer/components/ecency-renderer.tsx, apps/web/src/features/post-renderer/components/utils/setupPostEnhancements.ts
Add images?: string[] and renderOptions?: RenderOptions props, forward them into renderer/enhancements, and remove author/tag enhancement imports from setup pipeline.
ThreeSpeak thumbnail & enhancer
apps/web/src/features/post-renderer/components/utils/threeSpeakThumbnail.ts, apps/web/src/features/post-renderer/components/utils/threespeakVideosEnhancer.tsx, apps/web/src/features/post-renderer/components/extensions/three-speak-video-extension.tsx
New injectThreeSpeakThumbnail utility; enhancers accept images, inject thumbnails, support direct DOM iframe embedding in certain contexts, add message listeners for orientation, and manage per-embed cleanup.
Render-helper API & types
packages/render-helper/src/types/render-options.interface.ts, packages/render-helper/src/index.ts, packages/render-helper/src/methods/*.ts
Introduce RenderOptions type and thread renderOptions?: RenderOptions through markdown2Html, markdownToHTML, traverse, a(), linkify, and text to control embed behavior (e.g., embedVideosDirectly).
Class/selector renames & styling
apps/web/src/features/post-renderer/components/extensions/*, apps/web/src/features/post-renderer/components/extensions/*.scss, apps/web/src/features/post-renderer/components/utils/*Enhancer.tsx, apps/web/src/features/post-renderer/ecency-renderer.scss, apps/web/src/features/waves/styles/thread-render.scss
Rename many CSS classes/selectors from ecency-renderer-* to er-*, update SCSS rules for images and 3Speak aspect variants, and adjust selectors used by enhancers.
Tag/link author renderer simplification
apps/web/src/features/post-renderer/components/extensions/tag-link-extension.tsx, apps/web/src/features/post-renderer/components/utils/tagLinkEnhancer.ts
Remove React rendering path for tag links; implement DOM-only replacement and update enhanced class to er-tag-enhanced.
HiveSigner callback plumbing & page
apps/web/src/utils/hs-callback.ts, apps/web/src/app/auth/hs-callback/_page.tsx, apps/web/src/app/auth/hs-callback/page.tsx, apps/web/src/features/shared/transactions/transaction-signer.tsx, apps/web/src/features/wallet/operations/wallet-operations-sign.tsx, packages/sdk/src/modules/accounts/mutations/use-account-revoke-posting.ts, packages/sdk/src/modules/accounts/mutations/use-account-update-recovery.ts
Add buildHsCallbackUrl(redirect) util, new /auth/hs-callback client page with countdown redirect and sanitization, and propagate hsCallbackUrl into SDK mutation options and HiveSigner calls.
Account permissions wiring
apps/web/src/app/(dynamicPages)/profile/[username]/permissions/_components/account-recovery.tsx, apps/web/src/app/(dynamicPages)/profile/[username]/permissions/_components/manage-authorities.tsx
Compute and pass hsCallbackUrl into account update/revoke mutation options.
Video upload thumbnail refactor
apps/web/src/features/shared/video-upload-threespeak/index.tsx
Use AbortController with 15s timeout, guard canvas ops on invalid video dimensions, gate state updates on abort signal, and adjust button disabled/loading behavior.
Tests
apps/web/src/specs/features/hs-callback.spec.tsx, various renderer enhancer tests under apps/web/src/features/post-renderer/components/utils/__tests__/*
Add hs-callback route tests and update enhancer tests to expect new er-* selectors and behaviors.

Sequence Diagram(s)

sequenceDiagram
    participant Renderer as PostContentRenderer
    participant Enhancer as ThreeSpeak Enhancer
    participant ThumbUtil as injectThreeSpeakThumbnail
    participant Iframe as 3Speak iframe
    participant User as User

    Renderer->>Enhancer: render placeholders (passes images, renderOptions)
    Enhancer->>ThumbUtil: request thumbnail (images, embed element)
    ThumbUtil-->>Enhancer: inject <img> thumbnail (if found)
    User->>Enhancer: click play
    Enhancer->>Iframe: create/append iframe (direct DOM or React mount)
    Iframe->>Enhancer: postMessage "3speak-player-ready" (isVertical/aspectRatio)
    Enhancer->>Enhancer: update container classes (speak-portrait / speak-square)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

patch

Poem

🐰 I nibbled through metadata, found pics in a heap,

I stitched them to renderers and woke sleeping iframes from sleep.
Callbacks tick down, then bounce folks back home,
Aborters calm canvases where restless pixels roam.
A small hop of code — quick, tidy, and neat! 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.83% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title refers to two distinct areas of change (thumbnail/waves and hivesigner) but lacks specificity about what improvements or fixes were implemented. Consider using a more descriptive title that clarifies the specific changes, such as 'Add direct video embedding and improve hivesigner callback handling' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch thumb

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.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Copy link
Copy Markdown
Contributor

@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: 2

♻️ Duplicate comments (2)
apps/web/src/features/post-renderer/components/ecency-renderer.tsx (2)

78-88: ⚠️ Potential issue | 🟠 Major

Don't remove author/tag enhancement until callers are migrated.

This renderer no longer applies AuthorLinkExtension / TagLinkExtension, but apps/web/src/features/post-renderer/components/extensions/wave-like-post-extension.tsx:15-119 still renders <EcencyRenderer value={post.body} /> without renderOptions. That regresses author/tag enhancement inside wave previews. Please keep a fallback here when renderOptions is absent, or update that caller before removing these extensions.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/features/post-renderer/components/ecency-renderer.tsx` around
lines 78 - 88, The recent removal of AuthorLinkExtension and TagLinkExtension
from EcencyRenderer breaks wave-like previews because WaveLikePostExtension
renders <EcencyRenderer value={post.body} /> without passing renderOptions;
restore a fallback so author/tag enhancement remains until callers are migrated
by detecting when renderOptions is undefined in EcencyRenderer and adding
AuthorLinkExtension and TagLinkExtension to the extensions list (or treat
undefined as the default that enables those extensions), or alternatively update
WaveLikePostExtension to pass the proper renderOptions; locate EcencyRenderer,
WaveLikePostExtension, and the extension components
AuthorLinkExtension/TagLinkExtension to implement the fallback or caller update
accordingly.

40-63: ⚠️ Potential issue | 🟠 Major

Cover the new 3Speak postMessage path with a spec.

This effect adds new user-visible behavior, but there is still no renderer test covering accepted vs ignored messages and the resulting speak-portrait / speak-square classes.

As per coding guidelines, "All new features in @ecency/web require tests".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/features/post-renderer/components/ecency-renderer.tsx` around
lines 40 - 63, Add a renderer test for the new 3Speak postMessage handling in
ecency-renderer.tsx: mount the renderer with
renderOptions.embedVideosDirectly=true and create a mock iframe element with
class "speak-iframe" inside a container with class "markdown-video-link-speak"
(set iframe.contentWindow to window or a fake object), then dispatch
MessageEvent("message") with origin "https://play.3speak.tv" and data {type:
"3speak-player-ready", isVertical: true} and assert the container gains
"speak-portrait"; add a second test dispatching data with {type:
"3speak-player-ready", aspectRatio: 1.02} and assert "speak-square"; add
negative tests sending messages with wrong origin, wrong type, or event.source
not matching iframe.contentWindow and assert no classes are added; use your
existing test utilities (React Testing Library / jsdom) and target the
useEffect/handleMessage logic and the ".speak-iframe" /
"markdown-video-link-speak" selectors.
🧹 Nitpick comments (1)
apps/web/src/features/post-renderer/components/extensions/wave-like-post-extension.scss (1)

1-96: Clean up legacy wave renderer CSS to avoid divergence.

The old .ecency-renderer-wave-like-post-extension-renderer* rules in apps/web/src/styles/renderer.css:215-270 appear obsolete after this rename. Removing or migrating that block would prevent duplicated/dead styling paths.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@apps/web/src/features/post-renderer/components/extensions/wave-like-post-extension.scss`
around lines 1 - 96, Remove the obsolete legacy rules matching
.ecency-renderer-wave-like-post-extension-renderer* from the old stylesheet and
consolidate any needed declarations into the new .er-wave-renderer block (and
its modifiers .er-wave-renderer--logo, --author, --body, and nested elements
like &__overlay, &--author-avatar, &--author-content) so there is no duplicated
or dead styling; delete the old block or migrate its relevant properties into
the new SCSS selectors and run a quick visual check to confirm nothing
regressed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@apps/web/src/features/post-renderer/components/extensions/wave-like-post-extension.scss`:
- Around line 58-62: The avatar exclusion selector still targets the old class
name; update the selector in the waves common styles to use the renamed class
.er-wave-renderer--author-avatar (the new avatar class defined by the component)
so the avatar is excluded from the generic image rules—locate the selector
referencing the old avatar class in the waves common stylesheet and replace it
with .er-wave-renderer--author-avatar, keeping the same specificity and
combinators as the original rule.

In `@apps/web/src/features/waves/styles/thread-render.scss`:
- Around line 3-4: The selectors currently target .thread-render and
.waves-list-item broadly, causing markdown descendant and img rules (the blocks
around lines 14–16 and 99–107) to leak onto non-markdown UI; restrict those
rules to the rendered-markdown area only by scoping descendant and image
selectors to a dedicated markdown container (e.g., change selectors using
.thread-render or .waves-list-item to target .thread-render .rendered-markdown
and .waves-list-item .rendered-markdown, and update the img/aspect-ratio rules
likewise), updating the CSS rules that apply to descendants and images so only
elements inside the rendered-markdown container receive markdown typography and
aspect-ratio styling.

---

Duplicate comments:
In `@apps/web/src/features/post-renderer/components/ecency-renderer.tsx`:
- Around line 78-88: The recent removal of AuthorLinkExtension and
TagLinkExtension from EcencyRenderer breaks wave-like previews because
WaveLikePostExtension renders <EcencyRenderer value={post.body} /> without
passing renderOptions; restore a fallback so author/tag enhancement remains
until callers are migrated by detecting when renderOptions is undefined in
EcencyRenderer and adding AuthorLinkExtension and TagLinkExtension to the
extensions list (or treat undefined as the default that enables those
extensions), or alternatively update WaveLikePostExtension to pass the proper
renderOptions; locate EcencyRenderer, WaveLikePostExtension, and the extension
components AuthorLinkExtension/TagLinkExtension to implement the fallback or
caller update accordingly.
- Around line 40-63: Add a renderer test for the new 3Speak postMessage handling
in ecency-renderer.tsx: mount the renderer with
renderOptions.embedVideosDirectly=true and create a mock iframe element with
class "speak-iframe" inside a container with class "markdown-video-link-speak"
(set iframe.contentWindow to window or a fake object), then dispatch
MessageEvent("message") with origin "https://play.3speak.tv" and data {type:
"3speak-player-ready", isVertical: true} and assert the container gains
"speak-portrait"; add a second test dispatching data with {type:
"3speak-player-ready", aspectRatio: 1.02} and assert "speak-square"; add
negative tests sending messages with wrong origin, wrong type, or event.source
not matching iframe.contentWindow and assert no classes are added; use your
existing test utilities (React Testing Library / jsdom) and target the
useEffect/handleMessage logic and the ".speak-iframe" /
"markdown-video-link-speak" selectors.

---

Nitpick comments:
In
`@apps/web/src/features/post-renderer/components/extensions/wave-like-post-extension.scss`:
- Around line 1-96: Remove the obsolete legacy rules matching
.ecency-renderer-wave-like-post-extension-renderer* from the old stylesheet and
consolidate any needed declarations into the new .er-wave-renderer block (and
its modifiers .er-wave-renderer--logo, --author, --body, and nested elements
like &__overlay, &--author-avatar, &--author-content) so there is no duplicated
or dead styling; delete the old block or migrate its relevant properties into
the new SCSS selectors and run a quick visual check to confirm nothing
regressed.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 72631b84-15d3-4373-8f69-1eeb7f7a2c30

📥 Commits

Reviewing files that changed from the base of the PR and between 461068e and 52266b5.

⛔ Files ignored due to path filters (6)
  • packages/render-helper/dist/browser/index.js is excluded by !**/dist/**
  • packages/render-helper/dist/browser/index.js.map is excluded by !**/dist/**, !**/*.map
  • packages/render-helper/dist/node/index.cjs is excluded by !**/dist/**
  • packages/render-helper/dist/node/index.cjs.map is excluded by !**/dist/**, !**/*.map
  • packages/render-helper/dist/node/index.mjs is excluded by !**/dist/**
  • packages/render-helper/dist/node/index.mjs.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (6)
  • apps/web/public/sw.js
  • apps/web/src/features/post-renderer/components/ecency-renderer.tsx
  • apps/web/src/features/post-renderer/components/extensions/wave-like-post-extension.scss
  • apps/web/src/features/post-renderer/components/utils/setupPostEnhancements.ts
  • apps/web/src/features/waves/styles/thread-render.scss
  • packages/render-helper/src/methods/linkify.method.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/web/src/features/post-renderer/components/utils/setupPostEnhancements.ts
  • packages/render-helper/src/methods/linkify.method.ts

Comment on lines +3 to +4
.thread-render,
.waves-list-item {
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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n apps/web/src/features/waves/styles/thread-render.scss | head -120

Repository: ecency/vision-next

Length of output: 3359


🏁 Script executed:

cat -n apps/web/src/app/waves/_components/waves-list-item.tsx | head -320

Repository: ecency/vision-next

Length of output: 11495


🏁 Script executed:

find . -type f -name "*.ts" -o -name "*.tsx" | xargs grep -l "PostContentRenderer" | head -10

Repository: ecency/vision-next

Length of output: 598


🏁 Script executed:

grep -r "markdown-view" --include="*.tsx" --include="*.ts" --include="*.scss" | head -20

Repository: ecency/vision-next

Length of output: 3055


🏁 Script executed:

cat -n apps/web/src/features/shared/post-content-renderer.tsx

Repository: ecency/vision-next

Length of output: 3562


🏁 Script executed:

cat -n apps/web/src/features/post-renderer/components/ecency-renderer.tsx | head -100

Repository: ecency/vision-next

Length of output: 3965


Scope leak: .waves-list-item and .thread-render now receive unintended descendant/image rules

At lines 3–4, the style block now targets the entire .waves-list-item container. Because lines 14–16 and 99–107 apply broad descendant and image selectors, non-markdown UI inside the wave card (from WavesListItemHeader, avatars, action buttons) will unintentionally inherit markdown typography and image aspect-ratio treatment.

Both .thread-render and .waves-list-item should scope their descendant rules to the rendered markdown content only:

Proposed scoping fix
-.thread-render,
-.waves-list-item {
+.thread-render .markdown-view:not(.markdown-view-pure),
+.waves-list-item .markdown-view:not(.markdown-view-pure) {
   display: grid;
   overflow: hidden;

Also applies to: lines 14–16, 99–107

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/features/waves/styles/thread-render.scss` around lines 3 - 4,
The selectors currently target .thread-render and .waves-list-item broadly,
causing markdown descendant and img rules (the blocks around lines 14–16 and
99–107) to leak onto non-markdown UI; restrict those rules to the
rendered-markdown area only by scoping descendant and image selectors to a
dedicated markdown container (e.g., change selectors using .thread-render or
.waves-list-item to target .thread-render .rendered-markdown and
.waves-list-item .rendered-markdown, and update the img/aspect-ratio rules
likewise), updating the CSS rules that apply to descendants and images so only
elements inside the rendered-markdown container receive markdown typography and
aspect-ratio styling.

@feruzm feruzm added the patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR label Mar 31, 2026
Copy link
Copy Markdown
Contributor

@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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/web/src/features/post-renderer/components/ecency-renderer.tsx`:
- Around line 53-57: The component adds "speak-portrait" and "speak-square" to a
container in the event handler but never removes them on unmount or when
embedVideosDirectly changes; update the effect that registers this handler (in
the EcencyRenderer component / the useEffect handling event.data) to track the
modified container(s) (e.g., store the last container reference or a Set of
containers) and in the effect cleanup remove both "speak-portrait" and
"speak-square" from those containers, and also ensure you remove classes when
embedVideosDirectly becomes falsy by running the same cleanup before toggling
behavior.

In `@apps/web/src/features/waves/styles/thread-render.scss`:
- Line 10: The stylesheet contains a deprecated declaration "word-break:
break-word"; remove or replace it: either delete that line and rely on the
existing "overflow-wrap: break-word" (preferred), or if you need aggressive
breaking change it to "word-break: break-all". Update the occurrence of
"word-break: break-word" in the thread-render.scss rule accordingly and ensure
only supported values remain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 557ff4c3-19a7-4609-a074-5c6f61ee0688

📥 Commits

Reviewing files that changed from the base of the PR and between 461068e and 52266b5.

⛔ Files ignored due to path filters (6)
  • packages/render-helper/dist/browser/index.js is excluded by !**/dist/**
  • packages/render-helper/dist/browser/index.js.map is excluded by !**/dist/**, !**/*.map
  • packages/render-helper/dist/node/index.cjs is excluded by !**/dist/**
  • packages/render-helper/dist/node/index.cjs.map is excluded by !**/dist/**, !**/*.map
  • packages/render-helper/dist/node/index.mjs is excluded by !**/dist/**
  • packages/render-helper/dist/node/index.mjs.map is excluded by !**/dist/**, !**/*.map
📒 Files selected for processing (6)
  • apps/web/public/sw.js
  • apps/web/src/features/post-renderer/components/ecency-renderer.tsx
  • apps/web/src/features/post-renderer/components/extensions/wave-like-post-extension.scss
  • apps/web/src/features/post-renderer/components/utils/setupPostEnhancements.ts
  • apps/web/src/features/waves/styles/thread-render.scss
  • packages/render-helper/src/methods/linkify.method.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/web/src/features/post-renderer/components/utils/setupPostEnhancements.ts
  • packages/render-helper/src/methods/linkify.method.ts
  • apps/web/src/features/post-renderer/components/extensions/wave-like-post-extension.scss

Comment on lines +53 to +57
if (event.data.isVertical) {
container.classList.add("speak-portrait");
} else if (event.data.aspectRatio && Math.abs(event.data.aspectRatio - 1) < 0.1) {
container.classList.add("speak-square");
}
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.

⚠️ Potential issue | 🟡 Minor

Classes added but never cleaned up on component unmount or re-render.

When embedVideosDirectly becomes falsy or the component unmounts, the speak-portrait and speak-square classes remain on DOM elements. Consider tracking modified containers and removing classes in the cleanup function.

🧹 Suggested fix
   useEffect(() => {
     if (!renderOptions?.embedVideosDirectly) return;
+    const modifiedContainers: Element[] = [];

     const handleMessage = (event: MessageEvent) => {
       if (event.origin !== "https://play.3speak.tv" || event.data?.type !== "3speak-player-ready") return;

       const iframes = ref.current?.querySelectorAll<HTMLIFrameElement>(".speak-iframe");
       iframes?.forEach((iframe) => {
         if (iframe.contentWindow !== event.source) return;
         const container = iframe.closest(".markdown-video-link-speak");
         if (!container) return;

         if (event.data.isVertical) {
           container.classList.add("speak-portrait");
+          modifiedContainers.push(container);
         } else if (event.data.aspectRatio && Math.abs(event.data.aspectRatio - 1) < 0.1) {
           container.classList.add("speak-square");
+          modifiedContainers.push(container);
         }
       });
     };

     window.addEventListener("message", handleMessage);
-    return () => window.removeEventListener("message", handleMessage);
+    return () => {
+      window.removeEventListener("message", handleMessage);
+      modifiedContainers.forEach(c => c.classList.remove("speak-portrait", "speak-square"));
+    };
   }, [renderOptions?.embedVideosDirectly]);
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (event.data.isVertical) {
container.classList.add("speak-portrait");
} else if (event.data.aspectRatio && Math.abs(event.data.aspectRatio - 1) < 0.1) {
container.classList.add("speak-square");
}
useEffect(() => {
if (!renderOptions?.embedVideosDirectly) return;
const modifiedContainers: Element[] = [];
const handleMessage = (event: MessageEvent) => {
if (event.origin !== "https://play.3speak.tv" || event.data?.type !== "3speak-player-ready") return;
const iframes = ref.current?.querySelectorAll<HTMLIFrameElement>(".speak-iframe");
iframes?.forEach((iframe) => {
if (iframe.contentWindow !== event.source) return;
const container = iframe.closest(".markdown-video-link-speak");
if (!container) return;
if (event.data.isVertical) {
container.classList.add("speak-portrait");
modifiedContainers.push(container);
} else if (event.data.aspectRatio && Math.abs(event.data.aspectRatio - 1) < 0.1) {
container.classList.add("speak-square");
modifiedContainers.push(container);
}
});
};
window.addEventListener("message", handleMessage);
return () => {
window.removeEventListener("message", handleMessage);
modifiedContainers.forEach(c => c.classList.remove("speak-portrait", "speak-square"));
};
}, [renderOptions?.embedVideosDirectly]);
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/features/post-renderer/components/ecency-renderer.tsx` around
lines 53 - 57, The component adds "speak-portrait" and "speak-square" to a
container in the event handler but never removes them on unmount or when
embedVideosDirectly changes; update the effect that registers this handler (in
the EcencyRenderer component / the useEffect handling event.data) to track the
modified container(s) (e.g., store the last container reference or a Set of
containers) and in the effect cleanup remove both "speak-portrait" and
"speak-square" from those containers, and also ensure you remove classes when
embedVideosDirectly becomes falsy by running the same cleanup before toggling
behavior.


line-height: 1.5;
overflow-wrap: break-word;
word-break: break-word;
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.

⚠️ Potential issue | 🟡 Minor

Replace deprecated break-word with break-all or overflow-wrap: break-word.

The break-word value for word-break is deprecated. Use word-break: break-all if you want aggressive breaking, or rely solely on overflow-wrap: break-word (already present on line 9) which handles most cases.

🧹 Suggested fix
   overflow-wrap: break-word;
-  word-break: break-word;
+  word-break: normal;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
word-break: break-word;
overflow-wrap: break-word;
word-break: normal;
🧰 Tools
🪛 Stylelint (17.5.0)

[error] 10-10: Unexpected deprecated keyword "break-word" for property "word-break" (declaration-property-value-keyword-no-deprecated)

(declaration-property-value-keyword-no-deprecated)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/web/src/features/waves/styles/thread-render.scss` at line 10, The
stylesheet contains a deprecated declaration "word-break: break-word"; remove or
replace it: either delete that line and rely on the existing "overflow-wrap:
break-word" (preferred), or if you need aggressive breaking change it to
"word-break: break-all". Update the occurrence of "word-break: break-word" in
the thread-render.scss rule accordingly and ensure only supported values remain.

@feruzm feruzm merged commit f05c562 into develop Mar 31, 2026
1 check passed
@feruzm feruzm deleted the thumb branch March 31, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Bug fixes and patches (1.0.0 → 1.0.1), add this only if any packages/ have patch changes in PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant