Skip to content

🎨 Palette: Keyboard Accessibility and Smart Filename Extraction - #10

Merged
SayanthRock merged 1 commit into
mainfrom
palette/keyboard-ux-improvements-5395884347639882127
Aug 10, 2026
Merged

🎨 Palette: Keyboard Accessibility and Smart Filename Extraction#10
SayanthRock merged 1 commit into
mainfrom
palette/keyboard-ux-improvements-5395884347639882127

Conversation

@SayanthRock

@SayanthRock SayanthRock commented Aug 9, 2026

Copy link
Copy Markdown
Owner

User description

🎨 Palette: Keyboard Accessibility and Smart Filename Extraction

💡 What:

  1. Seamless Keyboard Transitions: Added standard ImeAction options (ImeAction.Next, ImeAction.Done, ImeAction.Search) and matching KeyboardActions across the input forms on CodeAnalyzerScreen (in MainActivity.kt) and ReviewScreen (in ReviewScreen.kt).
  2. One-Tap Submissions: Pressing search or done on the system soft-keyboard now directly executes the corresponding action (saves the GitHub token, runs code analysis, or runs the PR review).
  3. Smart URL Auto-Extraction: When pasting a raw/blob GitHub URL into the URL field in CodeAnalyzerScreen, the app automatically parses and populates the File name field, saving manual typing or copy-pasting.

🎯 Why:

  • Standard forms without IME action mapping require multiple screen taps to shift focus or submit the form, creating friction and accessibility issues for screen reader users.
  • Automatically extracting the file name from a pasted URL reduces cognitive load and redundant user actions, streamlining the overall experience.

♿ Accessibility:

  • Enhances keyboard ergonomics, support for screen readers, and single-hand usability.

PR created automatically by Jules for task 5395884347639882127 started by @SayanthRock


CodeAnt-AI Description

Streamline keyboard-based code analysis and PR review

What Changed

  • Keyboard Next actions move through owner, repository, and file fields without requiring extra taps
  • Pressing Search on a file URL or pull request number starts analysis or review when the required input is present
  • Pressing Done while entering a GitHub token saves it securely when it is not empty
  • GitHub file URLs automatically fill the file name, including URLs with query parameters or fragments

Impact

✅ Fewer taps to submit forms
✅ Faster code analysis and PR reviews
✅ Less manual file-name entry

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features

    • Added keyboard action support for faster form completion and submission.
    • Pressing Done saves a valid, nonblank GitHub token.
    • Pressing Search analyzes valid file URLs and starts pull-request reviews.
    • File names now update automatically from entered file URLs.
    • Improved keyboard navigation between repository and pull-request fields.
  • Accessibility

    • Added context-appropriate keyboard types and actions for form inputs.

Add proper ImeActions and matching KeyboardActions across the main screens.
Implement auto-extraction of raw/blob GitHub filenames to simplify inputs.

Co-authored-by: SayanthRock <202829406+SayanthRock@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copilot AI lite review requested due to automatic review settings August 9, 2026 23:49
@devloai

devloai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

@performance-testing-bot

Copy link
Copy Markdown

Unable to locate .performanceTestingBot config file

@codeant-ai

codeant-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 7b8b17d Aug 09, 2026 · 23:49 23:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codeant-ai

codeant-ai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@ai-coding-guardrails

Copy link
Copy Markdown

You've hit your review limit for the week, but don't worry you'll get some more next week!

Contact us at hello@zenable.io if you want this rate limit to go away

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

IME-driven form actions

Layer / File(s) Summary
Token submission handling
.Jules/palette.md, app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt
The token field uses the Done action to save nonblank tokens and show confirmation. The palette journal records the keyboard-action configuration.
File input actions
app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt
The file-name field uses Next. The file-URL field derives a filename from the cleaned final path segment and starts analysis through Search when valid and idle.
Review form actions
app/src/main/java/com/sayanthrock/freeairock/ui/ReviewScreen.kt
Owner and repository fields use Next. The pull-request field uses a numeric Search action and runs the review only for nonblank input when analysis is idle.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: size:M

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: keyboard accessibility improvements and smart GitHub filename extraction.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/keyboard-ux-improvements-5395884347639882127

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:M This PR changes 30-99 lines, ignoring generated files label Aug 9, 2026
Comment on lines +266 to +276
onValueChange = { url ->
fileUrl = url
if (url.isNotBlank()) {
val cleanUrl = url.substringBefore("?").substringBefore("#")
val parts = cleanUrl.split('/')
val lastPart = parts.lastOrNull()
if (!lastPart.isNullOrBlank() && lastPart.contains('.')) {
fileName = lastPart
}
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Every nonblank URL edit overwrites fileName whenever the final URL segment contains a dot. If a user enters or pastes a URL and then intentionally changes the filename, any subsequent URL edit silently discards that custom value, and the overwritten name is passed to analyzeCode. Restrict auto-extraction to an untouched/default filename or otherwise preserve an explicitly edited filename. [logic error]

Severity Level: Major ⚠️
- ⚠️ Manual filename choices are lost during URL edits.
- ❌ Code analysis can target the wrong filename.
- ⚠️ Search submission passes the silently replaced value.

Fix in Cursor Fix in VSCode Claude

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt
**Line:** 266:276
**Comment:**
	*Logic Error: Every nonblank URL edit overwrites `fileName` whenever the final URL segment contains a dot. If a user enters or pastes a URL and then intentionally changes the filename, any subsequent URL edit silently discards that custom value, and the overwritten name is passed to `analyzeCode`. Restrict auto-extraction to an untouched/default filename or otherwise preserve an explicitly edited filename.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt`:
- Around line 266-276: Update the URL onValueChange handler to derive fileName
from any non-empty final URL segment, including extensionless GitHub filenames
such as LICENSE, README, and Dockerfile; remove the dot requirement. Reset
fileName when the URL is blank or ends with a slash, and preserve the existing
behavior for recognized raw/blob file URLs only.
- Around line 211-218: Update the KeyboardActions.onDone callback in the token
input to invoke defaultKeyboardAction(ImeAction.Done) after the existing save
logic, preserving token validation and confirmation behavior while restoring the
default keyboard dismissal.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d31061b0-bee3-4bbe-9a5a-a2d3aa5189cb

📥 Commits

Reviewing files that changed from the base of the PR and between 0d75e00 and 7b8b17d.

📒 Files selected for processing (3)
  • .Jules/palette.md
  • app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt
  • app/src/main/java/com/sayanthrock/freeairock/ui/ReviewScreen.kt

Comment on lines +211 to +218
keyboardActions = KeyboardActions(
onDone = {
if (githubToken.isNotBlank()) {
onSave(githubToken)
savedMessage = "Saved securely on this device"
}
}
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n \
  '2024\.06\.00|compose-bom|androidx\.compose|KeyboardActionScope|defaultKeyboardAction' \
  --glob 'build.gradle*' \
  --glob 'settings.gradle*' \
  --glob 'libs.versions.toml' \
  --glob 'gradle.properties' \
  --glob '*.kt' . || true

Repository: SayanthRock/FREE-AI-ROCK-

Length of output: 20047


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== MainActivity import and keyboard section =="
sed -n '1,50p;160,235p' app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt | cat -n

echo
echo "== KeyboardActions usages =="
rg -n "KeyboardActions|defaultKeyboardAction|LocalSoftwareKeyboardController|dismiss|ImeAction" app/src/main/java -S || true

Repository: SayanthRock/FREE-AI-ROCK-

Length of output: 7683


🌐 Web query:

Android Jetpack Compose KeyboardActions defaultKeyboardAction ImeAction Done source documentation

💡 Result:

In Jetpack Compose, defaultKeyboardAction is a function provided within the KeyboardActionScope interface [1]. It is designed to trigger the system's default behavior associated with a specific ImeAction [1]. When you invoke defaultKeyboardAction(ImeAction.Done), it executes the standard implementation for the "Done" action, which is to close the software keyboard [2]. Key technical details include: - KeyboardActionScope: This interface provides the context for executing custom keyboard actions [1]. Within its scope, you can call defaultKeyboardAction(imeAction) to trigger the default behavior for any given ImeAction [1]. - ImeAction.Done: This constant represents the "Done" action, signaling that the user has finished providing input to a field or a group of fields [3]. When used with defaultKeyboardAction, it specifically invokes the platform-level implementation that hides the software keyboard [2]. - Default Behavior: If you provide a custom lambda for an action (e.g., onDone in KeyboardActions), the default behavior is overridden [4]. To execute the default behavior while still performing custom logic, you can manually call defaultKeyboardAction(ImeAction.Done) inside your custom callback [1]. This mechanism ensures that developers can maintain standard platform expectations—such as keyboard dismissal upon completion—while still having the flexibility to implement custom application-specific logic [4][5].

Citations:


Restore the default Done action after saving the token.

KeyboardActions.onDone overrides the default IME action. The custom callback saves the token but does not hide the keyboard, so the confirmation text can remain covered by the software keyboard. Run defaultKeyboardAction(ImeAction.Done) after saving to keep the normal Done behavior.

Proposed fix
                         if (githubToken.isNotBlank()) {
                             onSave(githubToken)
                             savedMessage = "Saved securely on this device"
+                            defaultKeyboardAction(ImeAction.Done)
                         }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
keyboardActions = KeyboardActions(
onDone = {
if (githubToken.isNotBlank()) {
onSave(githubToken)
savedMessage = "Saved securely on this device"
}
}
)
keyboardActions = KeyboardActions(
onDone = {
if (githubToken.isNotBlank()) {
onSave(githubToken)
savedMessage = "Saved securely on this device"
defaultKeyboardAction(ImeAction.Done)
}
}
)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt` around lines
211 - 218, Update the KeyboardActions.onDone callback in the token input to
invoke defaultKeyboardAction(ImeAction.Done) after the existing save logic,
preserving token validation and confirmation behavior while restoring the
default keyboard dismissal.

Comment on lines +266 to +276
onValueChange = { url ->
fileUrl = url
if (url.isNotBlank()) {
val cleanUrl = url.substringBefore("?").substringBefore("#")
val parts = cleanUrl.split('/')
val lastPart = parts.lastOrNull()
if (!lastPart.isNullOrBlank() && lastPart.contains('.')) {
fileName = lastPart
}
}
},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Extract names for extensionless GitHub files.

The lastPart.contains('.') check excludes valid files such as LICENSE, README, and Dockerfile. For these URLs, fileName remains MainActivity.kt or a previous value, so onAnalyze(fileName, fileUrl) receives the wrong filename. A URL that is cleared or ends with / can also leave the previous filename in place. Parse a non-empty final segment for recognized raw/blob file URLs and reset the derived name when no filename exists.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/src/main/java/com/sayanthrock/freeairock/MainActivity.kt` around lines
266 - 276, Update the URL onValueChange handler to derive fileName from any
non-empty final URL segment, including extensionless GitHub filenames such as
LICENSE, README, and Dockerfile; remove the dot requirement. Reset fileName when
the URL is blank or ends with a slash, and preserve the existing behavior for
recognized raw/blob file URLs only.

@SayanthRock
SayanthRock merged commit 851f147 into main Aug 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants