Remove isAppContext gates on file upload/download capabilities
❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.
Overview
Several file upload/download/print UI affordances are gated behind isAppContext, hiding them in our installed apps. This was originally a workaround for the assumption that the app couldn't handle file downloads. The Windows and Mac apps already handle this natively, and the work to add it to the Android WebView layer is tracked in kolibri-installer-android#267 and is trivial. The gates can be removed.
Complexity: Low Target branch: develop
Context
isAppContext is sourced from useUser() (packages/kolibri/composables/useUser.js), which reads sessionState.value.app_context. The value is set server-side in kolibri/core/auth/api.py based on valid_app_key_on_request. None of that needs to change.
The places that gate file upload/download/print UI behind isAppContext:
-
Content "Save to Device" button —
packages/kolibri/components/DownloadButton.vue:74return !this.isAppContext && this.downloadableFiles.length; -
Coach report CSV export —
kolibri/plugins/coach/frontend/views/common/ReportsControls.vue:87-89exportDisabled() { // Always disable in app mode until we add the ability to download files. return this.isAppContext || this.disableExport; } -
Facility data CSV import/export + session/summary log downloads —
kolibri/plugins/facility/frontend/views/DataPage/index.vue:262-263canUploadDownloadFiles() { return !this.isAppContext; }This gates the entire
ImportInterfaceblock and the session/summary log download buttons viav-ifin the template. -
"Print all passwords" button —
packages/kolibri-common/components/AllPasswordsPage.vue:25<KGridItem v-if="!isAppContext" ... class="header-row print-button"> <KButton :text="printAction$()" :disabled="!hasPicturePasswords" @click="openPrintDialog" /> </KGridItem>isAppContextalso drives the title row's grid span (lines 17-19), which currently expands to full width when the print button is hidden. This shared component renders on both the coach and facility "All passwords" pages (CoachAllPasswordsPage.vue,FacilityAllPasswordsPage.vue), so removing the gate fixes both.
The Change
Remove the isAppContext checks listed in Context so that file upload, download, and print affordances are visible to users regardless of context.
DownloadButton.vue— drop the!this.isAppContextclause from the visibility computation.ReportsControls.vue— dropthis.isAppContextfromexportDisabledand remove the now-stale comment.DataPage/index.vue— remove thecanUploadDownloadFilescomputed and itsv-ifgates on the import interface and log download sections.AllPasswordsPage.vue— drop thev-if="!isAppContext"on the print button and remove theisAppContextternary from the title row's grid span so it always uses the two-column layout (span 6/4/2).
Out of Scope
useUser.jsand the backendapp_contextplumbing- The
allowOtherBrowsersToConnectcheckbox inDeviceSettingsPage(correctly app-only) - The
BottomAppBarvs inline-save-row layout swaps inDeviceSettingsPageandFacilityConfigPage(layout, not capability — Android needs the inline variant) ShareFileView/FromAppContextPermission(kolibri/core/content/api.py:2043-2063) — the inverse gate (share-out only in-app) is correct- Any WebView-layer work in
kolibri-installer-android— tracked separately
Acceptance Criteria
General
- [ ]
DownloadButton.vuevisibility computation does not referenceisAppContext; the "Save to Device" button renders in app context whenever there are downloadable files. - [ ]
ReportsControls.vueexportDisableddoes not referenceisAppContextand the obsolete comment is removed; the CSV export control is enabled in app context (subject only todisableExport). - [ ]
DataPage/index.vueno longer has acanUploadDownloadFilescomputed; the import interface and session/summary log download sections render in app context. - [ ]
AllPasswordsPage.vueprint button renders in app context, and the title row uses the two-column layout in both contexts. - [ ] Imports, computed properties, and local refs left unused after removal are deleted (e.g.
useUserwhereisAppContextwas its only consumer). - [ ] Behaviour in non-app context is unchanged: the same affordances render and function as before.
Testing
- [ ] Existing Jest tests for the affected components continue to pass.
- [ ] Any tests that specifically assert the
isAppContextblocking behaviour are removed. - [ ] Manual verification in a regular browser confirms the affordances render and function as before. (Verifying the affordances actually work end-to-end in the Android app is out of scope and depends on kolibri-installer-android#267.)
AI usage
I used Claude to inventory every isAppContext gate in the codebase and to draft this issue iteratively. I verified the cross-repo reference to kolibri-installer-android#267 myself.
Plan: Remove the isAppContext checks that hide file upload/download/print affordances in installed-app contexts, so those affordances render regardless of context.
- [ ]
DownloadButton.vue— "Save to device" button - [ ]
ReportsControls.vue— coach report CSV export - [ ]
DataPage/index.vue— facility CSV import/export + log downloads - [ ]
AllPasswordsPage.vue— "Print all passwords" button + title layout
@rtibblesbot's comments are generated by an LLM, and should be evaluated accordingly
How was this generated?
- Implemented code following the pre-approved plan using test-driven development (red-green-refactor)
- Ran the project's full test suite and linter before committing
- For UI changes: captured live screenshots to verify rendering
- For backend changes: verified with example API/CLI output
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.
The bot has been waiting for a response for 2 hour(s). It will resume automatically when someone replies.