Skip to content

feat: add persistent history log and TUI History tab#128

Merged
pie-314 merged 8 commits into
pie-314:devfrom
riyapetle:RiyaCommits3
Jun 8, 2026
Merged

feat: add persistent history log and TUI History tab#128
pie-314 merged 8 commits into
pie-314:devfrom
riyapetle:RiyaCommits3

Conversation

@riyapetle

Copy link
Copy Markdown

Resolves #58

📝 Details

This PR introduces a persistent history log and a new History tab in the TUI, allowing users to easily track what packages were installed or removed over time.

  • Persistent Logging (src/history.rs): Securely tracks and writes install and remove events to ~/.local/state/trx/history.log (or respects $XDG_STATE_HOME if set).
  • Structured Timestamps: Integrated the chrono dependency to utilize precise UTC ISO8601 timestamps.
  • TUI History Tab (src/ui/app.rs & src/ui/draw.rs):
    • Added a dedicated History tab cleanly integrated into the navigation cycle.
    • Renders a backwards-chronological log (newest events appear at the top).
    • Handles missing log files gracefully with a helpful fallback message.
    • Fully scrollable using standard navigational keys (k/j, Up/Down, Home/End).
    • Implemented dynamic color-coding (Success green for INSTALL, Error red for REMOVE).

📸 Screenshots

Screenshot (401) Screenshot (403) Screenshot (405)

🔄 Reproducibility

To test this feature locally:

  1. Switch to this branch and run cargo run.
  2. Navigate to the History tab to observe the empty state fallback.
  3. Install a package via the Search tab.
  4. Remove a package via the Installed tab.
  5. Navigate back to the History tab to verify that both events were logged correctly, color-coded, and are scrollable.

@vercel

vercel Bot commented Jun 8, 2026

Copy link
Copy Markdown

@riyapetle is attempting to deploy a commit to the pie's projects Team on Vercel.

A member of the Team first needs to authorize it.

@riyapetle

Copy link
Copy Markdown
Author

Hi @pie-314! 👋

I have successfully submitted the Pull Request implementing the persistent transaction history tab as requested.

The new History tab securely tracks all install and remove commands with structured timestamps, color-codes the events, and handles empty/missing log environments gracefully.

I have attached all the requested screenshots, reproducibility steps, and implementation details directly in the PR description. Let me know if any adjustments or changes are needed during your review!

@pie-314

pie-314 commented Jun 8, 2026

Copy link
Copy Markdown
Owner

@riyapetle you have to raise pr in dev branch

@riyapetle riyapetle changed the base branch from main to dev June 8, 2026 11:50
@riyapetle

Copy link
Copy Markdown
Author

@pie-314 I have just updated the base branch of this Pull Request to point to dev as requested

@pie-314 pie-314 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM

@pie-314 pie-314 merged commit 971b281 into pie-314:dev Jun 8, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[UI] Persistent Transaction History Tab

2 participants