Skip to content

feat(ADFA-3073): Show Git clone messages on banners#1201

Merged
dara-abijo-adfa merged 2 commits intostagefrom
ADFA-3073-show-git-errors-as-banners
Apr 21, 2026
Merged

feat(ADFA-3073): Show Git clone messages on banners#1201
dara-abijo-adfa merged 2 commits intostagefrom
ADFA-3073-show-git-errors-as-banners

Conversation

@dara-abijo-adfa
Copy link
Copy Markdown
Contributor

Show git clone messages on banner, instead of the status text view

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

Warning

Rate limit exceeded

@dara-abijo-adfa has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 32 minutes and 8 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 32 minutes and 8 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 70fa1fee-405c-4296-8818-563eb562231d

📥 Commits

Reviewing files that changed from the base of the PR and between 6c4807e and 956ef57.

📒 Files selected for processing (1)
  • app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt
📝 Walkthrough

Walkthrough

The PR removes the statusText TextView from the clone repository layout and refactors the fragment to use flash notification methods (flashInfo, flashError) instead of directly updating text. It tracks the last displayed status resource ID to prevent redundant notifications.

Changes

Cohort / File(s) Summary
Layout Changes
app/src/main/res/layout/fragment_clone_repository.xml
Removed statusText TextView and its constraint positioning, eliminating direct status text display from the UI.
Fragment State & Notifications
app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt
Added lastStatusResId state tracking; replaced direct statusText text assignments with conditional flashInfo() and flashError() calls based on status resource ID changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

  • ADFA-3074: Clone error handling #1064: Both PRs modify CloneRepositoryFragment's status-text handling; this PR removes the statusText view and uses flash notifications, while the related PR adds statusTextResId/isCancellable to UI state.

Suggested reviewers

  • jatezzz
  • Daniel-ADFA
  • jomen-adfa
  • itsaky-adfa

Poem

🐰 A statusText view bids farewell today,
Replaced by flashy notifications at play,
lastStatusResId remembers the way,
No duplicate messages shall come into sway!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing status text view with banner messages for git clone operations.
Description check ✅ Passed The description is directly related to the changeset, explaining the shift from displaying git clone messages in a status text view to using banners.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ADFA-3073-show-git-errors-as-banners

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 and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt (1)

184-196: ⚠️ Potential issue | 🟠 Major

Flash notifications re-fire on configuration change / lifecycle restart.

viewModel.uiState is a StateFlow, so repeatOnLifecycle(STARTED) will replay the latest cached value every time the fragment restarts (e.g., rotation, returning from background). If the terminal state is Error or Success, flashError(...) / flashInfo(R.string.clone_successful) will be shown again each time, even though the user has already seen it. The old approach of writing to a persistent TextView was idempotent; flashes are not.

For Cloning, the same issue applies since lastStatusResId is reset to null on fragment recreation — any cached Cloning state will re-flash on restart.

Consider tracking "already-flashed" terminal states (e.g., via a consumed/SingleLiveEvent-style channel, SharedFlow with no replay, or by transitioning the VM to Idle after the flash is consumed) so banners are shown exactly once per event.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt`
around lines 184 - 196, The fragment currently re-displays flashError/flashInfo
because viewModel.uiState (a StateFlow) replays terminal states on lifecycle
restart; change the flow of flash events so they're emitted once: update the
ViewModel to expose one-shot events (e.g., a SharedFlow<Unit/String with
replay=0 or a dedicated SingleLiveEvent-like channel) instead of encoding
transient flash messages in the persistent CloneRepoUiState, or add a consumed
flag on the UI state and clear/transition the VM back to Idle after emitting;
then in CloneRepositoryFragment collect that one-shot event (not the persistent
StateFlow) and call flashError/flashInfo once, and stop relying on
lastStatusResId to gate flashes so Cloning/Error/Success are only shown a single
time per event (reference symbols: viewModel.uiState,
CloneRepoUiState.Error/Success/Cloning, cloneButton, flashError, flashInfo,
lastStatusResId).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt`:
- Around line 189-191: The code in CloneRepositoryFragment builds statusMessage
from state.errorResId or state.errorMessage and then calls
flashError(statusMessage), which can pass null; update the logic to provide a
non-null fallback (e.g., getString(R.string.clone_failed) or a suitable generic
error string) when both state.errorResId and state.errorMessage are null so
flashError is never invoked with null; modify the statusMessage assignment to
check state.errorResId, state.errorMessage, and finally the fallback string
before calling flashError.

---

Outside diff comments:
In
`@app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt`:
- Around line 184-196: The fragment currently re-displays flashError/flashInfo
because viewModel.uiState (a StateFlow) replays terminal states on lifecycle
restart; change the flow of flash events so they're emitted once: update the
ViewModel to expose one-shot events (e.g., a SharedFlow<Unit/String with
replay=0 or a dedicated SingleLiveEvent-like channel) instead of encoding
transient flash messages in the persistent CloneRepoUiState, or add a consumed
flag on the UI state and clear/transition the VM back to Idle after emitting;
then in CloneRepositoryFragment collect that one-shot event (not the persistent
StateFlow) and call flashError/flashInfo once, and stop relying on
lastStatusResId to gate flashes so Cloning/Error/Success are only shown a single
time per event (reference symbols: viewModel.uiState,
CloneRepoUiState.Error/Success/Cloning, cloneButton, flashError, flashInfo,
lastStatusResId).
🪄 Autofix (Beta)

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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 01a509c3-619a-4f40-ab05-49b6a35dcef6

📥 Commits

Reviewing files that changed from the base of the PR and between 2b853ff and 6c4807e.

📒 Files selected for processing (2)
  • app/src/main/java/com/itsaky/androidide/fragments/CloneRepositoryFragment.kt
  • app/src/main/res/layout/fragment_clone_repository.xml
💤 Files with no reviewable changes (1)
  • app/src/main/res/layout/fragment_clone_repository.xml

@dara-abijo-adfa dara-abijo-adfa merged commit 1cb2e00 into stage Apr 21, 2026
2 checks passed
@dara-abijo-adfa dara-abijo-adfa deleted the ADFA-3073-show-git-errors-as-banners branch April 21, 2026 17:36
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