-
Notifications
You must be signed in to change notification settings - Fork 0
Rich‐text
OlenaOsadchaBA edited this page Jun 12, 2026
·
2 revisions
A required rich-text field with three formatting controls: Bold, Italic, and Line Break.
Three buttons:
- B (bold),
- I (italic),
- ↵ (line break)
Each button has 3 visual states:
- idle - formatting is not applied
- active - formatting is applied (dark fill with white label)
- partial (optional) – formatting is applied to only part of the selected text
- When User opens the page:
- rich-text toolbar is applied to the defined in requirements fields
- all toolbar buttons are idle
- system loads any existing content and corresponding formatting for fields in the page
- User types plain text:
- toolbar buttons remain idle
- no formatting is active at the cursor
- system tracks content length in the background
- User selects text → clicks B
- User: selects a word or phrase, text range clicks the B button
- System: wraps selection in bold
- System: B button switches to active state (dark fill)
- User selects text → clicks I
- User: selects a word or phrase/text range, clicks the I button
- System: wraps selection in italic
- System: I button switches to active state (dark fill)
- User clicks ↵ (line break)
- User: positions cursor at desired point, clicks ↵
- System: inserts a line break
- When a user places a cursor inside a text/select a text
- System detects formatting applied to the current cursor position or selected text.
- System updates the toolbar to reflect the detected formatting.
- System displays buttons in the active state corresponding to applied formatting.
- When a user selects a text and clicks the corresponding formatting button
- System removes the selected formatting from the selected text only.
- System updates the toolbar state accordingly.
- When a user selects a text with existing formatting and clicks on the additional formatting button
- System applies the newly selected formatting.
- System preserves any existing formatting.
- System supports combined formatting (e.g., Bold + Italic).
When a user selects text containing both formatted and unformatted content
- System evaluates the formatting state of the entire selection.
- System displays a Partial state when formatting is applied to only part of the selection.
- System applies or removes formatting across the entire selected range when the user clicks a formatting button.