Summary | Opens automatically and displays the chat like a sidebar, as long as space exists, and takes advantage of the height | |
Repository | GitHub - Arkshine/discourse-chat-sidebar | |
Install Guide | How to install a theme or theme component | |
New to Discourse Themes? | Beginner’s guide to using Discourse Themes |
Install this theme component
Credits: @Alon1 (paid request)[1]
This theme component aims to open automatically and display the chat like a sidebar, as long as space exists, and take advantage of the height.
- Only for desktop
- Windows resize support
- Composer support
- Can stick either to the content or window on both sides
- User can choose the position (saved in the browser’s local storage)
- Can revert to the original chat state if it was previously opened
- The chat original user’s preferences are untouched
- Partial theme support (most of the popular ones)
This should work on most of the themes.
Let me know if it misses options or something doesn’t work on a theme!
Settings
Name | Default | Description |
---|---|---|
breakpoint |
auto |
Breakpoint in px for the chat sidebar to appear. Set to auto to use the default sidebar and content width as a natural breakpoint (recommended). |
width |
400px |
Width of the chat sidebar. |
position [2] |
right |
Position of the chat sidebar. left : Stick to the left side of the contentright : Stick to the right side of the contentoutside-left : Stick to the left side of the windowoutside-right : Stick to the right side of the window |
theme_style |
When possible, use the current theme style on these chat sidebar position . Available only for most of the popular themes. This is not a reliable setting (theme name can be changed). Disable to use the default theme style. |
|
allow_user_preference [3] |
Allow users to set their chat sidebar preferences. Note: this is saved in the user’s browser local storage. Available values: position : Allow users to set the chat sidebar position |
Todo
- Tests
- Smoother transitions
- More user’s preferences?
Dev Notes
Initially, I tried to insert the <ChatDrawer />
component into another outlet so it would be easier to manipulate and keep it in the flow. Unfortunately, the original component can’t be suppressed entirely (I’m thinking of the events). At least, I could not find a way to overwrite it.
It leaves me no choice but to follow the hard JS way at the cost of a little more CPU intensive but less intrusive (though manual resizing only happens sometimes).