-
Notifications
You must be signed in to change notification settings - Fork 0
🎨 Palette: Micro-UX improvements for URL pasting and secret visibility #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+132
−5
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Palette's Journal - FREE-AI-ROCK | ||
|
|
||
| This journal tracks critical UX/accessibility learnings specific to this application's components and design system. | ||
|
|
||
| ## 2025-02-14 - Auto-Extraction from Raw URLs on Paste | ||
| **Learning:** Users naturally copy the entire browser URL (like a full PR link or a raw code link) rather than manually extracting the owner, repo name, PR number, or filename. Requiring them to manually parse these details is a significant cognitive load and causes friction. | ||
| **Action:** Always intercepts text input in repo/PR fields. If a URL format is detected, automatically extract all relevant segments (owner, repo, filename, PR #) and distribute them to the corresponding form fields in a single operation. | ||
|
|
||
| ## 2025-02-14 - Aesthetic-Consistent Show/Hide Secret Toggles | ||
| **Learning:** This app operates under a super-minimalist aesthetic and has zero vector icon dependencies (the bottom navigation uses monospace characters as icons). Adding standard vector icons for password toggle (visibility/visibility-off) would introduce dependency overhead or visual inconsistency. | ||
| **Action:** Design custom text-based toggles (e.g., "Show" / "Hide" monospace button) as `trailingIcon` on password inputs. This keeps the design system beautifully uniform, maintains full screen-reader accessibility, and avoids bundling heavy vector drawables. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
app/src/test/java/com/sayanthrock/freeairock/ui/PrUrlParserTest.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| package com.sayanthrock.freeairock.ui | ||
|
|
||
| import com.sayanthrock.freeairock.extractFileNameFromUrl | ||
| import org.junit.Assert.assertEquals | ||
| import org.junit.Assert.assertNull | ||
| import org.junit.Test | ||
|
|
||
| class PrUrlParserTest { | ||
|
|
||
| @Test | ||
| fun testParseGitHubPrUrl_validUrls() { | ||
| val testCases = listOf( | ||
| "https://github.com/SayanthRock/FREE-AI-ROCK-/pull/12" to Triple("SayanthRock", "FREE-AI-ROCK-", "12"), | ||
| "http://github.com/SayanthRock/Root-apk/pull/123" to Triple("SayanthRock", "Root-apk", "123"), | ||
| "github.com/SayanthRock/Root-apk/pull/123/" to Triple("SayanthRock", "Root-apk", "123"), | ||
| "https://www.github.com/SayanthRock/Root-apk/pull/123/files" to Triple("SayanthRock", "Root-apk", "123"), | ||
| "https://github.com/SayanthRock/Root-apk/pull/123?diff=unified" to Triple("SayanthRock", "Root-apk", "123") | ||
| ) | ||
|
|
||
| for ((input, expected) in testCases) { | ||
| val result = parseGitHubPrUrl(input) | ||
| assertEquals("Failed on input: $input", expected, result) | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| fun testParseGitHubPrUrl_invalidUrls() { | ||
| val testCases = listOf( | ||
| "https://github.com/SayanthRock/FREE-AI-ROCK-", | ||
| "not-a-url", | ||
| "https://github.com/SayanthRock/FREE-AI-ROCK-/issues/1", | ||
| "https://gitlab.com/SayanthRock/Root-apk/pull/123" | ||
| ) | ||
|
|
||
| for (input in testCases) { | ||
| val result = parseGitHubPrUrl(input) | ||
| assertNull("Expected null on input: $input", result) | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| fun testExtractFileNameFromUrl_validUrls() { | ||
| val testCases = listOf( | ||
| "https://github.com/SayanthRock/FREE-AI-ROCK-/blob/main/app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt" to "MainActivity.kt", | ||
| "https://raw.githubusercontent.com/SayanthRock/FREE-AI-ROCK-/main/app/build.gradle.kts" to "build.gradle.kts", | ||
| "https://github.com/owner/repo/blob/branch/src/App.tsx?someQuery=1" to "App.tsx", | ||
| "github.com/owner/repo/blob/branch/src/index.html#anchor" to "index.html" | ||
| ) | ||
|
|
||
| for ((input, expected) in testCases) { | ||
| val result = extractFileNameFromUrl(input) | ||
| assertEquals("Failed on input: $input", expected, result) | ||
| } | ||
| } | ||
|
|
||
| @Test | ||
| fun testExtractFileNameFromUrl_invalidUrls() { | ||
| val testCases = listOf( | ||
| "https://github.com/SayanthRock/FREE-AI-ROCK-", | ||
| "https://github.com/SayanthRock/FREE-AI-ROCK-/tree/main/app", | ||
| "not-a-file-url" | ||
| ) | ||
|
|
||
| for (input in testCases) { | ||
| val result = extractFileNameFromUrl(input) | ||
| assertNull("Expected null on input: $input", result) | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.