Skip to content

0.9#125

Open
mexirica wants to merge 6 commits into
mainfrom
develop
Open

0.9#125
mexirica wants to merge 6 commits into
mainfrom
develop

Conversation

@mexirica

@mexirica mexirica commented May 26, 2026

Copy link
Copy Markdown
Owner

Greptile Summary

This PR adds repository origin filtering to aptui 0.9, including a new repo:/origin: filter token, an origin dropdown overlay (o key), origin tracking extracted from APT list filenames, version-specific apt-cache show calls, and Essential-flag propagation into the detail panel.

  • New keypress_repo_filter.go and repolist.go implement the repo-origin dropdown; originFromListFilename derives human-readable origins from /var/lib/apt/lists/ filenames and merges them into PackageInfo.Origins.
  • ShowPackage now passes name=version to apt-cache show so the detail panel reflects the exact selected version; ListVersions gains LANG=C for reliable output parsing.
  • Package list badges for Essential and ManuallyInstalled are removed from the list rows (kept in the detail panel); the pinned ★ badge is retained.

Confidence Score: 4/5

Safe to merge after fixing the two mouse-blocking and scroll-offset issues; the core origin-filtering logic is correct.

Mouse events are not blocked while the repo-filter overlay is active: scroll wheel events scroll the underlying package list and clicks can change selection or switch tabs while the dropdown is displayed. Separately, reopening the dropdown when a repo: filter is already active restores the cursor index but not the scroll offset, so the highlighted row is invisible if the matching origin is not on the first page.

internal/app/update.go (mouse-event guard) and internal/app/keypress_repo_filter.go (initial scroll adjustment in openRepoFilter)

Reviews (2): Last reviewed commit: "build(deps): bump charm.land/bubbletea/v..." | Re-trigger Greptile

mexirica and others added 5 commits May 13, 2026 11:00
…#118)

* Feat: implement inSearchBox function and enhance mouse click handling in search mode

* Refactor onMouseClick to streamline search handling and remove redundant comments
* Feat: enhance package detail display with version support and improve detail filtering

* Feat: update ShowPackage function to accept a single version string parameter
* Feat: enhance package detail display to include repository origins

* Feat: enhance repository origin handling and deduplicate entries in formatPolicyOrigins

* Feat: implement repository origin filter and enhance search functionality

* Feat: enhance enrichedDetailInfo to display package origins

* Feat: enhance query tokenization and improve repository origin handling

* Feat: enhance search result handling with origin filtering and display

* Feat: enhance query tokenization to support single and double quotes for filtering
* Feat: improve markers visibility by adding essential status and updating package list display

* Refactor: remove TestRenderPackageListEssentialBadge test case

* Feat: enhance enrichedDetailInfo function to filter out both Status and Essential lines from apt-cache output

* Feat: enhance enrichedDetailInfo function to derive essential state from apt-cache output

* Feat: add manually installed status to search result packages

* Feat: add essential status to search results in onSearchResultLoaded function

* Feat: propagate essential status in onPackageDetailLoaded and add corresponding test
@mexirica mexirica marked this pull request as ready for review May 26, 2026 12:08
@mexirica mexirica changed the title Merge from Dev 0.9 May 26, 2026
Comment thread internal/app/update.go
Comment thread internal/apt/client.go
Comment thread internal/app/update.go
Comment on lines +406 to 411
// Preserve Origins loaded from bulk package files; ParseShowEntry
// has no access to the apt lists so it always returns an empty slice.
if existing, ok := a.infoCache[msg.name]; ok && len(existing.Origins) > 0 {
pi.Origins = existing.Origins
}
a.infoCache[msg.name] = pi

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.

P1 Cache includes version Details are now loaded with apt-cache show name=version, but the cache is still keyed only by package name. Selecting a specific installed or older version can overwrite infoCache[name] with that version's metadata, and later search/list enrichment uses it for the package regardless of which version is being displayed. Packages with multiple available versions can then show or filter with stale section, size, version, or origin data.

Comment on lines +213 to +234
func replaceRepoToken(q string, repo string) string {
var quoted string
if strings.ContainsRune(repo, ' ') {
quoted = `repo:"` + repo + `"`
} else {
quoted = "repo:" + repo
}

tokens := splitQueryTokens(q)
found := false
for i, t := range tokens {
lower := strings.ToLower(t)
if strings.HasPrefix(lower, "repo:") || strings.HasPrefix(lower, "origin:") {
tokens[i] = quoted
found = true
break
}
}
if !found {
tokens = append(tokens, quoted)
}
return strings.Join(tokens, " ")

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.

P2 Escape repo values replaceRepoToken wraps origins containing spaces in quotes but does not escape quotes in the origin value. The filter tokenizer treats quotes as delimiters and has no escape handling, so a custom/local repository origin containing " is split into a truncated repo: value plus extra free text. Selecting that origin from the dropdown will produce incorrect or empty results.

Comment thread internal/app/keypress_mouse.go
Bumps [charm.land/bubbletea/v2](https://github.com/charmbracelet/bubbletea) from 2.0.6 to 2.0.7.
- [Release notes](https://github.com/charmbracelet/bubbletea/releases)
- [Commits](charmbracelet/bubbletea@v2.0.6...v2.0.7)

---
updated-dependencies:
- dependency-name: charm.land/bubbletea/v2
  dependency-version: 2.0.7
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
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.

1 participant