Skip to content

TDH-2552-Support-custom-widget-position#1528

Open
ayush-kommunicate wants to merge 1 commit into
developmentfrom
TDH-2552-support-custom-widget-position
Open

TDH-2552-Support-custom-widget-position#1528
ayush-kommunicate wants to merge 1 commit into
developmentfrom
TDH-2552-support-custom-widget-position

Conversation

@ayush-kommunicate
Copy link
Copy Markdown

@ayush-kommunicate ayush-kommunicate commented May 29, 2026

What do you want to achieve?

  • Users can set the widget position from widget customization, and the widget reads those values from app settings and applies the position accordingly.

Dashboard pr : https://github.com/Kommunicate-io/Kommunicate-Dashboard/pull/3884

PR Checklist

  • I have tested it locally and all functionalities are working fine.
  • I have compared it with mocks and all design elements are the same.
  • I have tested it in IE Browser.

How was the code tested?

What new thing you came across while writing this code?

In case you fixed a bug then please describe the root cause of it?

Screenshot

NOTE: Make sure you're comparing your branch with the correct base branch

Summary by CodeRabbit

  • New Features

    • Added widget custom positioning capability with automatic left/right orientation detection
  • Bug Fixes

    • Enhanced iframe height and layout adjustments for improved widget display consistency across different widget modes

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3d57b4fe-a810-4373-b8e9-bf2570ab3653

📥 Commits

Reviewing files that changed from the base of the PR and between 328e37c and 049e456.

📒 Files selected for processing (2)
  • webplugin/js/app/mck-app.js
  • webplugin/js/app/mck-sidebox-1.0.js

Walkthrough

This PR adds custom widget positioning support and unifies iframe height adjustment logic. New positioning helpers in mck-app.js compute and apply CSS styles to the widget iframe based on configuration, wired into initialization. In mck-sidebox-1.0.js, iframe height adjustment is now applied consistently across pre-lead and standard flows, with removal of hardcoded sizing constraints.

Changes

Widget Display & Positioning

Layer / File(s) Summary
Widget Custom Positioning Support
webplugin/js/app/mck-app.js
New helper functions compute pixel offsets and orientation (left/right) from widgetSettings.position. applyWidgetCustomPosition() sets/resets custom CSS styling on kommunicate-widget-iframe and tracks state via data-km-custom-widget-position attribute. Wired into mckInitSidebox() immediately after settings are populated.
Consistent Iframe Height Adjustment
webplugin/js/app/mck-sidebox-1.0.js
openWidgetIframe() now unconditionally applies kommunicateCommons.adjustIframeHeightForLayout() instead of conditionally clearing height in pre-lead mode. Pre-lead adjustIframeForPrelead() removes hardcoded 600px minHeight and invokes the shared layout adjustment for uniform sizing.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • devashishmamgain
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description explains what users can achieve but lacks critical details: testing status is unchecked, specific testing methodology is missing, and no screenshots or design verification are provided. Complete the PR checklist items, specify how the code was tested (browsers, scenarios), provide screenshots showing the custom positioning feature, and confirm design alignment with mocks.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly references the feature being implemented (custom widget positioning) with an associated ticket identifier, directly matching the core changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ 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 TDH-2552-support-custom-widget-position

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 skipped: no ESLint configuration detected in root package.json. To enable, add eslint to devDependencies.


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.

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.

1 participant