Skip to content

ADFA-934: Build output timestamp - #1586

Merged
dara-abijo-adfa merged 29 commits into
stagefrom
ADFA-934-build-output-timestamp
Aug 7, 2026
Merged

ADFA-934: Build output timestamp#1586
dara-abijo-adfa merged 29 commits into
stagefrom
ADFA-934-build-output-timestamp

Conversation

@dara-abijo-adfa

Copy link
Copy Markdown
Contributor

Add time stamps, time deltas, and line numbers to the Build Output

@claudeclaudeBot 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.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai

coderabbitaiBot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough
  • Added line numbers, timestamps, and time deltas to Build Output.
  • Added persistent preferences and view options for these display settings.
  • Added filtering that respects timestamp and delta visibility.
  • Added elapsed-time prefixes to streamed build output.
  • Added output view options to the editor bottom sheet.
  • Added localized labels, accessibility text, tooltip metadata, and the tuning icon.
  • Added tests for filtering, formatting, prefix handling, and newline preservation.
  • Risk: flushToEditor() can append output twice on the immediate layout-complete path.
  • Risk: Session and editor generation handling adds asynchronous state complexity. Verify clear, filter, and replacement flows carefully.

Walkthrough

Build output now supports persisted line-number, timestamp, and delta visibility controls. Streamed lines receive timing prefixes. Filtering and editor updates use the active display settings and generation guards. The editor bottom sheet exposes the new view-options popup.

Changes

Build output display contract

Layer / File(s)Summary
Display formatting and filtering contract
preferences/.../EditorPreferences.kt, app/src/main/java/com/itsaky/androidide/viewmodel/BuildOutputViewModel.kt, app/src/test/.../BuildOutputFilterTest.kt
Adds persisted display preferences, timing-prefix formatting, toggle-aware filtering, and tests for prefix removal, matching, and newline handling.
Timed build output formatting
app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt
Resets build timers and prefixes non-blank output lines with timestamps and elapsed deltas.
Fragment rendering and generation safety
app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt, app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt
Applies display settings during restoration and live rendering, updates line-number gutter state, clears queued logs, and guards session and editor updates with generation counters.
View-options popup and bottom-sheet integration
app/src/main/java/com/itsaky/androidide/fragments/output/ViewOptionsOutputFragment.kt, app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt, app/src/main/res/layout/layout_editor_bottom_sheet.xml, resources/src/main/res/drawable/ic_tune.xml, resources/src/main/res/values/strings.xml, idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt
Adds the view-options contract, popup action wiring, scrollable output actions, and supporting resources.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested reviewers:jomen-adfa, itsaky-adfa, hal-eisen-adfa

Poem

I twitch my nose at logs anew,
With timestamps bright and deltas too.
Line numbers hop into their place,
Stale writes vanish without a trace.
A tune popup helps me choose—
Hop, hop, the output views now ooze!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check nameStatusExplanation
Title check✅ PassedThe title identifies the Build Output timestamp change, which is a real part of the broader change.
Description check✅ PassedThe description directly matches the changes that add timestamps, time deltas, and line numbers to Build Output.
Docstring Coverage✅ PassedNo functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check✅ PassedCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes check✅ PassedCheck 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 ADFA-934-build-output-timestamp

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.

@coderabbitaicoderabbitaiBot left a comment

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.

Actionable comments posted: 4

🧹 Nitpick comments (2)
app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt (1)

183-197: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider adding unit test coverage for the new timing/formatting logic.

formatOutput contains non-trivial timing math (total/step deltas, blank-line/trailing-newline preservation) but no accompanying test file was included in this PR. As per coding guidelines, new/changed non-UI logic should target at least 50% line and branch coverage.

Based on learnings and coding guidelines: "Use unit tests for non-UI logic, cover error and edge paths, and target at least 50% line and branch coverage for new or changed non-UI code." Want me to draft a JUnit test class for formatOutput/resetBuildTimers?

🤖 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/itsaky/androidide/handlers/EditorBuildEventListener.kt`
around lines 183 - 197, Add unit tests for the non-UI formatting logic in
formatOutput and timer behavior in resetBuildTimers. Cover total and step timing
prefixes, multi-line output, blank lines, inputs with and without trailing
newlines, and timer reset behavior, targeting at least 50% line and branch
coverage.

Source: Coding guidelines

app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt (1)

69-92: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider wiring long-press tooltip help for the new toggle chips.

The three new chips (line numbers, timestamps, deltas) are new interactive elements with no evident long-press help wiring (e.g. via the TooltipTag-based mechanism used elsewhere, such as editor?.tag = TooltipTag.PROJECT_BUILD_OUTPUT in BuildOutputFragment.kt).

Based on coding guidelines: "New interactive elements and screens must provide long-press contextual help through idetooltips and the three-tier tooltip system." Please confirm whether an existing mechanism (not shown in this diff) already covers these chips, or whether tooltip tagging should be added here.

🤖 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/itsaky/androidide/fragments/output/LogFilterBarController.kt`
around lines 69 - 92, Verify whether chipLineNumbers, chipTimestamps, and
chipDeltas already receive long-press help through an existing tooltip
mechanism; if not, add the appropriate TooltipTag-based three-tier tooltip
wiring for each chip in the controller’s setup flow, using distinct contextual
tags and preserving the existing visibility, checked-state, and listener
behavior.

Source: Coding guidelines

🤖 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/itsaky/androidide/fragments/output/BuildOutputFragment.kt`:
- Around line 88-99: Separate the generation used for session-file persistence
from editorContentGeneration. Add a persistence generation that is incremented
only by clearOutput(), capture and propagate both generations through
processLogs and flushToEditor, and use the persistence generation to gate
buildOutputViewModel.append(text) while retaining editorContentGeneration for
visible appendBatch calls. Ensure filter and display-toggle re-renders cannot
discard drained output.
In
`@app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt`:
- Around line 79-104: Update prepareBuild and onProgressEvent to capture the
result of checkActivity(...) in a local activity instance and return when it is
null, then use that captured instance throughout each method instead of
re-reading the throwing activity accessor. Preserve the existing build-status,
timer, output, and progress behavior while eliminating the
time-of-check/time-of-use race.
- Around line 45-46: Update build elapsed-time tracking in
EditorBuildEventListener to use SystemClock.elapsedRealtime() for
buildStartTimeMs, lastOutputTimeMs, and all totalDeltaMs/stepDeltaMs
calculations, including the referenced later sections. Preserve
System.currentTimeMillis()/Instant only for displayed wall-clock timestamps,
ensuring duration values remain monotonic and non-negative.
In `@app/src/main/java/com/itsaky/androidide/viewmodel/BuildOutputViewModel.kt`:
- Around line 202-227: Update PREFIX_TIME_FORMAT used by formatLinePrefix to
apply an explicit ASCII DecimalStyle, ensuring the [HH:mm:ss.SSS] timestamp
always emits ASCII digits regardless of the device locale. Do not rely solely on
Locale.US; preserve the existing timestamp pattern and formatting behavior.
---
Nitpick comments:
In
`@app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt`:
- Around line 69-92: Verify whether chipLineNumbers, chipTimestamps, and
chipDeltas already receive long-press help through an existing tooltip
mechanism; if not, add the appropriate TooltipTag-based three-tier tooltip
wiring for each chip in the controller’s setup flow, using distinct contextual
tags and preserving the existing visibility, checked-state, and listener
behavior.
In
`@app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt`:
- Around line 183-197: Add unit tests for the non-UI formatting logic in
formatOutput and timer behavior in resetBuildTimers. Cover total and step timing
prefixes, multi-line output, blank lines, inputs with and without trailing
newlines, and timer reset behavior, targeting at least 50% line and branch
coverage.
🪄 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 Plus

Run ID: d78f0844-2eb6-4697-a35e-eed2f14c5974

📥 Commits

Reviewing files that changed from the base of the PR and between 60a9b77 and 3dc82ea.

📒 Files selected for processing (7)
  • app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt
  • app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt
  • app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt
  • app/src/main/java/com/itsaky/androidide/viewmodel/BuildOutputViewModel.kt
  • app/src/main/res/layout/layout_log_filter_bar.xml
  • app/src/test/java/com/itsaky/androidide/viewmodel/BuildOutputFilterTest.kt
  • resources/src/main/res/values/strings.xml

@coderabbitaicoderabbitaiBot left a comment

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.

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/viewmodel/BuildOutputViewModel.kt (1)

249-251: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove the complete trailing line separator before splitting.

lineSequence() treats CRLF as one separator, but filterLines() only strips a final \n. When content ends with \r\n, no separator remains to trigger the existing blank-line drop, so filterLines() can append an extra blank line for that line ending. Strip \r\n before stripping isolated \n or \r, and add a CRLF regression test.

🤖 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/itsaky/androidide/viewmodel/BuildOutputViewModel.kt`
around lines 249 - 251, Update the body preparation near `filterLines()` to
remove one complete trailing CRLF separator before handling isolated trailing
`\n` or `\r`, preserving the existing blank-line behavior for newline-terminated
content. Add a regression test covering CRLF-terminated input and verifying that
`filterLines()` does not append an extra blank line.
🤖 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.
Outside diff comments:
In `@app/src/main/java/com/itsaky/androidide/viewmodel/BuildOutputViewModel.kt`:
- Around line 249-251: Update the body preparation near `filterLines()` to
remove one complete trailing CRLF separator before handling isolated trailing
`\n` or `\r`, preserving the existing blank-line behavior for newline-terminated
content. Add a regression test covering CRLF-terminated input and verifying that
`filterLines()` does not append an extra blank line.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6bbaad46-d8b5-4303-a44e-e821f4a61c9d

📥 Commits

Reviewing files that changed from the base of the PR and between 895601e and 8e499ff.

📒 Files selected for processing (6)
  • app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt
  • app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt
  • app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt
  • app/src/main/java/com/itsaky/androidide/viewmodel/BuildOutputViewModel.kt
  • app/src/test/java/com/itsaky/androidide/viewmodel/BuildOutputFilterTest.kt
  • resources/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (5)
  • resources/src/main/res/values/strings.xml
  • app/src/main/java/com/itsaky/androidide/handlers/EditorBuildEventListener.kt
  • app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt
  • app/src/test/java/com/itsaky/androidide/viewmodel/BuildOutputFilterTest.kt
  • app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt

@coderabbitaicoderabbitaiBot left a comment

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.

Actionable comments posted: 1

🤖 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/res/drawable/ic_tune.xml`:
- Around line 1-11: Move the drawable resource represented by ic_tune.xml from
the app module into the resources module’s drawable directory, then remove the
original app-module copy. Preserve the vector contents and resource name so
existing consumers continue resolving it through the resources module.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 579ef83a-41df-4837-860e-dfbd8739fcfe

📥 Commits

Reviewing files that changed from the base of the PR and between 8e499ff and 48f4aca.

📒 Files selected for processing (8)
  • app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt
  • app/src/main/java/com/itsaky/androidide/fragments/output/LogFilterBarController.kt
  • app/src/main/java/com/itsaky/androidide/fragments/output/ViewOptionsOutputFragment.kt
  • app/src/main/java/com/itsaky/androidide/ui/EditorBottomSheet.kt
  • app/src/main/res/drawable/ic_tune.xml
  • app/src/main/res/layout/layout_editor_bottom_sheet.xml
  • idetooltips/src/main/java/com/itsaky/androidide/idetooltips/TooltipTag.kt
  • resources/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (2)
  • resources/src/main/res/values/strings.xml
  • app/src/main/java/com/itsaky/androidide/fragments/output/BuildOutputFragment.kt

Comment threadresources/src/main/res/drawable/ic_tune.xml
@dara-abijo-adfa
dara-abijo-adfaforce-pushed the ADFA-934-build-output-timestamp branch from d79d066 to a24eb9bCompareAugust 6, 2026 15:08
@dara-abijo-adfa
dara-abijo-adfa merged commit df78fea into stageAug 7, 2026
4 checks passed
@dara-abijo-adfa
dara-abijo-adfa deleted the ADFA-934-build-output-timestamp branch August 7, 2026 00:24
Sign up for freeto 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.

3 participants

@dara-abijo-adfa@jatezzz@hal-eisen-adfa