iachat/app/javascript/dashboard/helper
Cayo P. R. Oliveira c6f9e814c2
feat: add customizable signature position and separator options (#78)
* feat: add customizable signature position and separator options

* fix: correct default value note for signatureSeparator and ensure reactivity

* fix: correct watcher boolean conversion and add immediate ui_settings updates

- Fix watchers to convert string props to boolean values for reactive refs
- Add immediate event handlers for switch changes to update ui_settings in real-time
- Ensure proper synchronization between switch states and user.ui_settings

Co-Authored-By: cayo@fazer.ai <cayoproliveira@gmail.com>

* fix: split signature content and ui_settings updates to resolve persistence bug

- Use updateUISettings store action for signature_position and signature_separator
- Keep updateProfile for message_signature content only
- Fixes FormData serialization issue that corrupted nested ui_settings object
- Add diagnostic logging to verify data flow

Co-Authored-By: cayo@fazer.ai <cayoproliveira@gmail.com>

* clean: remove diagnostic console logging from updateSignature method

- Remove temporary console.log statements added for verification
- Keep core implementation that splits signature content and ui_settings updates
- Keep console.error for proper error handling with eslint-disable comment
- Implementation now ready for production use

Co-Authored-By: cayo@fazer.ai <cayoproliveira@gmail.com>

* fix: updateUISettings call in updateSignature method

* chore: move signature application to send-time and add button highlighting (#79)

* fix: move signature application from editor manipulation to send-time

- Remove addSignature/removeSignature/toggleSignatureInEditor from WootWriter
- Remove signature logic from draft handling and canned response insertion
- Apply signatures only in getMessagePayload during message sending
- Add button highlighting for signature toggle when activated
- Prevents signature duplication and persistence in editor content
- Fixes signature position toggle bug

Co-Authored-By: cayo@fazer.ai <cayoproliveira@gmail.com>

* fix: escape signature separator to prevent markdown setext heading interpretation

- Escape '--' separator as '\--' in appendSignature to prevent H2 heading creation
- Update removeSignature to handle escaped separators correctly
- Fixes signature separator being rendered as markdown instead of plain text
- Refactor nested ternary to fix ESLint error

Co-Authored-By: cayo@fazer.ai <cayoproliveira@gmail.com>

* fix: prevent signature separator markdown interpretation in message processing

- Add fix_signature_separator_markdown method to escape '--' separators
- Update ensure_processed_message_content to fix separators before saving
- Prevents signature separators from being interpreted as setext headings
- Ensures correct message display in channels and email notifications

Co-Authored-By: cayo@fazer.ai <cayoproliveira@gmail.com>

* fix: update separator format to use \n--\n instead of escaping

- Change separator delimiter from '\--' to '\n--\n' format
- Update removeSignature function to handle new separator format correctly
- Simplify message processing since separators are already properly formatted
- Ensures consistent separator handling across frontend and backend

Co-Authored-By: cayo@fazer.ai <cayoproliveira@gmail.com>

* fix: update signature delimiter format to include extra new lines

* chore: remove comment about signature application logic

* refactor: remove unused method and comments related to signature separator markdown processing

* chore: simplify slash command detection by using updatedMessage directly

* refactor: remove signature logic from draft message handling

* refactor: simplify body empty check by removing signature manipulation logic

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: cayo@fazer.ai <cayoproliveira@gmail.com>

* refactor: extract signature settings logic into a separate method

* fix: handle nil ui_settings in signature position and separator methods

* fix: update return value of findSignatureInBody to include position information

* fix: update signature handling in findSignatureInBody and related methods

* fix: adjust delimiter length handling in removeSignature function

* test: add cases for appending, removing, and replacing signatures with various separators

* test: add cases for signature position and separator handling

* test: add cases for updating signature position and separator in ui_settings

* fix: correct typo in comment for findSignatureInBody function

* refactor: simplify translation function calls in MessageSignature component

* chore: refactoring

* chore: refactor

* feat: switch -> select

* chore: refactor and undo changes

* chore: refactor and undo changes

* chore: refactor

* fix: remove old select component usage

* chore: remove useless style

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: gabrieljablonski <contact@gabrieljablonski.com>
2025-08-17 23:01:41 -03:00
..
AnalyticsHelper feat: Add June events for linear integration (#11007) 2025-03-03 13:33:11 +05:30
AudioAlerts feat: handle mine event for incoming messages (#10867) 2025-02-11 17:45:31 +05:30
CacheHelper
commandbar
specs feat: add customizable signature position and separator options (#78) 2025-08-17 23:01:41 -03:00
actionCable.js feat: Add stores for copilotMessages and copilotThreads (#11603) 2025-05-27 18:36:32 -06:00
actionQueryGenerator.js
agentHelper.js fix: Translate "None" option in agent assignment dropdown (#11060) 2025-03-11 14:49:27 -07:00
APIHelper.js
auditlogHelper.js feat: Add conversation delete feature (#11677) 2025-06-05 15:53:17 -05:00
automationHelper.js fix: Translate Priority and Messages types in Automations and Macros (#11741) 2025-07-08 12:40:40 +05:30
commons.js fix: Variable search item not showing after braces/commas (#11864) 2025-07-03 19:39:36 +05:30
conversationHelper.js
customViewsHelper.js feat: Add support for frontend filtering of conversations (#11111) 2025-03-24 19:39:04 -07:00
DOMHelpers.js
downloadHelper.js
editorHelper.js feat: add customizable signature position and separator options (#78) 2025-08-17 23:01:41 -03:00
featureHelper.js feat: Add frontend changes for Captain limits (#10749) 2025-01-24 09:21:09 -08:00
filterQueryGenerator.js
flag.js
inbox.js feat: Voice channel creation Flow (#11775) 2025-06-25 14:21:03 -07:00
labelColor.js
permissionsHelper.js chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
portalHelper.js chore: Remove older UI (#11720) 2025-07-01 09:43:44 +05:30
preChat.js
pushHelper.js
ReconnectService.js
routeHelpers.js
scriptHelpers.js fix: Initialize SDK along with emitter registration (#10896) 2025-02-12 22:14:04 -08:00
snoozeHelpers.js feat(v4): Update Inbox view card design (#10599) 2025-01-07 21:11:54 +05:30
states.js
themeHelper.js feat: Support bigger font size in dashboard (#10974) 2025-02-27 12:10:33 +05:30
uploadHelper.js
URLHelper.js feat(v4): Update the help center portal design (#10296) 2024-10-23 22:09:36 -07:00
validations.js chore: Add open conversation option (#11828) 2025-07-02 10:01:50 +05:30