Repository navigation
feat: show install counts on system apps - #943
Conversation
Show how many people have installed each system app, with a download icon and full numbers (a dash for zero), and add a "Most installs" sort. Also give the Category and Sort by selects a padded, theme-aware chevron. Counts come from Niblet Cloud's public app-install-counts.v1 endpoint, fetched at most once a day and cached in settings so page views never make network requests. Failures keep the last good counts and retry hourly. NIBLET_CLOUD_URL='' disables the feature.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review. 📝 WalkthroughWalkthroughThe server can retrieve and cache install counts from Niblet Cloud. The add-app page displays available counts and supports sorting apps by install count. ChangesNiblet app install counts
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Server
participant NibletCloud
participant PersistentStore
participant AddAppHandler
participant AppTemplate
Server->>NibletCloud: Request install counts
NibletCloud-->>Server: Return count response
Server->>PersistentStore: Save validated counts and next sync time
AddAppHandler->>Server: Read cached counts
Server-->>AddAppHandler: Return counts for system apps
AddAppHandler->>AppTemplate: Render app metadata
AppTemplate-->>AddAppHandler: Display count when available
Merge Risk: ⚪ Minimal · up to The selected changes add localized install-count labels and template display support. No concrete merge-blocking risk was identified. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The integration is isolated from page requests, validates incoming counts, and preserves existing app-listing access controls. Its demonstrated influence is limited to displayed counts and sorting. Deployment control of the destination and coordination across servers sharing a database remain unconfirmed. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 26.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 9 files. (3 skipped: 3 unsupported.)
Comment |
Each system app card on Add App now shows how many people have installed it: a download icon and the full number (
1,234), with a dash for apps with no installs. Sort by gets a Most installs option. The Category and Sort by selects also get a padded chevron that follows the theme, replacing the native arrow that sat against the border.Where the numbers come from
Counts come from Niblet Cloud's public, unauthenticated
GET /v1/catalog/install-countsendpoint (app-install-counts.v1). It returns only{app_id: count}for community apps, which are the same Tidbyt community apps Tronbyt ships, so IDs match one-to-one. A count is the number of unique Niblet accounts that have ever installed the app. Tronbyt usage isn't counted, and nothing about this server or its users is sent.NIBLET_CLOUD_URL="". It's documented in the README.Changes
internal/server/install_counts.go: fetch, validate, cache and schedule.handlers_app.go: attaches cached counts to system apps. Custom apps never get a count.app_list_grid.html/addapp-simple.css: the count row (Heroicons arrow-down-tray, MIT), thedata-installsattribute, and the select chevron.manager.js: theinstallssort (descending, ties by name, uncounted apps last).funcmap.go:thousandsandinstallCounttemplate helpers.Number of installsandMost installs(en, de).Testing
go test ./...passes, including new tests for daily caching, restart reuse, hourly backoff, cache replacement, rejecting remote plain HTTP, number formatting, and no count on custom apps.golangci-lint run(v2) reports 0 issues.djlint@1.40.8 web/templates --profile=golang --checkis clean.Screenshots
Most installs sort with full counts:
Apps with no installs show a dash:
Summary by CodeRabbit
NIBLET_CLOUD_URLto choose the data source, or leave it empty to disable syncing; the default source ishttps://cloud.heyniblet.com.