Skip to content

Commit a882846

Browse files
committed
Remove show notes and text color controls
1 parent 0ae7526 commit a882846

12 files changed

Lines changed: 18 additions & 111 deletions

File tree

Documentation/style-guide.md

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ Feature toggles and interaction configuration.
282282
| `behavior.feedback.thumbsPlacement` | string | `"inline"` | Thumbs up/down placement. `"inline"` places thumbs beside the sources label; `"below"` places them below the sources accordion with an optional label. |
283283
| `behavior.feedback.showCloseButton` | boolean \| null | `null` | X close button visibility. `null` = shown for `"action"`, hidden for `"modal"`. |
284284
| `behavior.feedback.showCancelButton` | boolean \| null | `null` | Cancel button visibility. `null` = shown for `"modal"`, hidden for `"action"`. Both set to `false` is honored: Submit and (in action mode) drag-down still dismiss. |
285-
| `behavior.feedback.showNotes` | boolean \| null | `null` | Notes field visibility override for modal mode. `null` falls back to per-sentiment `positiveNotesEnabled` / `negativeNotesEnabled`. Not rendered in action mode. |
286285

287286
### Citations
288287

@@ -340,8 +339,7 @@ Feature toggles and interaction configuration.
340339
"displayMode": "action",
341340
"thumbsPlacement": "below",
342341
"showCloseButton": true,
343-
"showCancelButton": false,
344-
"showNotes": null
342+
"showCancelButton": false
345343
},
346344
"citations": {
347345
"showLinkIcon": true
@@ -698,15 +696,14 @@ These tokens style the feedback dialog (modal card and action bottom sheet).
698696
| `--feedback-question-text-color` | `colors.feedback.questionText` | `String?` | falls back to the title color | Dialog question color. |
699697
| `--feedback-options-text-color` | `colors.feedback.optionsText` | `String?` | falls back to the title color | Checkbox option label color. |
700698
| `--feedback-checkbox-border-color` | `colors.feedback.checkboxBorder` | `String?` | `"#7F7F7F"` (light) / `"#B0B0B0"` (dark) | Checkbox unchecked outline color. Also used for the notes editor outline. |
701-
| `--feedback-notes-text-color` | `colors.feedback.notesText` | `String?` | falls back to the title color | Notes label, entered text, and placeholder color. |
702699
| `--feedback-drag-handle-color` | `colors.feedback.dragHandle` | `String?` | `"#CCCCCC"` | Drag handle color. Only visible in action mode. |
703700
| `--feedback-submit-button-fill-color` | `colors.feedback.submitButtonFill` | `String?` | falls back to `colors.button.primaryBackground` | Submit button fill color. |
704701
| `--feedback-submit-button-text-color` | `colors.feedback.submitButtonText` | `String?` | falls back to `colors.button.primaryText` | Submit button text color. |
705702
| `--feedback-cancel-button-fill-color` | `colors.feedback.cancelButtonFill` | `String?` | `null` (transparent; outline style) | Cancel button fill. `null` = transparent (outline style). Also tints the X close icon. |
706703
| `--feedback-cancel-button-text-color` | `colors.feedback.cancelButtonText` | `String?` | falls back to `colors.button.secondaryText` | Cancel button label color. |
707704
| `--feedback-cancel-button-border-color` | `colors.feedback.cancelButtonBorder` | `String?` | falls back to `colors.button.secondaryBorder` | Cancel button outline color. |
708705

709-
> **Contrast note:** When `--feedback-sheet-background-color` is pinned, also set `--feedback-title-text-color`, `--feedback-question-text-color`, `--feedback-options-text-color`, and `--feedback-notes-text-color` to maintain text contrast. System defaults track the device palette, not the themed surface.
706+
> **Contrast note:** When `--feedback-sheet-background-color` is pinned, also set `--feedback-title-text-color`, `--feedback-question-text-color`, and `--feedback-options-text-color` to maintain text contrast. System defaults track the device palette, not the themed surface.
710707
711708
### Colors - Disclaimer
712709

@@ -846,8 +843,8 @@ Non-CSS `components.feedback` overrides for the feedback dialog.
846843
| JSON Key | Type | Default | Description |
847844
|----------|------|---------|-------------|
848845
| `components.feedback.iconButtonSizeDesktop` | number | `32` | Feedback icon button hit target size (dp). Mirrors `--feedback-icon-btn-size-desktop`. |
849-
| `components.feedback.positiveNotesEnabled` | boolean | `true` | Notes field visibility for positive-sentiment modal. Overridden by `behavior.feedback.showNotes`. Not applied in action mode. |
850-
| `components.feedback.negativeNotesEnabled` | boolean | `true` | Notes field visibility for negative-sentiment modal. Overridden by `behavior.feedback.showNotes`. Not applied in action mode. |
846+
| `components.feedback.positiveNotesEnabled` | boolean | `true` | Notes field visibility for positive-sentiment modal. Not applied in action mode. |
847+
| `components.feedback.negativeNotesEnabled` | boolean | `true` | Notes field visibility for negative-sentiment modal. Not applied in action mode. |
851848

852849
### Layout - Citations
853850

code/concierge/src/main/kotlin/com/adobe/marketing/mobile/concierge/ui/components/feedback/FeedbackDialog.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ import androidx.compose.ui.unit.dp
5959
import com.adobe.marketing.mobile.concierge.R
6060
import com.adobe.marketing.mobile.concierge.ui.state.Feedback
6161
import com.adobe.marketing.mobile.concierge.ui.state.FeedbackType
62-
import com.adobe.marketing.mobile.concierge.ui.theme.ConciergeFeedbackBehavior
6362
import com.adobe.marketing.mobile.concierge.ui.theme.ConciergeStyles
6463
import com.adobe.marketing.mobile.concierge.ui.theme.ConciergeTheme
6564
import com.adobe.marketing.mobile.concierge.ui.theme.FeedbackDisplayMode
@@ -149,17 +148,15 @@ private fun resolveQuestion(feedbackType: FeedbackType): String {
149148
}
150149
}
151150

152-
/** Notes field visibility: `showNotes` when set, otherwise per-sentiment `positive/negativeNotesEnabled`. */
151+
/** Notes field visibility: per-sentiment `positive/negativeNotesEnabled` (defaults to `true`). */
153152
@Composable
154153
private fun resolveNotesEnabled(feedbackType: FeedbackType): Boolean {
155154
val componentsFeedback = ConciergeTheme.tokens?.components?.feedback
156-
val sentimentFallback = if (feedbackType == FeedbackType.POSITIVE) {
155+
return if (feedbackType == FeedbackType.POSITIVE) {
157156
componentsFeedback?.positiveNotesEnabled ?: true
158157
} else {
159158
componentsFeedback?.negativeNotesEnabled ?: true
160159
}
161-
val behavior: ConciergeFeedbackBehavior? = ConciergeTheme.behavior?.feedback
162-
return behavior?.resolvedShowNotes(sentimentFallback) ?: sentimentFallback
163160
}
164161

165162
/** Close (X) button visibility: `true` for `"action"`, `false` for `"modal"` by default. */

code/concierge/src/main/kotlin/com/adobe/marketing/mobile/concierge/ui/theme/CSSKeyMapper.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,6 @@ internal object CSSKeyMapper {
335335
existing?.copy(checkboxBorder = color) ?: ConciergeFeedbackColors(checkboxBorder = color)
336336
}
337337
},
338-
"feedback-notes-text-color" to { cssValue, theme ->
339-
updateFeedbackColors(cssValue, theme) { existing, color ->
340-
existing?.copy(notesText = color) ?: ConciergeFeedbackColors(notesText = color)
341-
}
342-
},
343338
"feedback-drag-handle-color" to { cssValue, theme ->
344339
updateFeedbackColors(cssValue, theme) { existing, color ->
345340
existing?.copy(dragHandle = color) ?: ConciergeFeedbackColors(dragHandle = color)

code/concierge/src/main/kotlin/com/adobe/marketing/mobile/concierge/ui/theme/ConciergeColors.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ data class ConciergeColors(
8686
val feedbackQuestionText: Color? = null,
8787
val feedbackOptionsText: Color? = null,
8888
val feedbackCheckboxBorder: Color? = null,
89-
val feedbackNotesText: Color? = null,
9089
val feedbackDragHandle: Color? = null,
9190
val feedbackSubmitButtonFill: Color? = null,
9291
val feedbackSubmitButtonText: Color? = null,

code/concierge/src/main/kotlin/com/adobe/marketing/mobile/concierge/ui/theme/ConciergeStyles.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,8 +1173,8 @@ internal object ConciergeStyles {
11731173
val titleColor = themeColors.feedbackTitleText ?: dialogTextColor
11741174
val questionColor = themeColors.feedbackQuestionText ?: dialogTextColor.copy(alpha = 0.7f)
11751175
val categoryTextColor = themeColors.feedbackOptionsText ?: dialogTextColor
1176-
val notesTextColor = themeColors.feedbackNotesText ?: dialogTextColor.copy(alpha = 0.7f)
1177-
val notesPlaceholderColor = themeColors.feedbackNotesText ?: dialogTextColor.copy(alpha = 0.5f)
1176+
val notesLabelColor = dialogTextColor.copy(alpha = 0.7f)
1177+
val notesPlaceholderColor = dialogTextColor.copy(alpha = 0.5f)
11781178
// iOS reuses the checkbox outline for the notes editor outline when set.
11791179
val textFieldBorder = themeColors.feedbackCheckboxBorder ?: dialogTextColor.copy(alpha = 0.2f)
11801180

@@ -1202,7 +1202,7 @@ internal object ConciergeStyles {
12021202
categoryTextColor = categoryTextColor,
12031203
categoriesNotesSpacing = 6.dp,
12041204
notesLabelStyle = MaterialTheme.typography.bodyMedium.copy(fontWeight = FontWeight.Medium),
1205-
notesLabelColor = notesTextColor,
1205+
notesLabelColor = notesLabelColor,
12061206
notesLabelSpacing = 8.dp,
12071207
notesPlaceholderStyle = MaterialTheme.typography.bodyMedium,
12081208
notesPlaceholderColor = notesPlaceholderColor,

code/concierge/src/main/kotlin/com/adobe/marketing/mobile/concierge/ui/theme/ConciergeThemeModels.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,6 @@ data class ConciergeFeedbackColors(
218218
val optionsText: String? = null,
219219
/** Checkbox unchecked outline color; also reused for the notes editor outline. */
220220
val checkboxBorder: String? = null,
221-
/** Notes label and placeholder color. */
222-
val notesText: String? = null,
223221
/** Action sheet drag handle color. */
224222
val dragHandle: String? = null,
225223
/** Submit button fill color. */

code/concierge/src/main/kotlin/com/adobe/marketing/mobile/concierge/ui/theme/ConciergeThemeTokens.kt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,18 +339,13 @@ data class ConciergeFeedbackBehavior(
339339
/** Overrides the close (X) button visibility. `null` defaults to `true` for `"action"`, `false` for `"modal"`. */
340340
val showCloseButton: Boolean? = null,
341341
/** Overrides the Cancel button visibility. `null` defaults to `true` for `"modal"`, `false` for `"action"`. */
342-
val showCancelButton: Boolean? = null,
343-
/** Overrides notes field visibility. `null` falls back to per-sentiment `positiveNotesEnabled` / `negativeNotesEnabled`. */
344-
val showNotes: Boolean? = null
342+
val showCancelButton: Boolean? = null
345343
) {
346344
/** Effective close button visibility: `showCloseButton` when set, otherwise `displayMode == ACTION`. */
347345
fun resolvedShowCloseButton(): Boolean = showCloseButton ?: (displayMode == FeedbackDisplayMode.ACTION)
348346

349347
/** Effective Cancel button visibility: `showCancelButton` when set, otherwise `displayMode == MODAL`. */
350348
fun resolvedShowCancelButton(): Boolean = showCancelButton ?: (displayMode == FeedbackDisplayMode.MODAL)
351-
352-
/** Notes field visibility: `showNotes` when set, otherwise the provided per-sentiment fallback. */
353-
fun resolvedShowNotes(fallback: Boolean): Boolean = showNotes ?: fallback
354349
}
355350

356351
/**

code/concierge/src/main/kotlin/com/adobe/marketing/mobile/concierge/ui/theme/ThemeParser.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ internal object ThemeParser {
355355
feedbackQuestionText = themeColors.feedback?.questionText?.toComposeColor(),
356356
feedbackOptionsText = themeColors.feedback?.optionsText?.toComposeColor(),
357357
feedbackCheckboxBorder = themeColors.feedback?.checkboxBorder?.toComposeColor(),
358-
feedbackNotesText = themeColors.feedback?.notesText?.toComposeColor(),
359358
feedbackDragHandle = themeColors.feedback?.dragHandle?.toComposeColor(),
360359
feedbackSubmitButtonFill = themeColors.feedback?.submitButtonFill?.toComposeColor(),
361360
feedbackSubmitButtonText = themeColors.feedback?.submitButtonText?.toComposeColor(),
@@ -444,8 +443,7 @@ internal object ThemeParser {
444443
displayMode = FeedbackDisplayMode.fromString(DataReader.optString(it, "displayMode", "modal")),
445444
thumbsPlacement = FeedbackThumbsPlacement.fromString(DataReader.optString(it, "thumbsPlacement", "inline")),
446445
showCloseButton = it["showCloseButton"] as? Boolean,
447-
showCancelButton = it["showCancelButton"] as? Boolean,
448-
showNotes = it["showNotes"] as? Boolean
446+
showCancelButton = it["showCancelButton"] as? Boolean
449447
)
450448
}
451449

code/concierge/src/test/kotlin/com/adobe/marketing/mobile/concierge/ui/theme/CSSKeyMapperTest.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class CSSKeyMapperTest {
6464
"feedback-question-text-color",
6565
"feedback-options-text-color",
6666
"feedback-checkbox-border-color",
67-
"feedback-notes-text-color",
6867
"feedback-drag-handle-color",
6968
"feedback-submit-button-fill-color",
7069
"feedback-submit-button-text-color",
@@ -1120,12 +1119,6 @@ class CSSKeyMapperTest {
11201119
assertEquals("#131313", result.colors?.feedback?.checkboxBorder)
11211120
}
11221121

1123-
@Test
1124-
fun `apply maps feedback-notes-text-color`() {
1125-
val result = CSSKeyMapper.apply("--feedback-notes-text-color", "#131313", emptyTheme)
1126-
assertEquals("#131313", result.colors?.feedback?.notesText)
1127-
}
1128-
11291122
@Test
11301123
fun `apply maps feedback-drag-handle-color`() {
11311124
val result = CSSKeyMapper.apply("--feedback-drag-handle-color", "#CCCCCC", emptyTheme)
@@ -1253,7 +1246,6 @@ class CSSKeyMapperTest {
12531246
"feedback-question-text-color",
12541247
"feedback-options-text-color",
12551248
"feedback-checkbox-border-color",
1256-
"feedback-notes-text-color",
12571249
"feedback-drag-handle-color",
12581250
"feedback-submit-button-fill-color",
12591251
"feedback-submit-button-text-color",

code/concierge/src/test/kotlin/com/adobe/marketing/mobile/concierge/ui/theme/ConciergeFeedbackBehaviorTest.kt

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import org.junit.Assert.assertTrue
1919
import org.junit.Test
2020

2121
/**
22-
* Tests visibility defaults and overrides for the feedback close (X) and Cancel buttons,
23-
* and for the notes field. Mirrors the iOS `ConciergeFeedbackBehaviorTests` coverage.
22+
* Tests visibility defaults and overrides for the feedback close (X) and Cancel buttons.
23+
* Mirrors the iOS `ConciergeFeedbackBehaviorTests` coverage.
2424
*/
2525
class ConciergeFeedbackBehaviorTest {
2626

@@ -98,34 +98,6 @@ class ConciergeFeedbackBehaviorTest {
9898

9999
assertNull(behavior.showCloseButton)
100100
assertNull(behavior.showCancelButton)
101-
assertNull(behavior.showNotes)
102-
}
103-
104-
// ========== showNotes resolver ==========
105-
106-
/** When `showNotes` is null, fall back to the per-sentiment value. */
107-
@Test
108-
fun `resolvedShowNotes null falls back to per sentiment fallback`() {
109-
val behavior = ConciergeFeedbackBehavior(showNotes = null)
110-
111-
assertTrue(behavior.resolvedShowNotes(fallback = true))
112-
assertFalse(behavior.resolvedShowNotes(fallback = false))
113-
}
114-
115-
@Test
116-
fun `resolvedShowNotes explicit true overrides fallback`() {
117-
val behavior = ConciergeFeedbackBehavior(showNotes = true)
118-
119-
assertTrue(behavior.resolvedShowNotes(fallback = false))
120-
assertTrue(behavior.resolvedShowNotes(fallback = true))
121-
}
122-
123-
@Test
124-
fun `resolvedShowNotes explicit false overrides fallback`() {
125-
val behavior = ConciergeFeedbackBehavior(showNotes = false)
126-
127-
assertFalse(behavior.resolvedShowNotes(fallback = true))
128-
assertFalse(behavior.resolvedShowNotes(fallback = false))
129101
}
130102

131103
// ========== ConciergeFeedbackComponent per-sentiment flags ==========
@@ -160,14 +132,12 @@ class ConciergeFeedbackBehaviorTest {
160132
val original = ConciergeFeedbackBehavior(
161133
displayMode = FeedbackDisplayMode.ACTION,
162134
showCloseButton = false,
163-
showCancelButton = true,
164-
showNotes = false
135+
showCancelButton = true
165136
)
166137
val updated = original.copy(displayMode = FeedbackDisplayMode.MODAL)
167138

168139
assertEquals(FeedbackDisplayMode.MODAL, updated.displayMode)
169140
assertFalse(updated.showCloseButton!!)
170141
assertTrue(updated.showCancelButton!!)
171-
assertFalse(updated.showNotes!!)
172142
}
173143
}

0 commit comments

Comments
 (0)