Skip to content

Create PageHeader Compose component and templates tab in ADS#7625

Merged
GerardPaligot merged 13 commits intodevelopfrom
feature/gerard/page-header-compose
Mar 16, 2026
Merged

Create PageHeader Compose component and templates tab in ADS#7625
GerardPaligot merged 13 commits intodevelopfrom
feature/gerard/page-header-compose

Conversation

@GerardPaligot
Copy link
Copy Markdown
Contributor

@GerardPaligot GerardPaligot commented Jan 29, 2026

Task/Issue URL: https://app.asana.com/1/137249556945/project/1212015278241917/task/1211670072973939?focus=true

Description

Create DaxPageHeader component in Compose for settings screens.

Steps to test this PR

Check DaxPageHeader

  • Open the application
  • Go to the ADS screens from developer settings
  • Open the "Templates" tab
  • Check PageHeaders component follow our actual XML implementation

UI changes

image

Note

Medium Risk
Adds new Compose UI components and a new ADS demo tab, plus significantly broadens the custom lint detector logic for DaxText color validation, which could introduce new/changed warnings in builds.

Overview
Adds new Compose UI templates: DaxPageHeader (optional icon/subtitle/body/status/learn-more) and a supporting DaxStatusIndicator/Status enum, with previews.

Extends the ADS demo by adding a new Templates tab (TemplatesFragment/TemplatesPane) to showcase DaxPageHeader, and refactors compose view setup by introducing a ComposeView.setupThemedComposeView helper.

Updates the custom lint rule InvalidDaxTextColorUsage to allow DuckDuckGoTheme.colors.text (and legacy textColors), allow theme static colors, and validate colors referenced via defaults objects; baselines are adjusted accordingly and tests are expanded to cover the new acceptance rules.

Written by Cursor Bugbot for commit a918eea. This will update automatically on new commits. Configure here.

Copy link
Copy Markdown
Contributor Author

GerardPaligot commented Jan 29, 2026

@GerardPaligot GerardPaligot force-pushed the feature/gerard/page-header-compose branch from 96574b2 to 2d653b6 Compare February 2, 2026 16:24
@GerardPaligot GerardPaligot force-pushed the feature/gerard/page-header-smartling branch from 22c8785 to d872b05 Compare February 2, 2026 16:24
@GerardPaligot GerardPaligot force-pushed the feature/gerard/page-header-smartling branch from d872b05 to f76f0da Compare March 6, 2026 13:09
@GerardPaligot GerardPaligot force-pushed the feature/gerard/page-header-compose branch from 2d653b6 to 28d4cf1 Compare March 6, 2026 13:09
Base automatically changed from feature/gerard/page-header-smartling to develop March 8, 2026 22:39
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Unescaped dots in regex pattern cause incorrect matching
    • Escaped COLOR_THEME_PACKAGE with Regex.escape before building the import regex so package dots are treated as literals.

Create PR

Or push these changes by commenting:

@cursor push eb6c5c9c79
Preview (eb6c5c9c79)
diff --git a/lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt b/lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt
--- a/lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt
+++ b/lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt
@@ -165,8 +165,9 @@
             identifier: String,
         ): Boolean {
             if (fileText.isBlank()) return false
+            val escapedThemePackage = Regex.escape(COLOR_THEME_PACKAGE)
             val escapedIdentifier = Regex.escape(identifier)
-            val importRegex = Regex("""import\s+$COLOR_THEME_PACKAGE\.$escapedIdentifier(\s+as\s+\w+)?""")
+            val importRegex = Regex("""import\s+$escapedThemePackage\.$escapedIdentifier(\s+as\s+\w+)?""")
             return importRegex.containsMatchIn(fileText)
         }

Comment thread lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt Outdated
Comment thread .editorconfig
ktlint_standard_kdoc-wrapping = disabled

[android-design-system/**/ui/compose/**/*.kt]
ktlint_standard_enum-entry-name-case = disabled No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Copy link
Copy Markdown
Contributor

@mikescamell mikescamell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, awesome work!

I think we should address the comments I made but approving not to block after the changes have been made.

@GerardPaligot GerardPaligot force-pushed the feature/gerard/page-header-compose branch from a06929f to a918eea Compare March 16, 2026 17:44
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Lint rule substring match allows non-text color paths
    • I changed the semantic path check to require DuckDuckGoTheme.colors.text. so textField and other non-text paths no longer match.

Create PR

Or push these changes by commenting:

@cursor push cfdd74247c
Preview (cfdd74247c)
diff --git a/lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt b/lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt
--- a/lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt
+++ b/lint-rules/src/main/java/com/duckduckgo/lint/ui/DaxTextColorUsageDetector.kt
@@ -87,7 +87,7 @@
         private fun containsSemanticThemeColorPath(source: String): Boolean {
             return source.contains("DuckDuckGoTheme.textColors") || // legacy
                 source.contains(".textColors.") ||
-                source.contains("DuckDuckGoTheme.colors.text") || // preferred
+                source.contains("DuckDuckGoTheme.colors.text.") || // preferred
                 source.contains(".colors.text.")
         }

@GerardPaligot GerardPaligot merged commit 0fe6817 into develop Mar 16, 2026
14 checks passed
@GerardPaligot GerardPaligot deleted the feature/gerard/page-header-compose branch March 16, 2026 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants