Idea: AI-Assisted Message Separation for NodeBB Chat
-
Hi everyone,
I’ve developed a code snippet to improve visual differentiation in NodeBB chats.
The code was initially drafted by AI and is currently a proof-of-concept. It’s functional but needs further optimization and design refinement to meet community standards.
I’m sharing this because I believe it could be a valuable addition to the platform. I would love for the community to help refine the logic and explore integrating it as a feature or a plugin.
Looking forward to your feedback!
@julian @baris/* --- עיצוב בסיסי לצ'אט --- */ /* רקע כללי של הצ'אט */ [class="modal-content ui-resizable"], [component="chat/main-wrapper"] { background-image: url(https://good-link.org/assets/uploads/system/whatsapp-wallpaper-39.jpg); position: relative; } /* כותרת עליונה של הצ'אט הראשי */ [component="chat/header"] { background-color: #075E54 !important; color: #ffffff !important; font-weight: bold; font-size: 16px; text-align: center; padding: 10px; } [component="chat/header"] *, [component="chat/header"] i, [component="chat/header"] svg, [component="chat/header"] button { color: #ffffff !important; fill: #ffffff !important; stroke: #ffffff !important; } /* כותרת צ'אט מוקטן בצד */ .modal-header.d-flex.gap-4.justify-content-between.ui-draggable-handle { background-color: #075E54 !important; color: #ffffff !important; padding: 10px; font-weight: bold; font-size: 14px; } .modal-header.d-flex.gap-4.justify-content-between.ui-draggable-handle * { color: #ffffff !important; fill: #ffffff !important; stroke: #ffffff !important; } /* --- עיצוב הודעות (בועות צ'אט) --- */ /* הגדרות כלליות להודעה: מיקום, רוחב מקסימלי, מרווח תחתון */ [component="chat/message"] { position: relative; margin-top: 9px; margin-bottom: 30px !important; padding: 5px 17px; /* ריווח פנימי אנכי ואופקי בסיסי */ max-width: calc(100% - 70px); /* השארת מרווח כולל של 70px (10 בצד אחד, 60 בצד שני) */ width: fit-content; /* התאמת רוחב לתוכן */ clear: both; /* למנוע בעיות גלישה */ } /* הודעות של אחרים (בועה לבנה, יישור לימין ב-RTL) */ [data-self="0"][component="chat/message"] { background-color: #fff; border-radius: 20px 20px 0px 20px; /* פינה תחתונה-ימנית חדה */ margin-left: 10px !important; /* מרווח קבוע מהצד השמאלי */ margin-right: auto !important; /* דחיפה לימין */ /* padding-bottom: 5px; ריווח תחתון פנימי קטן - הועבר לכלל הראשי */ } /* ההודעות שלי (בועה ירוקה, יישור לשמאל ב-RTL) */ [data-self="1"][component="chat/message"] { background-color: #e7ffdb; border-radius: 20px 20px 20px 0px; /* פינה תחתונה-שמאלית חדה */ margin-left: auto !important; /* דחיפה לשמאל */ margin-right: 10px !important; /* מרווח קבוע מהצד הימני */ padding-left: 21px !important; /* ריווח פנימי שמאלי קצת יותר גדול אם צריך */ /* padding-bottom: 5px; ריווח תחתון פנימי קטן - הועבר לכלל הראשי */ } /* הודעות ללא הפרדה (רצופות) */ [component="chat/message"][data-break="false"] { margin-top: 2px; /* הקטנת מרווח עליון */ margin-bottom: 2px !important; /* הקטנת מרווח תחתון */ } /* עיצוב טקסט מצוטט בתיבת הקלט */ .w-100.flex-grow-1.flex-nowrap.position-relative.d-flex.rounded-2.border.border-secondary.p-1.align-items-end textarea::before { content: "> "; color: #007bff; /* צבע ציטוט */ font-weight: bold; } /* --- מיקום אימוג'ים (Reactions) מתחת להודעה --- */ [component="chat/message"] [component="message/reactions"] { position: absolute; bottom: -22px; /* מיקום מתחת לבועה (שחק עם הערך לפי הצורך) */ z-index: 5; display: flex; flex-wrap: wrap; gap: 4px; max-width: 80%; background-color: rgba(240, 240, 240, 0.85); padding: 2px 5px; border-radius: 10px; box-shadow: 0 1px 2px rgba(0,0,0,0.1); } [data-self="0"][component="chat/message"] [component="message/reactions"] { left: 5px; right: auto; } [data-self="1"][component="chat/message"] [component="message/reactions"] { right: 5px; left: auto; justify-content: flex-end; } /* --- מיקום כלי ההודעה (Reply, React, More) בצד --- */ [component="chat/message"] .controls { position: absolute !important; top: -10px !important; bottom: auto !important; opacity: 0; pointer-events: none; transition: opacity 0.2s ease-in-out, transform 0.1s ease-in-out; transform: translateY(3px); background-color: rgba(250, 250, 250, 0.97) !important; border-radius: 15px !important; padding: 5px 8px !important; box-shadow: 0 2px 5px rgba(0,0,0,0.2) !important; border: none !important; z-index: 10; display: flex !important; gap: 5px; } [component="chat/message"]:hover .controls { opacity: 1; pointer-events: auto; transform: translateY(0); } [data-self="0"][component="chat/message"] .controls { right: -15px !important; /* מיקום מימין להודעה (שחק עם הערך) */ left: auto !important; } [data-self="1"][component="chat/message"] .controls { left: -15px !important; /* מיקום משמאל להודעה (שחק עם הערך) */ right: auto !important; } [component="chat/message"] .controls .btn { padding: 2px 4px !important; background: none !important; border: none !important; line-height: 1; box-shadow: none !important; border-radius: 5px; transition: background-color 0.15s ease; } [component="chat/message"] .controls .btn:hover { background-color: rgba(0, 0, 0, 0.1) !important; } [component="chat/message"] .controls i, [component="chat/message"] .controls svg { color: #444 !important; fill: #444 !important; stroke: none !important; width: 18px; height: 18px; vertical-align: middle; } -
@משה can we see what it looks like? Share a screenshot!!


-
@julian
I repeat and clarify.
The code was written by AI, it is full of bugs, and does not seem perfect.
But I trust you, you are programmers, and you will know what to do with it.


-
Hi @julian ,
Did you get a chance to see the screenshot and the code?
I just wanted to update you that I'm opening a Pull Request (PR) on GitHub now.
-
@משה I think it would be a nice add on css for those interested

I think we will likely stick with our own styling for now, but perhaps adopting some of the bubble styling may be beneficial