Compare commits

...
550 Commits
Author SHA1 Message Date
Marino Faggiana 565bbd55bf update
Signed-off-by: Marino Faggiana <[email protected]>
2026-09-09 15:36:39 +02:00
Marino Faggiana 2b697501e9 fix: use file ID for unified share list source
Signed-off-by: Marino Faggiana <[email protected]>
2026-09-09 15:01:06 +02:00
Marino Faggiana 5d790f1e05 Build 2
Signed-off-by: Marino Faggiana <[email protected]>
2026-09-09 09:51:26 +02:00
Marino Faggiana 64ecefa305 Build 1
Signed-off-by: Marino Faggiana <[email protected]>
2026-09-07 09:59:21 +02:00
Marino Faggiana ec302fd42d fix: skip legacy download limit updates when unified sharing is enabled
Update NextcloudKit and bump the marketing version to 35.0.0.

Signed-off-by: Marino Faggiana <[email protected]>
2026-09-07 08:29:11 +02:00
Marino Faggiana 12ff1d5235 pack
Signed-off-by: Marino Faggiana <[email protected]>
2026-09-05 08:26:34 +02:00
Marino Faggiana 8cf0aa1a4f Merge remote-tracking branch 'origin/master' into unified-sharing 2026-09-05 08:25:52 +02:00
Nextcloud bot 9de4faa4d6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-09-03 03:46:28 +00:00
Marino Faggiana 2e2b519ba2 resolved
Signed-off-by: Marino Faggiana <[email protected]>
2026-09-02 09:40:50 +02:00
Marino Faggiana ae87f6eb28 Merge remote-tracking branch 'origin/master' into unified-sharing 2026-09-02 09:40:27 +02:00
Nextcloud bot cea7d7f2d6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-09-02 03:47:29 +00:00
Milen Pivchev 8ff1a76cd5 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2026-09-01 20:38:59 +02:00
Milen Pivchev 52ff08c02e Merge branch 'master' of https://github.com/nextcloud/ios into unified-sharing
Signed-off-by: Milen Pivchev <[email protected]>
2026-09-01 18:07:24 +02:00
Milen Pivchev 9dc14a2588 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2026-09-01 17:19:27 +02:00
Nextcloud bot 80630cb8fa fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-09-01 03:43:13 +00:00
Milen Pivchev efc07945f3 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2026-08-31 10:58:40 +02:00
Nextcloud bot 28c5d85ea0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-30 03:44:55 +00:00
Nextcloud bot a2d3014e71 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-29 03:42:36 +00:00
Nextcloud bot 3c0ef18505 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-28 03:51:45 +00:00
Nextcloud bot 8104883d62 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-27 04:10:48 +00:00
Marino Faggiana 68e28f4d32 feat: preserve E2EE key sets during setup (#4270)
* feat: preserve E2EE key sets during setup

Archive active E2EE credentials in the Keychain before setup resets or certificate renewal, while deduplicating snapshots and preserving explicit full cleanup.

Add unit coverage for complete, duplicate, and partial key-set archives, and update resolved package versions.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: support read-only access with archived E2EE keys

Signed-off-by: Marino Faggiana <[email protected]>

* fix: reuse root metadata key for E2EE v2 child folders

Signed-off-by: Marino Faggiana <[email protected]>

* fix: enforce E2EE write access before metadata changes

Signed-off-by: Marino Faggiana <[email protected]>

* fix: handle empty users in E2EE v2 metadata

Reuse the encrypted root key only for child metadata and verify empty-user signatures with the current certificate.

Update Firebase dependencies to 12.18.0.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: enforce E2EE key set write access

Block metadata recovery and destructive operations when only archived or unavailable keys can decrypt the folder.

Allow explicit initial metadata creation for newly encrypted folders.

Signed-off-by: Marino Faggiana <[email protected]>

* test: verify E2EE archiving preserves active credentials

Pin Firebase and GoogleAppMeasurement to 12.17.0.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: handle changed E2EE server keys safely

Detect and replace stale server key sets while preserving archived keys for read-only access. Validate write operations and route encrypted media folder deletion through the E2EE flow.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: validate E2EE server keys once per active cycle

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: clarify metadata key decryption checks

Signed-off-by: Marino Faggiana <[email protected]>

* fix: require password for E2EE key deletion

Prompt for the account password before deleting E2EE keys or renewing certificates.

Update NextcloudKit to the password-parameter branch.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: allow passwordless E2EE key management

Update NextcloudKit and Firebase package revisions.

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* rename

Signed-off-by: Marino Faggiana <[email protected]>

* fix: validate E2EE keys against user certificates

Use the server public key only to authenticate certificates, and compare embedded user keys when detecting key changes.

Verify decrypted private keys match the user certificate before storing or uploading them.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: refresh plus menu when E2EE preference changes

Signed-off-by: Marino Faggiana <[email protected]>

* chore: prepare 34.2.0 release

Pin NextcloudKit to 7.5.0 and reset the build number.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: prevent sensitive E2EE data from being logged

Replace raw key and metadata output with non-sensitive E2EE diagnostics.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-26 09:46:27 +02:00
Nextcloud bot 1a60516706 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-26 04:19:48 +00:00
Milen Pivchev 11f5ee22cf fix: Arbitrary loads
Signed-off-by: Milen Pivchev <[email protected]>
2026-08-25 13:25:22 +02:00
Nextcloud bot e270ba89db fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-25 04:07:20 +00:00
Marino Faggiana 95b54c4a93 fix: bound media search and backfill requests (#4273)
* fix: limit media verification request size

Signed-off-by: Marino Faggiana <[email protected]>

* fix: resume media metadata backfill in bounded batches

Signed-off-by: Marino Faggiana <[email protected]>

* fix: increase media verification result limit

Use a fixed 1,000-item cap because Nextcloud cannot range-filter display names for same-date results.

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 1

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-24 08:04:39 +02:00
Nextcloud bot 2c118c7b7a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-24 03:27:33 +00:00
Marino Faggiana 204f9e23b1 refactor: reorganize plus menu document actions (#4271)
* refactor: reorganize plus menu document actions

Signed-off-by: Marino Faggiana <[email protected]>

* fix: use automatic sizing for context menu elements

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-23 08:37:15 +02:00
Nextcloud bot be77b87304 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-21 03:35:03 +00:00
Milen Pivchev d575173a0d WIP
Signed-off-by: Milen Pivchev <[email protected]>
2026-08-20 15:11:58 +02:00
Marino Faggiana 535993571b fix: zoom state live (#4269)
* fix: zoom state live

Signed-off-by: Marino Faggiana <[email protected]>

* fix: reset zoom state after Live Photo playback

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-20 08:46:39 +02:00
Nextcloud bot 07841f297a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-20 03:33:03 +00:00
dependabot[bot] 65143c3e51 fix(deps): Bump github.com/siteline/swiftui-introspect (#4262)
Bumps [github.com/siteline/swiftui-introspect](https://github.com/siteline/swiftui-introspect) from 1.3.0 to 26.0.1.
- [Release notes](https://github.com/siteline/swiftui-introspect/releases)
- [Commits](https://github.com/siteline/swiftui-introspect/compare/1.3.0...26986a57e31c813f98262ddb62d4b07d40008535)

---
updated-dependencies:
- dependency-name: github.com/siteline/swiftui-introspect
  dependency-version: 26.0.1
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-19 13:54:30 +02:00
dependabot[bot] 1995d9e425 fix(deps): Bump github.com/google/googleappmeasurement (#4265)
Bumps [github.com/google/googleappmeasurement](https://github.com/google/GoogleAppMeasurement) from 12.15.0 to 12.18.0.
- [Release notes](https://github.com/google/GoogleAppMeasurement/releases)
- [Commits](https://github.com/google/GoogleAppMeasurement/compare/12.15.0...f04760d460296cc0fa430935a7be212e5bd67fc5)

---
updated-dependencies:
- dependency-name: github.com/google/googleappmeasurement
  dependency-version: 12.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-19 13:54:27 +02:00
dependabot[bot] d98ed21691 fix(deps): Bump github.com/exyte/popupview from 2.10.6 to 5.0.5 (#4266)
Bumps [github.com/exyte/popupview](https://github.com/exyte/PopupView) from 2.10.6 to 5.0.5.
- [Commits](https://github.com/exyte/PopupView/compare/2.10.6...62e1698164c352e4cae074bb30eff011ef1b9af6)

---
updated-dependencies:
- dependency-name: github.com/exyte/popupview
  dependency-version: 5.0.5
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-19 13:53:50 +02:00
dependabot[bot] bbff6d2b6a fix(deps): Bump github.com/firebase/firebase-ios-sdk (#4264)
Bumps [github.com/firebase/firebase-ios-sdk](https://github.com/firebase/firebase-ios-sdk) from 12.15.0 to 12.17.0.
- [Release notes](https://github.com/firebase/firebase-ios-sdk/releases)
- [Commits](https://github.com/firebase/firebase-ios-sdk/compare/12.15.0...33a468adfdb75b53f05a37e7c886ca7c962b5c17)

---
updated-dependencies:
- dependency-name: github.com/firebase/firebase-ios-sdk
  dependency-version: 12.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-19 13:53:24 +02:00
dependabot[bot] eeb5692d4f ci: Bump actions/upload-artifact from 4 to 7 (#4261)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-19 13:51:39 +02:00
dependabot[bot] 542ce2e641 ci: Bump actions/download-artifact from 4 to 8 (#4260)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-19 13:51:22 +02:00
dependabot[bot] 0f24168711 ci: Bump maxim-lobanov/setup-xcode from 1.6.0 to 1.7.0 (#4259)
Bumps [maxim-lobanov/setup-xcode](https://github.com/maxim-lobanov/setup-xcode) from 1.6.0 to 1.7.0.
- [Release notes](https://github.com/maxim-lobanov/setup-xcode/releases)
- [Commits](https://github.com/maxim-lobanov/setup-xcode/compare/60606e260d2fc5762a71e64e74b2174e8ea3c8bd...ed7a3b1fda3918c0306d1b724322adc0b8cc0a90)

---
updated-dependencies:
- dependency-name: maxim-lobanov/setup-xcode
  dependency-version: 1.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-19 13:51:08 +02:00
dependabot[bot] 42a4bc290a ci: Bump actions/checkout from 4 to 7 (#4258)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-19 13:50:38 +02:00
Milen Pivchev 43bbc46bd7 feat: Add Dependabot (#4257)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-08-18 11:45:53 +02:00
Milen Pivchev 4c05872f2f Update AGENTS.md (#4244)
Signed-off-by: Milen Pivchev <[email protected]>
2026-08-18 11:25:37 +02:00
Nextcloud bot f48455af66 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-18 03:28:51 +00:00
Marino Faggiana 38fdc7a99e feat: load media viewer originals on demand (#4256)
* feat: load media viewer originals on demand

Defer original image and Live Photo resource downloads until required, while preserving automatic loading for GIFs, SVGs, and missing previews.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: only show media detail loading for image downloads

Signed-off-by: Marino Faggiana <[email protected]>

* fix: show media detail loading only when download starts

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-17 10:14:13 +02:00
Marino Faggiana abaf4975f8 fix: preserve zoom during Live Photo playback (#4254)
* fix: preserve zoom during Live Photo playback

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump version to 34.1.4

Reset the project build number to 0.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-17 07:52:19 +02:00
Nextcloud bot 2f2fc1015a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-17 03:26:52 +00:00
Nextcloud bot f2437c35e5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-16 03:25:26 +00:00
Nextcloud bot c830f06212 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-15 03:34:47 +00:00
Marino Faggiana e377d52077 feat: support API in direct editing (#4249)
* feat: support API in direct editing

Signed-off-by: Marino Faggiana <[email protected]>

* fix: use direct editing creator for text documents

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: migrate cached editor capabilities to Direct Editing

Signed-off-by: Marino Faggiana <[email protected]>

* fix: refresh direct editing capabilities

Fetch direct editing capabilities through the dedicated API and clear cached data when the request fails.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: distinguish direct editing from legacy rich documents

Use direct-editing capabilities for editor lookup and tighten legacy rich-document MIME type matching.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: check editor availability for OpenDocument files

Signed-off-by: Marino Faggiana <[email protected]>

* fix: report direct editing capabilities accurately

Use direct editing editor identifiers to detect supported editors and distinguish Collabora direct editing from legacy rich documents.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: migrate rich workspace to direct editing API

Rename rich workspace operations and use direct editing creators for file creation and opening.

Handle missing editor URLs as invalid data instead of force-unwrapping them.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: rename rich workspace coordinator

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: rename rich document viewer to Collabora

Update the richdocuments asset URL API and track the NextcloudKit editors branch.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: exclude Collabora viewer from main navigation handling

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: unify document editor routing

Route supported editors through the Direct Editing API while preserving legacy Richdocuments fallback for Collabora.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: split direct editing and richdocuments creation

Prefer Direct Editing creators for Collabora and fall back to the legacy Richdocuments API when needed.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: group document creation actions by office editor

Use advertised editor names, refresh cached menus when editors change, and match Collabora creators by template identifier.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: scope automatic editor ordering to coordinator

Use the shared EuroOffice identifier when building the context menu.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: expand Collabora mobile editing support

Add diagram creation and handle RichDocuments commands for image insertion, downloads, printing, renaming, and hyperlinks.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: improve Collabora creation and viewer lifecycle

Validate editor URLs and legacy templates before opening created files.
Handle Collabora focus, close events, loading failures, and menu sizing.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: use automatic size for crowded editor menus

Signed-off-by: Marino Faggiana <[email protected]>

* fix: correct ordering of large office menus

Signed-off-by: Marino Faggiana <[email protected]>

* fix: avoid legacy Collabora fallback with direct editing

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: centralize document editor support

Signed-off-by: Marino Faggiana <[email protected]>

* chore: pin NextcloudKit 7.4.3 and bump build version

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-14 18:22:52 +02:00
Marino Faggiana 8121c9e6e6 fix: preserve image zoom (#4252)
* fix: preserve image zoom when changing media

Signed-off-by: Marino Faggiana <[email protected]>

* fix: preserve media viewer zoom state

Persist each page’s image zoom scale and focal point across rotations and view recreation.

Add coverage for orientation round trips and double-tap zoom restoration.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-14 08:10:00 +02:00
Nextcloud bot e22b4a41d0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-14 03:37:25 +00:00
Marino Faggiana 3b5e2b90e0 fix: preserve media viewer floating title color (#4250)
Keep the title button enabled while making the containing view ignore touches, preserving the system foreground color and normal tint state.

Add unit coverage for title styling and interaction behavior.

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-13 11:48:39 +02:00
Marino Faggiana c1f26f28d2 fix: support whiteboard direct editing (#4247)
* fix: support whiteboard direct editing

Centralize editor identifiers and configure each direct editor with its adapter-provided user agent.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: inject direct editing viewer dependencies

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-13 10:02:31 +02:00
Marino Faggiana 9d07282403 refactor: remove obsolete upload no-delete handling (#4246)
Signed-off-by: Marino Faggiana <[email protected]>
2026-08-13 07:49:42 +02:00
Nextcloud bot 704cc79cc3 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-13 03:32:46 +00:00
Marino Faggiana b7f8234832 fix: preserve offline files during storage cleanup (#4245)
* fix: preserve offline files during storage cleanup

Signed-off-by: Marino Faggiana <[email protected]>

* Build 3

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-12 10:51:08 +02:00
Marino Faggiana 5d423fcdab feat: add media repeat and auto-advance controls (#4243)
* feat: add media repeat and auto-advance controls

Support shared playback completion options across audio, AVPlayer, and VLC viewers.

Automatically advance to the next compatible media item and cover option precedence with unit tests.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: restore audio autoplay when paging tracks

Reload the audio player after viewer-wide teardown and skip fullscreen video dismissal for audio transitions.

Use the repeat-one icon for the audio repeat control.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: persist media viewer playback options

Signed-off-by: Marino Faggiana <[email protected]>

* feat: update audio viewer playback controls

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build version to 2

Signed-off-by: Marino Faggiana <[email protected]>

* fix: improve VLC playback progress and seeking

Track playback using elapsed media time, keep progress updates active during UI interactions, and seek by timestamp after scrubbing.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: preserve hidden video controls during autoplay

Signed-off-by: Marino Faggiana <[email protected]>

* fix: stabilize video controls during playback transitions

Share presentation state across AVPlayer and VLC to suppress controls during automatic playback, repeat restarts, and seeking.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: stabilize audio viewer top action padding

Signed-off-by: Marino Faggiana <[email protected]>

* fix: handle duplicate media and failed auto-advance

Deduplicate media viewer identifiers and skip repeated source items during next-media lookup.
Restore stopped playback controls when no matching item can be advanced to.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: stabilize playback during media page transitions

Deactivate media while paging and resume playback only after the target page settles.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: skip animation for non-adjacent media transitions

Signed-off-by: Marino Faggiana <[email protected]>

* fix: prevent cover flash during local video auto-advance

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 2

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-12 08:50:23 +02:00
Nextcloud bot ce29f3d227 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-12 03:31:21 +00:00
Marino Faggiana 9a3f72871f fix: remove placeholder file provider action (#4242)
* fix: remove placeholder file provider action

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build version to 1

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-11 07:50:04 +02:00
Marino Faggiana 6f0315759e fix: remove bottom inset from direct editing viewer (#4241)
* fix: remove bottom inset from direct editing viewer

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump app version to 34.1.3

Reset the project build number to 0.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-11 07:36:17 +02:00
Nextcloud bot 1fc7bf16da fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-11 03:40:29 +00:00
Milen Pivchev 831f1b4842 fix: Show wrong passcode prompt immediately without delay
Signed-off-by: Milen Pivchev <[email protected]>
2026-08-10 12:53:53 +02:00
Nextcloud bot 9131291bdb fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-10 03:31:11 +00:00
Marino Faggiana 703f6238c8 refactor: remove Assistant text handling from share extension (#4240)
* refactor: remove Assistant text handling from share extension

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 6

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-09 17:19:50 +02:00
Marino Faggiana 0d5f7fe6ad fix: preserve video menus during playback updates (#4239)
* fix: preserve video menus during playback updates

Signed-off-by: Marino Faggiana <[email protected]>

* feat: select external subtitles from Nextcloud

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 5

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-09 11:05:42 +02:00
Nextcloud bot 278319c39d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-09 03:25:27 +00:00
Marino Faggiana 5028977cc8 fix: show loading state while media data source builds (#4238)
* fix: show loading state while media data source builds

Route media collection updates through the safe reload helper.

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 4

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-08 10:20:33 +02:00
Marino Faggiana b2974669b0 feat: add document editor coordinator (#4237)
* feat: add document editor coordinator

Select the highest-priority available editor and open Collabora documents using generated rich-document URLs.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: support text and EuroOffice document editors

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: centralize document editor selection

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: migrate to renamed editor capabilities API

Signed-off-by: Marino Faggiana <[email protected]>

* fix: support OnlyOffice in document editor flows

Organize document creation actions by editor and use shared editor identifiers for capability detection.

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump build number and pin NextcloudKit 7.4.2

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 3

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-08 09:16:35 +02:00
Nextcloud bot 3a997b480e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-08 03:28:57 +00:00
Marino Faggiana 5cc53050ea fix: initialize media data source before searching (#4234)
* fix: initialize media data source before searching

Signed-off-by: Marino Faggiana <[email protected]>

* fix: avoid redundant media collection reloads

Signed-off-by: Marino Faggiana <[email protected]>

* fix: force media reload after directory changes

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-07 07:58:54 +02:00
Nextcloud bot 16bbdca67e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-07 03:35:10 +00:00
Nextcloud bot 045429fd38 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-06 03:52:45 +00:00
Milen Pivchev 370d3c2b79 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2026-08-05 17:35:11 +02:00
Marino Faggiana d48b8418fc fix: prevent camera roll upload extraction races (#4227)
Use unique temporary paths and validate extracted assets before promoting them for upload.
Preserve auto-upload metadata when cancelled and construct upload paths safely.

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-05 09:47:21 +02:00
Nextcloud bot 7aa5ac583f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-05 06:26:25 +00:00
Marino Faggiana b4332c7cc7 fix: store preferences in shared app group (#4226)
* fix: store preferences in shared app group

Migrate legacy preference values on first app launch while preserving existing shared values.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: add account unavailable localization

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-05 08:22:46 +02:00
Nextcloud bot c85e7a63dc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-05 03:35:04 +00:00
Marino Faggiana 82634b52d6 fix: only convert camera roll compatibility formats to JPEG (#4223)
* fix: only convert camera roll compatibility formats to JPEG

Preserve animated and lossless image formats during auto upload and keep upload metadata filenames in sync.

Add coverage for native and compatibility filename handling.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: preserve camera roll asset quality and format

Export current high-quality photo and video representations.
Preserve video containers and prefer rendered Live Photo resources.

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump app version to 34.1.2

Reset the project build number to 0.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-04 10:35:16 +02:00
Marino Faggiana f0a250beeb feat: track server certificate trust status (#4222)
* feat: track server certificate trust status

Signed-off-by: Marino Faggiana <[email protected]>

* fix: download videos before playback with trusted certificates

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 2

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-03 10:27:37 +02:00
Marino Faggiana d307ab5b2a fix: handle video playback startup failures
Add startup timeouts for AVPlayer and VLC playback, and report VLC failures when playback stops before starting.

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-02 08:45:17 +02:00
Marino Faggiana ec55b04c5a Improve video playback loading and error recovery (#4218)
* fix: show loading state on video playback cover

Signed-off-by: Marino Faggiana <[email protected]>

* fix: handle video playback failures with retry

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-02 08:33:00 +02:00
Nextcloud bot be88ad96e1 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-02 03:18:02 +00:00
Marino Faggiana 4c4be4f57e Improve remote video playback reliability and VLC lifecycle handling (#4217)
* fix: wait for VLC shutdown before changing videos

Signed-off-by: Marino Faggiana <[email protected]>

* fix: prevent video playback probe from hanging

Use an async AVFoundation playability check with cancellation and an eight-second VLC fallback timeout.

Pass the user agent to video playback and bump the app version to 34.1.1.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: recover from rejected VLC presentations

Reset playback launch state when presentation is rejected and add VLC presentation and playback diagnostics.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-08-01 10:08:32 +02:00
Nextcloud bot 2f8f20297f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-08-01 03:25:52 +00:00
Marino Faggiana 0ddc684537 4211 media viewer title overflows right side upper buttons (#4216)
* fix: embed media viewer titles in navigation items

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 6

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-31 07:23:27 +02:00
Nextcloud bot dc9db57529 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-31 03:24:11 +00:00
Marino Faggiana a7fa2a3097 perf: prefetch collection view images and avatars (#4215)
* perf: prefetch collection view images and avatars

Cache previews and avatars in memory to avoid repeated disk access and asynchronous image loading during cell configuration.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: improve collection preview and avatar loading

Signed-off-by: Marino Faggiana <[email protected]>

* perf: reuse image preview availability check

Signed-off-by: Marino Faggiana <[email protected]>

* fix: load photo previews on cache miss

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-30 11:05:24 +02:00
Nextcloud bot 5da3a1c527 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-30 03:35:46 +00:00
Nextcloud bot c7bdc4d4aa fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-29 15:36:49 +00:00
Marino Faggiana caff81156d chore: remove Play with VLC localization
Signed-off-by: Marino Faggiana <[email protected]>
2026-07-29 17:32:53 +02:00
Marino Faggiana 12c76849b8 refactor: remove navigation actions from video players (#4214)
Signed-off-by: Marino Faggiana <[email protected]>
2026-07-29 17:30:37 +02:00
Nextcloud bot eb2711a569 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-29 15:13:27 +00:00
Marino Faggiana d34c02a5f4 feat: add VLC playback options for videos (#4213)
* feat: add VLC playback options for videos

Allow switching individual videos to VLC and persisting that preference. Improve VLC replay and cleanup behavior.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: handle VLC playback preference toggling

Retry playback with AVFoundation when disabling the per-video VLC preference and stop the controls timer when VLC shuts down.

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 5

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-29 17:09:40 +02:00
Marino Faggiana 2e47a09845 perf(files): load file previews asynchronously (#4210)
* fix: disable interaction for media section headers

Signed-off-by: Marino Faggiana <[email protected]>

* fix: prevent stale previews in reused collection cells

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 4

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-28 16:13:17 +02:00
Marino Faggiana 933b7ec44c cleaning 2026-07-27 16:55:13 +02:00
Marino Faggiana f92fd7e521 chore: bump project build number to 3 (#4208)
Signed-off-by: Marino Faggiana <[email protected]>
2026-07-27 12:20:03 +02:00
Marino Faggiana fe710979d9 refactor(media): move image cache window management into NCImageCache (#4207)
* fix: rerun media metadata backfill weekly

Resume interrupted cycles from the stored offset and skip completed cycles only until the weekly interval expires.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: simplify image cache usage

Load avatars directly from disk while continuing background refreshes, and remove redundant preview cache preloading and cleanup.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: split media delegates into extensions

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: centralize media image cache window management

Move cache window state, loading, and invalidation into NCImageCache and precompute cache items in the media data source.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: isolate media window cache in an actor

Move media cache window state and loading into a dedicated actor to improve concurrency safety and remove main-actor restrictions.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-27 11:36:03 +02:00
Nextcloud bot 12e0e52d7b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-27 03:20:21 +00:00
Nextcloud bot a05730a547 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-26 03:22:27 +00:00
Marino Faggiana bd6f12cfad Improve Media pinch-to-zoom navigation and preserve scroll position (#4206)
* Update NCMediaPinchGesture.swift

* Update project.pbxproj
2026-07-25 16:50:40 +02:00
Marino Faggiana 63172442b5 Fix UI media (#4204)
* fix: update media title after layout

Avoid clearing the media date while items are temporarily unavailable and bump the project build version.

Signed-off-by: Marino Faggiana <[email protected]>

* perf: avoid redundant media date title updates

Cache the visible media range and skip recalculating the navigation title when it has not changed.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: prevent duplicate media image loading

Load media thumbnails with cancellable utility tasks and remove collection view prefetching. Reduce the in-memory image cache limit.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-25 09:57:19 +02:00
Nextcloud bot f384e2961a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-25 03:49:57 +00:00
Nextcloud bot 2b7e64a861 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-24 10:49:34 +00:00
Nextcloud bot e8e2b43af0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-24 10:41:34 +00:00
rakekniven 5342b2f871 chore(i18n): Removed "success" (#4202)
Follow our guidelines.

Signed-off-by: rakekniven <[email protected]>
2026-07-24 12:38:21 +02:00
Marino Faggiana 4d544a59a3 chore: bump app version to 34.1.0 (#4203)
Pin NextcloudKit to version 7.4.1.

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-24 12:37:18 +02:00
Marino Faggiana fa7ca6b719 feat: prepare media date navigation by month (#4199)
* feat: prepare media date navigation by month

Replace the media date label with a button and index the first media item for each year and month.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: improve media date button styling and gradient transition

Signed-off-by: Marino Faggiana <[email protected]>

* feat: add date picker navigation to media timeline

Signed-off-by: Marino Faggiana <[email protected]>

* fix: show visible date range in media header

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: migrate media date picker to SwiftUI

Use a compact custom sheet and apply date selections as the picker changes.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: add title to media date picker

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: move media date range to navigation bar

Remove the media header gradient and activity indicator, and format the visible date range as a navigation bar item.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: correct media collection layout calculations

Use safe column counts and collection view bounds, calculate content height across all columns, and rebuild accurate union and footer geometry.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: improve media grid updates and viewer selection

Refresh the media layout when pinch gestures change column counts, use hydrated metadata for previews, and guard asynchronous viewer selection against reused cells.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: group media into monthly sections

Add month and year section headers, update section-aware navigation and selection, and show media totals only in the final section footer.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: add dedicated media section headers

Display month and year in a reusable media section header while preserving the existing empty-state header.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: align media navigation with section headers

Increase section header spacing and add leading padding for clearer media grouping.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: debounce and cancel stale media reloads

Guard media data loading against cancellation and inactive views, and build media sections more efficiently.

Signed-off-by: Marino Faggiana <[email protected]>

* perf: build media data source off the main actor

Revalidate the active media view before updating the collection view.

Signed-off-by: Marino Faggiana <[email protected]>

* perf: optimize media data source updates

Build compact metadata and sections in a single pass, and update affected sections directly when removing items.

Signed-off-by: Marino Faggiana <[email protected]>

* TEST

Signed-off-by: Marino Faggiana <[email protected]>

* fix: show media search activity in navigation bar

Signed-off-by: Marino Faggiana <[email protected]>

* fix: cancel stale media loading tasks

Prevent outdated search and data source tasks from updating the media view after cancellation or account changes.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: cancel media tasks when view disappears

Avoid retaining the media controller in asynchronous tasks and load the data source directly after delegate registration.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: build media data source from compact metadata

Fetch and normalize compact media metadata directly from Realm, filtering Live Photo videos before constructing media sections.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: reduce maximum grid columns

Increase the minimum item width for collection and media grids and simplify media placeholder sizing.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: reload image cache when entering foreground

Use compact media metadata to rebuild the preview cache efficiently.

Signed-off-by: Marino Faggiana <[email protected]>

* fix: prevent image cache observer retain cycle

Ensure the cache loading flag is reset on every exit path.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: simplify image cache loading

Cache previews of all supported sizes and load media thumbnails asynchronously on demand.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: simplify image cache key handling

Centralize cache key creation, clarify the cache size setting, and safely capture the cache in lifecycle observers.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: remove redundant returns from image cache

Signed-off-by: Marino Faggiana <[email protected]>

* perf: preload media images around the visible range

Reset and rebuild the cache window when the layout, account, or media data changes.

Signed-off-by: Marino Faggiana <[email protected]>

* perf: skip repeated missing media cache reads

Track missing image keys within each cache session and clear them alongside the image cache. Add cache-window diagnostics for hits, disk reads, missing images, and cancellations.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: overlay media section headers on content

Improve header readability with white text and a shadow, and clear reused header titles.

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-24 12:15:00 +02:00
Nextcloud bot 653c5b97e5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-24 03:33:24 +00:00
Milen Pivchev d17d2d2a3e Bump to 34.0.0 (#4201)
Signed-off-by: Milen Pivchev <[email protected]>
2026-07-23 13:26:28 +02:00
Milen Pivchev 5e0f19171b feat: NC governance (#4152)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Use segmented tabs via swiftui

Signed-off-by: Milen Pivchev <[email protected]>

* Remove Parchment

Signed-off-by: Milen Pivchev <[email protected]>

* Remove Parchment

Signed-off-by: Milen Pivchev <[email protected]>

* Governance UI

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* PR feedback

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-07-23 10:51:10 +00:00
Milen Pivchev 2d20a14026 Merge branch 'master' of https://github.com/nextcloud/ios into unified-sharing
Signed-off-by: Milen Pivchev <[email protected]>
2026-07-22 16:26:15 +02:00
Nextcloud bot ecf0fd92ad fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-22 03:13:50 +00:00
Milen PivchevandMarino Faggiana 8c665a4fbd fix: plus button fixes (#4195)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* fix: preserve plus button tint on account changes

Signed-off-by: Marino Faggiana <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Comment

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>
2026-07-21 16:27:22 +02:00
Marino Faggiana 0a82d58279 refactor: consolidate media metadata backfill processing (#4198)
* refactor: consolidate media metadata backfill processing

Signed-off-by: Marino Faggiana <[email protected]>

* docs: clarify media processing documentation

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-21 16:15:19 +02:00
Marino Faggiana 309f2c511d feat: persist media preview backfill failures (#4197)
* feat: persist media preview backfill failures

Add Realm-backed APIs to track and clear media preview backfill failures, and bump the database schema to version 413.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: split media background processing

Extract metadata backfill, placeholder hydration, and preview backfill into dedicated processors and organize processing and refresh sources.

Signed-off-by: Marino Faggiana <[email protected]>

* refactor: streamline media preview backfill processing

Select a limited batch of missing previews inside the processor and skip previously failed items. Simplify failure tracking and clear it when no previews remain or an account is removed.

Signed-off-by: Marino Faggiana <[email protected]>

* feat: run media preview backfill during app processing

Add dedicated logging for media preview backfill progress and completion.

Signed-off-by: Marino Faggiana <[email protected]>

* lint

Signed-off-by: Marino Faggiana <[email protected]>

* Update NCMediaPreviewBackfillProcessor.swift

* Update NCManageDatabase.swift

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-21 14:13:47 +02:00
Marino Faggiana 641b82cbc2 fix: constrain and truncate media viewer titles (#4196)
Update the app version to 33.1.3 and reset the project build number.

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-21 08:00:48 +02:00
Milen PivchevandMarino Faggiana 0798a10d66 Liquid glass + button (#4191)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* fix: preserve plus button tint on account changes

Signed-off-by: Marino Faggiana <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>
2026-07-21 07:51:18 +02:00
Nextcloud bot 159dd3b074 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-21 03:18:11 +00:00
Marino Faggiana 5013aa0587 Viewer title (#4194)
* fix: refine media viewer floating title sizing

Cap navigation item height and constrain Dynamic Type scaling for consistent title layout.

Signed-off-by: Marino Faggiana <[email protected]>

* UIGlassEffect

Signed-off-by: Marino Faggiana <[email protected]>

* fix: align media viewer title with navigation bar top

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 3

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-20 09:48:36 +02:00
Nextcloud bot 1e74f7a8b1 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-19 03:16:07 +00:00
Marino Faggiana be8621ca27 Ios27 fix (#4192)
* fix: handle search dismissal and media callbacks

Signed-off-by: Marino Faggiana <[email protected]>

* chore: bump project build number to 2

Signed-off-by: Marino Faggiana <[email protected]>

* fix: keep plus button hidden during editing and search

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-18 07:50:39 +02:00
Nextcloud bot 271999ec08 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-18 03:14:04 +00:00
Nextcloud bot 7e53fffff2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-17 05:30:18 +00:00
Marino Faggiana a44c07004e E2ee renew certificate (#4189)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* test

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* X509_set_issuer_name(x509, name)

Signed-off-by: Marino Faggiana <[email protected]>

* X509_set_issuer_name(x509, name)

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-17 07:06:57 +02:00
Nextcloud bot c009702ced fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-17 03:11:48 +00:00
Marino Faggiana abeaa0bea2 Title Appearance (#4187)
* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-16 08:35:57 +02:00
Marino Faggiana aaae403c46 4181 swiping down any amount closes image preview even when zoomed in (#4184)
* added onZoomChanged

Signed-off-by: Marino Faggiana <[email protected]>

* improvements

Signed-off-by: Marino Faggiana <[email protected]>

* fix Live in thumbnail

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-16 07:12:17 +02:00
Nextcloud bot 07e68c0cb4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-16 03:09:11 +00:00
Milen Pivchev 9246e70820 Rerequest push notifications (#4174)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-07-15 16:58:08 +02:00
Nextcloud bot 9ca02722ef fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-15 07:31:45 +00:00
Nextcloud bot be626864b1 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-15 07:23:27 +00:00
Marino Faggiana 1a42c12abc E2EE: key checksum failed (#4182)
* checksum missing

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

* refactor

Signed-off-by: Marino Faggiana <[email protected]>

* new version

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-15 09:18:39 +02:00
Nextcloud bot 26d517e0cb fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-15 03:24:03 +00:00
Marino Faggiana 96676a00cb App Processing - V 33.1.1 (#4179)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* cleanUpAsync

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* build 1 test

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* Clear stale server-unavailable (503) state from the previous app session

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* Build 2

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* LOG

Signed-off-by: Marino Faggiana <[email protected]>

* fix hydrate

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-14 09:31:37 +02:00
Marino Faggiana ab96482dca fix (#4177)
* fix

Signed-off-by: Marino Faggiana <[email protected]>

* b 9

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-10 07:42:47 +02:00
Nextcloud bot b159dd9aff fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-10 03:12:54 +00:00
Marino Faggiana 8bf4f70481 fix crash
Signed-off-by: Marino Faggiana <[email protected]>
2026-07-09 10:52:24 +02:00
Marino Faggiana e7aac49d4b Improvements varie (#4175)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* improved synchronizationDownload

Signed-off-by: Marino Faggiana <[email protected]>

* rename

Signed-off-by: Marino Faggiana <[email protected]>

* rename

Signed-off-by: Marino Faggiana <[email protected]>

* added NCMetadataDownloadTranfersSuccess

Signed-off-by: Marino Faggiana <[email protected]>

* improvements

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-09 10:39:06 +02:00
Marino Faggiana 963ba65aaa WIP (#4171)
Signed-off-by: Marino Faggiana <[email protected]>
2026-07-09 07:11:42 +02:00
Marino Faggiana 7bcd4d2e8c UI window scene (#4172)
* resolvedWindow

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-09 07:11:01 +02:00
Nextcloud bot d53569bea3 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-09 03:12:51 +00:00
Marino Faggiana 0933747068 Processing task Media (#4169)
* tableMediaMetadataBackfill

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

* Stops the backfill when the media archive has already been fully processed

Signed-off-by: Marino Faggiana <[email protected]>

* Retrieves and stores complete metadata when the media record is a placeholder.

Signed-off-by: Marino Faggiana <[email protected]>

* runMediaMetadataPlaceholderHydration

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

* Update AppDelegate+AppProcessing.swift

* Update AppDelegate+AppProcessing.swift

* Update NCSettingsView.swift

* wip

* Update AppDelegate+AppProcessing.swift

* limit

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* fix log

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-08 11:23:51 +02:00
Nextcloud bot 9304f1b1f4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-08 03:09:48 +00:00
Marino Faggiana e770287f8a fix thumbnail (#4168)
* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* Media -> added metadata-files-live-photo

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-06 08:01:31 +02:00
Nextcloud bot 892fe1de6d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-06 03:08:16 +00:00
Marino Faggiana ca4cc0a308 Audio fix (#4167)
* fix

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* verifyZombie

Signed-off-by: Marino Faggiana <[email protected]>

* added ProcessInfo.processInfo.thermalState

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* build 7

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* imagePlaceholderView

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-05 11:13:20 +02:00
Nextcloud bot 4b35496fcf fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-05 03:06:49 +00:00
Marino Faggiana 7955f412e1 Recommendations improved (#4166)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* added recommendationsIdentity

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-04 07:10:50 +02:00
Nextcloud bot 303a431118 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-04 03:09:14 +00:00
Marino Faggiana 7fe29ea822 Fix UI (#4165)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* EU capabilities

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-03 08:41:55 +02:00
Nextcloud bot 3e54ebbcb0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-03 03:09:17 +00:00
Marino Faggiana 821f1b6c5a Move Close Save Cancel button to image (#4164)
* fix doc

Signed-off-by: Marino Faggiana <[email protected]>

* replace with X

Signed-off-by: Marino Faggiana <[email protected]>

* replace X

Signed-off-by: Marino Faggiana <[email protected]>

* Button X

Signed-off-by: Marino Faggiana <[email protected]>

* change button type

Signed-off-by: Marino Faggiana <[email protected]>

* build 6

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-02 15:53:23 +02:00
Marino Faggiana b93034677e New build (#4163)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* build 5

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-02 11:44:40 +02:00
Marino Faggiana b58cc428cf wip (#4162)
Signed-off-by: Marino Faggiana <[email protected]>
2026-07-02 10:11:13 +02:00
Marino Faggiana 28b35ed556 download Avatar improvements (#4161)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* WIP

Signed-off-by: Marino Faggiana <[email protected]>

* WIP

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* WIP

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-02 09:35:37 +02:00
Nextcloud bot 1a958730df fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-02 03:11:15 +00:00
Marino Faggiana 53682a6d81 menu-fix (#4160)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-01 16:07:22 +02:00
Marino Faggiana ec5bf46318 Direct editing (#4159)
* fix

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* hide goback + fix

Signed-off-by: Marino Faggiana <[email protected]>

* test

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-07-01 11:50:39 +02:00
Nextcloud bot f2c3986498 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-07-01 03:07:47 +00:00
Nextcloud bot 00c3dc0ab7 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-30 13:45:19 +00:00
Nextcloud bot 6f36ce7737 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-30 13:38:29 +00:00
Marino Faggiana 4a040f9e03 Open in office / Menu (#4153)
* plus menu displayInline

Signed-off-by: Marino Faggiana <[email protected]>

* plus menu

Signed-off-by: Marino Faggiana <[email protected]>

* new plus menu

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* menu

Signed-off-by: Marino Faggiana <[email protected]>

* create wip

Signed-off-by: Marino Faggiana <[email protected]>

* getViewerController

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-30 15:34:20 +02:00
Nextcloud bot fdd93ca520 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-30 03:13:12 +00:00
Nextcloud bot e99bb65703 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-29 10:07:22 +00:00
Nextcloud bot 774be28b22 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-29 09:50:55 +00:00
Marino Faggiana f1a1481351 ImageCache (#4151)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* build 4

Signed-off-by: Marino Faggiana <[email protected]>

* restore focused auto upload

Signed-off-by: Marino Faggiana <[email protected]>

* remove old code

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-29 11:38:08 +02:00
Nextcloud bot 53e0adea34 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-29 03:10:41 +00:00
Nextcloud bot 4dafa55cb6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-28 03:11:22 +00:00
Nextcloud bot 4d55f77f5e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-27 03:08:02 +00:00
Marino Faggiana 2af165bed1 Transfers view (#4148)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* new label

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* build 3

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-26 14:34:23 +02:00
Rasmussw 198a2f0b32 Add in-app camera with direct upload to Nextcloud (#4058)
* feat(camera): add in-app camera with direct upload to Nextcloud

Introduces a custom AVFoundation camera that captures photos and videos
and uploads them directly to Nextcloud without saving to the device
camera roll by default.

- Custom camera UI: shutter, flash, flip, mode selector (photo/video)
- Pinch-to-zoom from 0.5x (ultra-wide) to 10x with live zoom label
- Virtual multi-camera support (triple/dual-wide) for sub-1x zoom
- Recording timer with red dot, screen stays on during video recording
- App backgrounding gracefully stops recording in progress
- Review screen after capture: retake or use, inline video playback
- "Save to camera roll" opt-in toggle per session (off by default)
- Global default for toggle in Settings -> Advanced
- Filenames follow Nextcloud conventions via createFileName(),
  including "Maintain original filename" mode (IMG_XXXX.JPG)
- Videos saved as .mov (QuickTime) matching Apple native camera format
- Restored live photo upload logic: livePhotoFile and nativeFormat
  were inadvertently removed in a previous refactor
- Fix: PHAuthorizationStatus.limited now correctly treated as authorized
- Fix: NCViewerQuickLookView crash when asset is nil after model change

Signed-off-by: Rasmus Wøldike <[email protected]>

Signed-off-by: Rasmus Wøldike <[email protected]>

* fix: remove reference to non-existent e2eeCompatibleVersions

Signed-off-by: Rasmus Wøldike <[email protected]>

Signed-off-by: Rasmus Wøldike <[email protected]>

* refactor(camera): simplify to UIImagePickerController delegate approach

Replace custom AVFoundation camera with UIImagePickerController by
intercepting TLPhotoPicker's camera presentation and injecting
customPhotoPickerViewController as delegate. Media is captured to a
temp file and passed directly to the upload flow without saving to
camera roll. Fixes iPad camera support.

Signed-off-by: Rasmus Wøldike <[email protected]>
Signed-off-by: Rasmus Wøldike <[email protected]>

Signed-off-by: Rasmus Wøldike <[email protected]>

* feat: apply brand icon colors and adjust navigation bar for iOS 26

Signed-off-by: Rasmus Wøldike <[email protected]>

Signed-off-by: Rasmus Wøldike <[email protected]>

* fix: use TLPhotoPicker didCaptureMediaURL and clean up strings

- Use didCaptureMediaURL from TLPhotoPicker 2.1.21 with correct
  filename convention via createFileName
- Remove unused strings (_retake_, _use_photo_, _use_video_)
- Fix autoMkcol version check to use isServerVersion
- Remove duplicate function declarations from merge

Signed-off-by: Rasmus Wøldike <[email protected]>

* fix: restore Localizable.strings to upstream baseline with camera strings

Only add _save_to_camera_roll_ and _save_to_camera_roll_desc_ strings.
All other strings from upstream master are preserved.

Signed-off-by: Rasmus Wøldike <[email protected]>

---------

Signed-off-by: Rasmus Wøldike <[email protected]>
2026-06-26 07:58:00 +02:00
Nextcloud bot 0800900271 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-26 03:08:23 +00:00
Marino Faggiana e7477225c1 E2ee new func (#4146)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* nckit main

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-25 16:29:15 +02:00
Marino Faggiana 96337feb27 fix (#4144)
Signed-off-by: Marino Faggiana <[email protected]>
2026-06-25 07:26:04 +02:00
Nextcloud bot fc2642a432 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-25 03:10:10 +00:00
Marino Faggiana f4aec3c690 New build (#4143)
* build 1

Signed-off-by: Marino Faggiana <[email protected]>

* NCMediaViewerDownloadTaskRegistry

Signed-off-by: Marino Faggiana <[email protected]>

* build 2

Signed-off-by: Marino Faggiana <[email protected]>

* fix version setup e2ee

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-24 18:54:01 +02:00
Nextcloud bot c71874eb30 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-24 03:35:09 +00:00
Marino Faggiana 73cb67a763 new-version (#4142)
* new v

Signed-off-by: Marino Faggiana <[email protected]>

* Activity

Signed-off-by: Marino Faggiana <[email protected]>

* NCTransferCoordinator

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-23 10:36:49 +02:00
Marino Faggiana e9103a1b3b media-viewer (#4118)
* Refactor media viewer comments

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-23 07:04:54 +02:00
Milen Pivchev f5cc60a22d Merge branch 'master' of https://github.com/nextcloud/ios into unified-sharing
Signed-off-by: Milen Pivchev <[email protected]>
2026-06-22 09:37:01 +02:00
Nextcloud bot c31f400a49 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-22 03:11:57 +00:00
Marino Faggiana 6bc597dbbf errata branch !
Signed-off-by: Marino Faggiana <[email protected]>
2026-06-21 15:11:31 +02:00
Marino Faggiana ba55ce8e4e cleaning
Signed-off-by: Marino Faggiana <[email protected]>
2026-06-21 15:05:06 +02:00
Marino Faggiana 0cce33aedd ReloadDataKeepingPosition
Signed-off-by: Marino Faggiana <[email protected]>
2026-06-21 14:56:06 +02:00
Marino Faggiana 857a75d4af version (#4141)
Signed-off-by: Marino Faggiana <[email protected]>
2026-06-20 12:03:54 +02:00
Nextcloud bot d1df066ff3 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-19 06:04:27 +00:00
Nextcloud bot 641ef49407 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-18 03:14:12 +00:00
Marino Faggiana 3fe3a8d143 Improved (#4139)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* Update NCViewerQuickLook.swift

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-17 08:42:45 +02:00
Nextcloud bot fb01b1e74b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-17 03:07:02 +00:00
Milen Pivchev dba02f5db9 Rename target
Signed-off-by: Milen Pivchev <[email protected]>
2026-06-16 18:48:32 +02:00
Marino Faggiana 0f98682f46 Fix duplicate AutoUpload WiFi (#4137)
* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* build 1

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-15 11:17:22 +02:00
Milen Pivchevandcopilot-swe-agent[bot] 19c1c03c2c Fix unwanted gesture back action (#4135)
* Fix

Signed-off-by: Milen Pivchev <[email protected]>

* Fix 2

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Fix CI: remove APCu memcache config causing occ command failures

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
2026-06-15 10:55:42 +02:00
Nextcloud bot 91dd8753af fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-13 03:10:40 +00:00
Milen Pivchev 78cb027065 Settings fixes
commit e3aa423883244540e0de678384559b3e9020ccc4
Author: Milen Pivchev <[email protected]>
Date:   Fri Jun 12 12:43:35 2026 +0200

    WIP

    Signed-off-by: Milen Pivchev <[email protected]>

commit 4b52220fe115053b55d280329ee76996aace426b
Author: Milen Pivchev <[email protected]>
Date:   Fri Jun 12 11:48:47 2026 +0200

    WIP

    Signed-off-by: Milen Pivchev <[email protected]>

commit bd9a13d02f4c1f8c07fc8943112701e49b62a883
Author: Milen Pivchev <[email protected]>
Date:   Fri Jun 12 11:23:30 2026 +0200

    WIP

    Signed-off-by: Milen Pivchev <[email protected]>

Signed-off-by: Milen Pivchev <[email protected]>
2026-06-12 12:44:44 +02:00
Nextcloud bot 2b30f0bbd6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-12 03:32:30 +00:00
Nextcloud bot bde1361e0d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-11 03:09:12 +00:00
Milen Pivchev 2588450000 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2026-06-10 11:15:32 +02:00
Nextcloud bot fea04392ef fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-10 03:05:23 +00:00
Nextcloud bot 416dda67b0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-09 03:06:24 +00:00
Milen Pivchev 674aa2afb8 Merge branch 'master' into unified-sharing
Signed-off-by: Milen Pivchev <[email protected]>
2026-06-08 14:44:50 +02:00
Milen Pivchev 2dc375c71c Small refactor
Signed-off-by: Milen Pivchev <[email protected]>
2026-06-08 10:48:02 +02:00
Marino Faggiana 5c715fe263 fix (#4134)
Signed-off-by: Marino Faggiana <[email protected]>
2026-06-08 10:41:03 +02:00
Milen Pivchev c03755b672 Focused auto upload (#4096)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Animation

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* PR WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Move to More

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Use Form in NCMore

Signed-off-by: Milen Pivchev <[email protected]>

* Gradient

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-06-08 10:40:34 +02:00
Nextcloud bot 47d168dc9a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-08 03:09:23 +00:00
Marino Faggiana 5079c17d56 fix (#4129)
Signed-off-by: Marino Faggiana <[email protected]>
2026-06-06 08:48:30 +02:00
Marino Faggiana 94638b6e4a hidden-fix (#4131)
* error fix

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-06-05 09:13:09 +02:00
Milen PivchevandMarino Faggiana 6ad9fb0655 Read owner and permissions from PUT response on new file creation (#4105)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Fix compile

Signed-off-by: Milen Pivchev <[email protected]>

* down

Signed-off-by: Marino Faggiana <[email protected]>

* prj

Signed-off-by: Marino Faggiana <[email protected]>

* up

Signed-off-by: Marino Faggiana <[email protected]>

* main

Signed-off-by: Marino Faggiana <[email protected]>

* varie

Signed-off-by: Marino Faggiana <[email protected]>

* dele

Signed-off-by: Marino Faggiana <[email protected]>

* delegate

Signed-off-by: Marino Faggiana <[email protected]>

* header2

Signed-off-by: Marino Faggiana <[email protected]>

* delegate

Signed-off-by: Marino Faggiana <[email protected]>

* nk main

Signed-off-by: Marino Faggiana <[email protected]>

* code cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* ownerDisplayName

Signed-off-by: Marino Faggiana <[email protected]>

* ownerDisplayName

Signed-off-by: Marino Faggiana <[email protected]>

* lint

Signed-off-by: Marino Faggiana <[email protected]>

* fix query

Signed-off-by: Marino Faggiana <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>
2026-06-03 14:29:47 +02:00
Milen Pivchev 53bc4a7baf WIP
Signed-off-by: Milen Pivchev <[email protected]>
2026-06-03 13:36:41 +02:00
Nextcloud bot ac069c0002 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-03 03:58:16 +00:00
Nextcloud bot 22dea5430a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-06-01 03:08:10 +00:00
Nextcloud bot e9358fba93 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-31 03:05:50 +00:00
Nextcloud bot 913084ac91 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-30 03:06:04 +00:00
Marino Faggiana 3b3fb17f18 improvements (#4125)
* Harden Realm migration property access

Signed-off-by: Marino Faggiana <[email protected]>

* Banner for assistant not installed

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-05-29 14:22:55 +02:00
Milen Pivchev 07ba37f008 Remove parchment
Signed-off-by: Milen Pivchev <[email protected]>
2026-05-29 13:41:09 +02:00
Blind Dev 9c64a7e976 Fix VoiceOver labels in share folder picker (#4111) 2026-05-28 13:23:30 +02:00
Milen Pivchev 3bffab5448 Add NCKitUI
Signed-off-by: Milen Pivchev <[email protected]>
2026-05-27 19:05:12 +02:00
Milen Pivchev cad7e79a5f Merge branch 'master' of https://github.com/nextcloud/ios into unified-sharing
Signed-off-by: Milen Pivchev <[email protected]>
2026-05-27 13:54:21 +02:00
Marino Faggiana da5da2713c build 1 (#4119)
Signed-off-by: Marino Faggiana <[email protected]>
2026-05-27 06:54:15 +02:00
Laura Kramolis 8c0689bfa9 fix(AppIcon): Use app icon consistent with Talk (#4116)
Made by @yotamguttman

Signed-off-by: kramo <[email protected]>
2026-05-26 12:06:04 +02:00
Nextcloud bot a751848f7e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-26 04:13:04 +00:00
Nextcloud bot 1b043dca33 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-25 04:12:41 +00:00
Nextcloud bot eeac608cfc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-24 10:51:55 +00:00
Nextcloud bot 105667b1b2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-23 11:15:56 +00:00
Marino Faggiana 86157201af Version 33.0.9
Signed-off-by: Marino Faggiana <[email protected]>
2026-05-22 16:38:53 +02:00
Marino Faggiana 1f1ba2efc5 Merge branch 'master' of https://github.com/nextcloud/ios
Signed-off-by: Marino Faggiana <[email protected]>
2026-05-22 16:35:39 +02:00
Marino Faggiana 647525919b new version
Signed-off-by: Marino Faggiana <[email protected]>
2026-05-22 16:33:30 +02:00
Marino Faggiana 48c8db13dc new build 3 (#4117)
* build 3

Signed-off-by: Marino Faggiana <[email protected]>

* text only

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-05-22 16:23:56 +02:00
Nextcloud bot fa73f5d521 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-22 03:45:59 +00:00
Marino Faggiana dbeda64e38 Transfer counter (#4115)
* counter badge

Signed-off-by: Marino Faggiana <[email protected]>

* counter

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-05-21 15:57:28 +02:00
Marino Faggiana 390d898806 icon() size (#4113)
* icon size to 21

Signed-off-by: Marino Faggiana <[email protected]>

* icon size fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-05-21 11:15:36 +02:00
Nextcloud bot fef419abac fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-18 03:06:13 +00:00
Nextcloud bot 03caa6211f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-17 03:07:44 +00:00
Milen Pivchev cb7e4b95dc Add OAEP notification encryption (#4103)
* Add OAEP notification decryption

Signed-off-by: Milen Pivchev <[email protected]>

* Flip paddings

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-05-15 17:15:01 +02:00
Marino Faggiana bcac98a989 ability to directly share selected text to assistant (#4107)
* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* assistant

Signed-off-by: Marino Faggiana <[email protected]>

* assistantEnabled

Signed-off-by: Marino Faggiana <[email protected]>

* clean code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* Directediting (#4109)

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* whiteboard

Signed-off-by: Marino Faggiana <[email protected]>

* nextcloudkit

Signed-off-by: Marino Faggiana <[email protected]>

* pencil.and.scribble

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* added inputText

Signed-off-by: Marino Faggiana <[email protected]>

* inputText

Signed-off-by: Marino Faggiana <[email protected]>

* ChatInputField

Signed-off-by: Marino Faggiana <[email protected]>

* NCAssistantInputModel

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* action

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* closed

Signed-off-by: Marino Faggiana <[email protected]>

* build 2

Signed-off-by: Marino Faggiana <[email protected]>

* appIcon

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-05-15 08:35:02 +02:00
Marino Faggiana 1407ecec9e Directediting (#4109)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* whiteboard

Signed-off-by: Marino Faggiana <[email protected]>

* nextcloudkit

Signed-off-by: Marino Faggiana <[email protected]>

* pencil.and.scribble

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-05-13 13:30:47 +02:00
Marino Faggiana 7b7f1d6650 Gui fix varie (#4097)
* fix “more” item

Signed-off-by: Marino Faggiana <[email protected]>

* fixup!

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-05-06 08:44:32 +02:00
Milen Pivchev 87e67db2ac WIP
Signed-off-by: Milen Pivchev <[email protected]>
2026-05-04 19:21:15 +02:00
Marino Faggiana 397f4f73da Revert "chore(l10n): Added nbsp before ellipsis (#4092)"
This reverts commit 9e1a450e20.
2026-05-04 16:39:29 +02:00
rakekniven 9e1a450e20 chore(l10n): Added nbsp before ellipsis (#4092)
Signed-off-by: rakekniven <[email protected]>
2026-05-04 07:15:20 +02:00
Nextcloud bot d1c8ab07ea fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-05-01 02:55:18 +00:00
Marino Faggiana 0a5c5a234c AES_IVEC_LENGTH (#4090)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-30 08:21:23 +02:00
Marino Faggiana abf4353d0c fix build code
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-30 07:50:52 +02:00
Marino Faggiana 274954334e More refactoring (#4089)
* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* remove old code

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* wip

Signed-off-by: Marino Faggiana <[email protected]>

* review

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-29 18:04:50 +02:00
Nextcloud bot 5f298c5c13 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-29 02:57:11 +00:00
Marino Faggiana ccbbe2257e remove old code (#4087)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-28 09:45:28 +02:00
Nextcloud bot 03e5f5f516 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-28 02:54:19 +00:00
Marino Faggiana 5213ea092e ErrorBannerGate (refactoring) (#4086)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-26 10:12:56 +02:00
Nextcloud bot e3147733dd fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-26 02:52:13 +00:00
Nextcloud bot 18e8fac47f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-25 02:53:20 +00:00
Nextcloud bot 5e4cdfdc7c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-24 03:20:12 +00:00
Marino Faggiana c5fa0d6661 Warning clean (#4085)
* clean

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* NCLivePhoto

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* build 5

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-23 16:16:09 +02:00
Marino Faggiana 3018d90d98 OpenSSL V
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-23 10:11:13 +02:00
Marino Faggiana 42aa8e3321 Crashlytics (#4083)
* cod

Signed-off-by: Marino Faggiana <[email protected]>

* Added Section DEBUG ONLY in Settings

Signed-off-by: Marino Faggiana <[email protected]>

* build 4

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-23 10:05:45 +02:00
Nextcloud bot bfbc7f72a4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-23 03:04:51 +00:00
Milen PivchevandCopilot f8c2fdeaab Change build settings for release (#4082)
* Change build settings for release

Signed-off-by: Milen Pivchev <[email protected]>

* Update Nextcloud.xcodeproj/project.pbxproj

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Copilot <[email protected]>
2026-04-22 16:50:15 +02:00
Marino Faggiana 25d0003fa0 fix (#4081)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-22 16:09:52 +02:00
Marino Faggiana 0c8ce43bca media select-share-move-copy (#4080)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* update project

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-22 10:06:01 +02:00
Nextcloud bot 09cf3aec05 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-22 02:53:27 +00:00
Marino Faggiana 9eab9f81ef update localized
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-21 14:34:56 +02:00
Marino Faggiana 573d4dc0f6 Background Task (#4079)
* try …

Signed-off-by: Marino Faggiana <[email protected]>

* handleTask

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-21 11:54:20 +02:00
Nextcloud bot 7e3dc87ec3 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-21 02:47:28 +00:00
Milen Pivchev 1f9b6162e9 Icon fixes
Signed-off-by: Milen Pivchev <[email protected]>
2026-04-20 17:15:40 +02:00
Marino Faggiana 3423f368ae GUI Review (#4071)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-20 15:33:01 +02:00
Marino Faggiana 52aa4dfbb3 fix search string color (#4078)
* fix

Signed-off-by: Marino Faggiana <[email protected]>

* color

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-20 11:48:44 +02:00
Milen Pivchev f5034970df New app icon (#4025)
* New app icon

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Use single icon

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-04-20 11:27:27 +02:00
Milen Pivchev aa77361096 CI fixes (#4072)
* String fixes

Signed-off-by: Milen Pivchev <[email protected]>

* CI fixes

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-04-20 11:14:48 +02:00
Marino Faggiana d58c2f9101 fix (#4077)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-20 10:55:59 +02:00
rakekniven be514816f9 chore(i18n): Change group folder to team folder (#4075)
Signed-off-by: rakekniven <[email protected]>
2026-04-20 10:20:06 +02:00
Nextcloud bot b3d2a16c65 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-20 02:47:43 +00:00
Nextcloud bot a703de0a62 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-19 02:47:52 +00:00
Nextcloud bot e91008b8fb fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-18 02:48:13 +00:00
Milen Pivchev f6b4a4e16a Merge branch 'master' of https://github.com/nextcloud/ios 2026-04-17 14:22:03 +02:00
Milen Pivchev abae220e13 String fixes
Signed-off-by: Milen Pivchev <[email protected]>
2026-04-17 14:21:57 +02:00
Nextcloud bot 2c444f9cfd fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-17 02:52:53 +00:00
Milen Pivchev 2577df43ac Tag banner string
Signed-off-by: Milen Pivchev <[email protected]>
2026-04-16 16:32:10 +02:00
Milen Pivchev 705720928b Tags fixes (#4070)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-04-16 16:28:12 +02:00
Marino Faggiana 0d3b7f3fa6 Del - Select fix (#4069)
* add string

Signed-off-by: Marino Faggiana <[email protected]>

* fix color

Signed-off-by: Marino Faggiana <[email protected]>

* clear db

Signed-off-by: Marino Faggiana <[email protected]>

* Trash fix Live Photo

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* Selection UI

Signed-off-by: Marino Faggiana <[email protected]>

* nextcloudkit

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-16 16:17:04 +02:00
Nextcloud bot 6a40121d15 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-16 02:48:52 +00:00
Marino Faggiana 296b5b634a Fix pro (#4067)
* Revert "FIX PROJECT"

This reverts commit 20b06b7192.

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-15 12:16:20 +02:00
Marino Faggiana 20b06b7192 FIX PROJECT
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-15 10:29:43 +02:00
Marino Faggiana a419f2af80 Fix build
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-15 09:04:39 +02:00
Marino Faggiana ebf2c9773c code (#4066)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-15 08:46:14 +02:00
Marino Faggiana 1b6d691766 build 1
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-15 07:48:45 +02:00
Milen Pivchev b1796fa902 New version 33.0.5 (#4065)
* New version

Signed-off-by: Milen Pivchev <[email protected]>

* Remove import

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-04-15 07:47:07 +02:00
Nextcloud bot 71407ca75b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-15 03:07:23 +00:00
Milen Pivchev 8bda2e10ae NCShareHeader padding
Signed-off-by: Milen Pivchev <[email protected]>
2026-04-14 17:38:10 +02:00
Milen PivchevandMarino Faggiana 7fb1156d5a Feat: Manage tags (#4055)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Migration

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* fix package

Signed-off-by: Marino Faggiana <[email protected]>

* Add table to clean funcs

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Migrations

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Migration

Signed-off-by: Milen Pivchev <[email protected]>

* Migrations

Signed-off-by: Milen Pivchev <[email protected]>

* Remove migration

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>
2026-04-14 17:09:54 +02:00
Nextcloud bot a3e3f7d44f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-14 03:08:14 +00:00
Marino Faggiana 4149368385 new build (#4063)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* rename to V2

Signed-off-by: Marino Faggiana <[email protected]>

* normalized

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-04-13 11:34:14 +02:00
Milen Pivchev 951e7da5f7 Fix account not available strings (#4059)
Signed-off-by: Milen Pivchev <[email protected]>
2026-04-13 09:38:42 +02:00
Marcel Müller 70bd4cc6d3 fix: Interactive pop gesture recognizer interfering with OnlyOffice text selection (#4062)
Signed-off-by: Marcel Müller <[email protected]>
2026-04-13 09:37:42 +02:00
Nextcloud bot 6c8c5baa91 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-13 02:48:17 +00:00
Nextcloud bot 32c3681178 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-11 02:47:07 +00:00
Nextcloud bot d276baacc6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-10 02:47:41 +00:00
Nextcloud bot b6ca6dad7d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-07 03:05:27 +00:00
Nextcloud bot 1c5e3459cf fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-06 02:55:25 +00:00
Nextcloud bot e457545781 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-04 02:45:01 +00:00
Nextcloud bot b716d666e4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-03 02:55:40 +00:00
Marino Faggiana 7bab17651c build 3
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-02 16:05:57 +02:00
Marino Faggiana 5a5d7389c8 e2ee refactoring setup (#4056)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-02 16:00:39 +02:00
Nextcloud bot 21c716a82f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-02 02:57:48 +00:00
Marino Faggiana 6f89fbe8f6 fix (#4053)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-01 13:41:47 +02:00
Milen Pivchev 38d80899a4 Add back buttons (#4051)
Signed-off-by: Milen Pivchev <[email protected]>
2026-04-01 11:48:59 +02:00
Marino Faggiana b99fdf83f6 E2ee improvements (#4052)
Signed-off-by: Marino Faggiana <[email protected]>
2026-04-01 10:22:05 +02:00
Nextcloud bot 67f8a2836c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-04-01 02:49:47 +00:00
Marino Faggiana 62c58ac894 Review errors string on E2EE + refactoring (clear old code) (#4050)
Signed-off-by: Marino Faggiana <[email protected]>
2026-03-31 17:00:02 +02:00
Marino Faggiana 4c35b59e97 Lucid banner new version 0.7.1 (#4048)
* LB-Y

Signed-off-by: Marino Faggiana <[email protected]>

* version 0.7.1

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-03-30 11:06:33 +02:00
Marino Faggiana ac9f4598e2 new v (#4047)
Signed-off-by: Marino Faggiana <[email protected]>
2026-03-30 09:49:31 +02:00
Marino Faggiana 9342eb0400 fix (#4046)
Signed-off-by: Marino Faggiana <[email protected]>
2026-03-30 09:41:15 +02:00
Marino Faggiana 965f00d7ef GUI Fix - last version (#4042)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* info

Signed-off-by: Marino Faggiana <[email protected]>

* banner

Signed-off-by: Marino Faggiana <[email protected]>

* hud

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* banner

Signed-off-by: Marino Faggiana <[email protected]>

* normalized

Signed-off-by: Marino Faggiana <[email protected]>

* normalized

Signed-off-by: Marino Faggiana <[email protected]>

* upload

Signed-off-by: Marino Faggiana <[email protected]>

* normalized

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* normalized

Signed-off-by: Marino Faggiana <[email protected]>

* fix font

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-03-30 09:27:24 +02:00
Nextcloud bot 0432fac31a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-25 02:48:11 +00:00
Nextcloud bot ce24a5eb5c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-24 02:47:09 +00:00
Nextcloud bot c0e9045185 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-22 02:52:15 +00:00
Nextcloud bot 6b07859910 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-20 02:46:20 +00:00
e69717e736 docs: fix outdated project structure table in AGENTS.md (#4034)
* Add an AGENTS.md

Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Initial plan

* docs: update AGENTS.md project structure table to reflect actual directories

Co-authored-by: mpivchev <[email protected]>

* docs: resolve conflicts by rebasing AGENTS.md changes onto current master

Co-authored-by: mpivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Milen Pivchev <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: mpivchev <[email protected]>
2026-03-17 14:14:46 +01:00
Milen Pivchev 306b400f2b Metadata docs (#4024)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* workflow

Signed-off-by: Milen Pivchev <[email protected]>

* Disable tests

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-03-17 12:30:11 +01:00
e8a5a71f3f fix: correct .github directory name in AGENTS.md (#4035)
* Add an AGENTS.md

Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Initial plan

* fix: correct .github directory name in AGENTS.md

Signed-off-by: Copilot <[email protected]>

Co-authored-by: mpivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Milen Pivchev <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: mpivchev <[email protected]>
2026-03-17 12:29:01 +01:00
Milen PivchevandCopilot 767bd09854 Add an AGENTS.md (#4029)
* Add an AGENTS.md

Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

* Update AGENTS.md

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Copilot <[email protected]>
2026-03-17 12:27:40 +01:00
Milen Pivchev d894f20be6 Fix error in assistant chat (#4026)
* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-03-17 12:12:34 +01:00
Nextcloud bot a8f988c5d6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-15 02:52:40 +00:00
Marino Faggiana f52721a794 New lib lucidbanner (#4030)
* Update project.pbxproj
2026-03-12 17:10:26 +01:00
Marino Faggiana 95df919491 Process + cell (#4027)
* Update project.pbxproj
2026-03-12 13:16:39 +01:00
Nextcloud bot d64a0bd5f7 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-12 02:48:58 +00:00
Milen Pivchev e1e5e537da Add password option for email shares (#4019)
Signed-off-by: Milen Pivchev <[email protected]>
2026-03-11 15:21:36 +01:00
Milen Pivchev ddf92256c0 Simplify blur vibrancy effect
Signed-off-by: Milen Pivchev <[email protected]>
2026-03-11 13:19:39 +01:00
Marino Faggiana 2182c19785 Update AppDelegate.swift 2026-03-10 16:18:57 +01:00
Marino Faggiana 8f924af425 fix 2026-03-10 16:12:17 +01:00
Marino Faggiana 375944f6eb Update AppDelegate.swift 2026-03-10 15:55:19 +01:00
Marino Faggiana 42675138b9 clean (#4023) 2026-03-10 15:31:52 +01:00
Marino Faggiana 9efbff8c1c Update NCUtility+Image.swift 2026-03-10 15:17:54 +01:00
Marino Faggiana a7dcb4d340 New build (#4022)
* Update SceneDelegate.swift

* Update project.pbxproj
2026-03-10 15:13:06 +01:00
Marino Faggiana 48d42bde77 Fix font after merge (#4021)
* cod

* trash

* grid

* list

* recommendations

* Update NCRecommendationsCell.xib

* trash
2026-03-10 14:46:11 +01:00
Milen Pivchev 950ff4f1fb Sanitize BIDI filenames (#4015)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* UI fixes

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Tests

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-03-10 10:38:30 +01:00
Nextcloud bot acd8846c18 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-10 02:50:00 +00:00
Marino Faggiana a9481dad36 3991 text enlargement from ios settings not working correctly in app (#4017)
Signed-off-by: Marino Faggiana <[email protected]>
2026-03-09 13:27:46 +01:00
Nextcloud bot 33061cb96c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-09 03:30:15 +00:00
Nextcloud bot 3ea7b9c2b4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-05 02:48:33 +00:00
Marino Faggiana a45395115f 4013 scan file conflict choosing keep both replace does not save the new file (#4016)
Signed-off-by: Marino Faggiana <[email protected]>
2026-03-04 08:59:55 +01:00
Nextcloud bot 53cf041839 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-03 02:49:45 +00:00
Marino Faggiana 035f26a567 Improved Recent view (#4014)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* build 3

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-03-02 10:08:15 +01:00
Nextcloud bot 3d6547d1ff fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-03-02 02:46:48 +00:00
Nextcloud bot 936fff3544 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-28 02:47:38 +00:00
Marino Faggiana 391cc26130 LucidBanner - Multi scene (#4010)
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-27 15:10:36 +01:00
Nextcloud bot 70a7b85481 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-27 02:47:01 +00:00
Marino Faggiana 3c9401d46f Alert Banner (#4009)
* wip

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-26 16:23:39 +01:00
Marino Faggiana 856f2daffc Menu cell fix UI (#4008)
* rename class

Signed-off-by: Marino Faggiana <[email protected]>

* https://github.com/nextcloud/ios/issues/4006

Signed-off-by: Marino Faggiana <[email protected]>

* fix dot in list cell

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-26 10:59:23 +01:00
Marino Faggiana 0dc9238b0a Error banner (LuciBanner) integration (#4003) 2026-02-26 10:16:00 +01:00
Nextcloud bot 0adf9d91b4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-25 02:51:47 +00:00
Nextcloud bot a19f683fc2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-24 02:55:41 +00:00
Marino Faggiana b22ccc498c version new (#4002)
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-23 14:32:47 +01:00
Nextcloud bot 422f3fe33b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-23 02:52:10 +00:00
Marino Faggiana 4f84009ceb refactor (#3999) 2026-02-22 13:14:11 +01:00
Nextcloud bot 33e7bd1c30 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-22 02:51:27 +00:00
Marino Faggiana fc61ab17fc Auto-MKCol-NC33 (#3998)
* autoMkcol -> NC 33 Auto upload

Signed-off-by: Marino Faggiana <[email protected]>

* autoMkcol

Signed-off-by: Marino Faggiana <[email protected]>

* added 423 error

Signed-off-by: Marino Faggiana <[email protected]>

* layout fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-21 17:20:36 +01:00
Marino Faggiana 747db66591 Some gui fix (#3997)
* refresh option menu

Signed-off-by: Marino Faggiana <[email protected]>

* replace error

Signed-off-by: Marino Faggiana <[email protected]>

* version 33.0.2

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-21 12:16:32 +01:00
Milen Pivchev 69cb8c5e1a Add support for passkeys on login (#3996)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Use ASWebAuthenticationSession

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-02-21 12:15:09 +01:00
Nextcloud bot 3b2da11a14 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-21 02:51:58 +00:00
Nextcloud bot 5b72ab1c7d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-20 02:55:31 +00:00
Marino Faggiana 03a4d5c5dc 3397 transfer system queue refactoring (#3995) 2026-02-19 12:26:45 +01:00
Nextcloud bot a70d6b0be2 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-19 03:04:57 +00:00
Marino Faggiana 3966537247 convert to trailingItemGroups
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-18 10:55:25 +01:00
Nextcloud bot 6e259c549e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-18 02:57:32 +00:00
Milen Pivchev c645761e8e Version change
Signed-off-by: Milen Pivchev <[email protected]>
2026-02-17 17:59:23 +01:00
Milen Pivchev 8c96522980 Version change
Signed-off-by: Milen Pivchev <[email protected]>
2026-02-17 12:13:13 +01:00
Marino Faggiana 688c5b5c5a added tintcolor (#3992)
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-17 11:24:58 +01:00
Marino Faggiana d99135d60a svg-fix (#3990)
* fix

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-17 09:43:37 +01:00
Nextcloud bot eb4915fb54 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-17 02:55:38 +00:00
Marino FaggianaandMilen Pivchev fd0de89732 Fix gui svg (#3989)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* test

Signed-off-by: Marino Faggiana <[email protected]>

* preferredSearchBarPlacement = .inline

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Milen Pivchev <[email protected]>
2026-02-16 18:37:29 +01:00
Milen Pivchev 21dc51e2cf Fix files-lock selection option (#3984)
Signed-off-by: Milen Pivchev <[email protected]>
2026-02-16 17:41:09 +01:00
Milen PivchevandMarino Faggiana 8d17de3904 Assistant Chat (#3978)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Send message

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* NCKit

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Add error handling

Signed-off-by: Milen Pivchev <[email protected]>

* fix assistantButtonItem

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>
2026-02-16 10:40:58 +01:00
Nextcloud bot f1aaccaee5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-16 02:57:04 +00:00
Marino Faggiana b805ed780b Gui (#3985) 2026-02-15 13:40:46 +01:00
Nextcloud bot fe71db905b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-15 02:56:38 +00:00
Nextcloud bot eb7ca0d614 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-14 02:57:26 +00:00
Nextcloud bot bdddbf5156 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-13 03:19:28 +00:00
Marino Faggiana 6c697ee0c7 Bugfix version (#3983)
* prj

Signed-off-by: Marino Faggiana <[email protected]>

* layout list search

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix widget

Signed-off-by: Marino Faggiana <[email protected]>

* widget

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix open-file

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-12 15:52:35 +01:00
Nextcloud bot 6820f7f6c7 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-12 02:57:55 +00:00
Marino Faggiana b6dddea2df SVG_Converter (#3975)
* NCSVGRenderer
2026-02-11 18:24:21 +01:00
Nextcloud bot 03990489e7 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-11 02:57:27 +00:00
Marino Faggiana fb3a32d3e1 new-nextcloudkit (#3982)
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-10 16:16:15 +01:00
Marino Faggiana e48472538f small-gui-fix (#3981)
* improvements

Signed-off-by: Marino Faggiana <[email protected]>

* b. 1

Signed-off-by: Marino Faggiana <[email protected]>

* GUI

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-10 12:36:29 +01:00
Marino Faggiana 9f34857553 Enhance files search (#3976)
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-10 10:25:52 +01:00
Nextcloud bot 45ed3479be fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-07 02:59:30 +00:00
Nextcloud bot d24972474e fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-06 03:18:45 +00:00
Nextcloud bot fe0a466bbc fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-05 02:59:19 +00:00
Marino Faggiana 84dc725cc2 set version library (#3973)
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-04 10:03:02 +01:00
Nextcloud bot 0e85bfbc75 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-04 02:57:45 +00:00
Marino Faggiana 4ff333e408 fix Context Menu (#3972)
* fix e2ee

Signed-off-by: Marino Faggiana <[email protected]>

* badge fix

Signed-off-by: Marino Faggiana <[email protected]>

* remove FloatingPanel

Signed-off-by: Marino Faggiana <[email protected]>

* FloatingPanel removed

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* new build

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-03 15:59:58 +01:00
Milen Pivchev e283eb9417 Refactor NCViewer menu
Signed-off-by: Milen Pivchev <[email protected]>
2026-02-03 13:41:14 +01:00
Marino Faggiana 3b1c11529b fix-banner-ipad (#3971)
* banner

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-03 13:39:02 +01:00
Milen Pivchev 24556375d3 Replace floating panel with context menus (#3958)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Comments

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor2

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-02-03 13:37:26 +01:00
Marino Faggiana 13057e1237 fix-banner-ipad (#3968)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-02-02 14:34:27 +01:00
Marino Faggiana 092e1b4495 update LucidBanner (#3967)
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-02 11:48:31 +01:00
Marino Faggiana 1b9023f7f6 code
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-02 11:38:46 +01:00
Marino Faggiana 0642417712 code
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-02 11:14:13 +01:00
Marino Faggiana 2e6256fb24 code
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-01 14:36:53 +01:00
Marino Faggiana 9d42847cad code
Signed-off-by: Marino Faggiana <[email protected]>
2026-02-01 13:45:00 +01:00
Nextcloud bot 177448d9c6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-02-01 02:59:16 +00:00
Nextcloud bot 3b1697262c fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-31 02:58:13 +00:00
Marino Faggiana 0ae45e2585 Qrcode onetime (#3965)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* Auto-MKCol (#3963)

* added new header

Signed-off-by: Marino Faggiana <[email protected]>

* test

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* Message error (#3964)

* fix timer

Signed-off-by: Marino Faggiana <[email protected]>

* added errorCode

Signed-off-by: Marino Faggiana <[email protected]>

* shownErrors

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>

* fix error message

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* move in async

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-01-30 12:59:34 +01:00
Marino Faggiana 9c59c07c78 Message error (#3964)
* fix timer

Signed-off-by: Marino Faggiana <[email protected]>

* added errorCode

Signed-off-by: Marino Faggiana <[email protected]>

* shownErrors

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-01-30 12:01:56 +01:00
Marino Faggiana 6cf12f458e Auto-MKCol (#3963)
* added new header

Signed-off-by: Marino Faggiana <[email protected]>

* test

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-01-30 10:08:35 +01:00
Marino Faggiana 0fa68e1ed5 searchmedia-fix (#3957)
* clean

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-01-28 14:20:35 +01:00
Marino Faggiana 1f2d6b30e8 added searchMedia (#3956)
Signed-off-by: Marino Faggiana <[email protected]>
2026-01-28 10:29:40 +01:00
Nextcloud bot a4f1030321 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-28 03:00:56 +00:00
Marino Faggiana 4e334480d0 banner (#3955)
Signed-off-by: Marino Faggiana <[email protected]>
2026-01-27 09:59:12 +01:00
Marino Faggiana 9f2d87486f Banner-Update-library (#3954)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-01-26 11:40:06 +01:00
Marino Faggiana d38ff4c8f5 Banner fix (#3953) 2026-01-24 17:07:35 +01:00
Nextcloud bot 047d02b257 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-24 02:58:25 +00:00
Nextcloud bot c634032add fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-23 03:00:17 +00:00
Milen Pivchev 85a920d91e Context menu fixes (#3949)
* Context menu fixes

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Add locked by text

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-01-22 17:52:20 +00:00
Marino Faggiana 300e71550a E2ee21 (#3950)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-01-22 14:40:07 +01:00
Nextcloud bot ea20256e1f fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-21 02:47:46 +00:00
Nextcloud bot 4bc3271632 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-19 02:50:49 +00:00
Nextcloud bot 88e435c756 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-18 02:40:46 +00:00
Marino Faggiana b2eaac27a0 Banner (#3948)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* showMessageBanner

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* Revert "code"

This reverts commit 11b4cf9c8b.

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2026-01-17 16:36:24 +01:00
Nextcloud bot 29f852c054 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-17 02:37:19 +00:00
Milen PivchevandMarino Faggiana eda8749a3b Client integration (#3762)
* Add menu

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Replace sheet with native context menu

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Use relative file path

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* API

Signed-off-by: Milen Pivchev <[email protected]>

* Error handling

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Sendable fix

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Bring back more button in list

This reverts commit c3dee5a512.

Signed-off-by: Milen Pivchev <[email protected]>

* Revert more button in grid

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

This reverts commit 22eae10183.

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Recommendations menu

Signed-off-by: Milen Pivchev <[email protected]>

* Photo cell fix

Signed-off-by: Milen Pivchev <[email protected]>

* Resize icons

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* remove old code

Signed-off-by: Marino Faggiana <[email protected]>

* remove old code

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* added onMenuIntent

Signed-off-by: Marino Faggiana <[email protected]>

* normalized

Signed-off-by: Marino Faggiana <[email protected]>

* normalized

Signed-off-by: Marino Faggiana <[email protected]>

* TransferDelegate

Signed-off-by: Marino Faggiana <[email protected]>

* transferReloadData

Signed-off-by: Marino Faggiana <[email protected]>

* test

Signed-off-by: Marino Faggiana <[email protected]>

* incredible strategy

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* Media

Signed-off-by: Marino Faggiana <[email protected]>

* License

Signed-off-by: Marino Faggiana <[email protected]>

* add Helper

Signed-off-by: Marino Faggiana <[email protected]>

* Improved code

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* hide button more in photo cell

Signed-off-by: Marino Faggiana <[email protected]>

* improved

Signed-off-by: Marino Faggiana <[email protected]>

* 2026

Signed-off-by: Marino Faggiana <[email protected]>

* 2026

Signed-off-by: Marino Faggiana <[email protected]>

* cell protocol improvements

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning code

Signed-off-by: Marino Faggiana <[email protected]>

* lint

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning (Lint)

Signed-off-by: Marino Faggiana <[email protected]>

* lint

Signed-off-by: Marino Faggiana <[email protected]>

* NCContextMenu

Signed-off-by: Marino Faggiana <[email protected]>

* NCContextMenu

Signed-off-by: Marino Faggiana <[email protected]>

* doc

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Marino Faggiana <[email protected]>
2026-01-16 13:37:55 +01:00
Nextcloud bot 62c6688cda fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-16 02:50:56 +00:00
Nextcloud bot 223967604d fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-15 02:41:41 +00:00
Nextcloud bot f7eac5e279 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-14 02:40:28 +00:00
Nextcloud bot d1e4580988 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-13 02:45:19 +00:00
Marino Faggiana 5cf0f9cbc3 Debouncer (#3946)
* Pause added

* Update UploadBannerView.swift

* Update NCGlobal.swift
2026-01-12 14:00:23 +01:00
Milen Pivchev e08217ade2 Fix player not showing position and max length when opening media (#3940)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* WIOP

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Deinit now playing window (#3943)

* Deinit now playing info

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-01-12 14:00:04 +01:00
Milen Pivchev dd08908e0b Update privacy descriptions (#3934)
* Update privacy descriptions

Signed-off-by: Milen Pivchev <[email protected]>

* Change to generic

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-01-12 11:50:18 +01:00
Milen Pivchev 645dc1c651 Remove code from content presenter when not debug (#3935)
Signed-off-by: Milen Pivchev <[email protected]>
2026-01-12 11:49:23 +01:00
Milen PivchevandCopilot 098eb69aec Use unicode regex for email validation (#3936)
* Use unicode regex for email validation

Signed-off-by: Milen Pivchev <[email protected]>

* Update iOSClient/Share/NCShare.swift

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Copilot <[email protected]>
2026-01-12 11:48:42 +01:00
Milen Pivchev 03ae97a1e6 Fix lock not updating when disabling it via FaceID (#3937)
* Fix passcode lock not updating with faceid

Signed-off-by: Milen Pivchev <[email protected]>

* More loc fixes

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-01-12 11:47:55 +01:00
Milen Pivchev ecad9b14ff Improve "_account_unauthorized_" message (#3944)
* Improve message

Signed-off-by: Milen Pivchev <[email protected]>

* WIP

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2026-01-12 11:44:52 +01:00
Nextcloud bot 83626d1f69 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2026-01-06 02:36:47 +00:00
Nextcloud bot bc7de9df37 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-29 02:37:59 +00:00
Nextcloud bot e533e0f3de fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-27 02:35:25 +00:00
Nextcloud bot ae575ff2e9 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-23 02:38:01 +00:00
Nextcloud bot 6d0a5a40a0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-19 02:37:08 +00:00
Marino Faggiana bb28e74934 // Fix schema version from version 6.2.5
Signed-off-by: Marino Faggiana <[email protected]>
2025-12-18 11:23:46 +01:00
Marino Faggiana d29d3bf807 Bkg test (#3933)
* fix

Signed-off-by: Marino Faggiana <[email protected]>

* build 3

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-12-18 10:25:01 +01:00
Marino Faggiana d117f954b4 Header Empty Data fix (#3930) 2025-12-17 10:46:58 +01:00
Nextcloud bot 2a81f7ffa0 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-17 02:36:26 +00:00
Nextcloud bot a26b112401 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-16 02:50:34 +00:00
Marino Faggiana 0bcc14b673 Update NCViewerRichDocument.swift (#3929) 2025-12-15 15:36:56 +01:00
Nextcloud bot c93e8fe2eb fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-15 02:43:33 +00:00
Marino Faggiana 0bb65a8c11 Update project.pbxproj 2025-12-14 10:53:46 +01:00
Marino Faggiana c39117b64b clean 2025-12-14 10:53:25 +01:00
Marino Faggiana c8ea8415a3 Update UploadBannerView.swift 2025-12-14 10:50:06 +01:00
Milen Pivchev a73837624e Fix overflow (#3915)
Signed-off-by: Milen Pivchev <[email protected]>
2025-12-14 09:23:32 +01:00
Marino Faggiana 0f84188727 Fix general (#3916)
* Update UploadBannerView.swift
2025-12-14 09:22:45 +01:00
Nextcloud bot 392c787263 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-14 02:37:45 +00:00
Nextcloud bot 4438993e89 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-13 02:34:27 +00:00
Marino Faggiana 9881d86c01 Update Banner (#3914)
* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-12-12 12:23:34 +01:00
Marino Faggiana 7e92494d84 Ipad lb (#3913) 2025-12-12 11:21:13 +01:00
Nextcloud bot b08e0cd2c4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-12 02:37:15 +00:00
Nextcloud bot 959d9dca9a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-11 02:35:50 +00:00
Marino Faggiana bd0f4e3500 LiquidBanner (#3911) 2025-12-10 17:55:18 +01:00
Marino Faggiana 9a1c0a8092 fix (#3910)
Signed-off-by: Marino Faggiana <[email protected]>
2025-12-10 16:08:59 +01:00
Milen Pivchev d29548bb21 Fixes for scan quick look (#3908)
* WIP

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

* Refactor

Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
2025-12-10 16:06:21 +01:00
Nextcloud bot 84a49a37ec fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-10 02:37:36 +00:00
Nextcloud bot 743a9eb4ec fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-09 02:39:07 +00:00
Nextcloud bot 7829a20425 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-08 02:34:09 +00:00
Marino Faggiana b8577cbd7e cleaning lib
Signed-off-by: Marino Faggiana <[email protected]>
2025-12-07 12:32:39 +01:00
Marino Faggiana caf9c59b92 code
Signed-off-by: Marino Faggiana <[email protected]>
2025-12-06 15:04:17 +01:00
Marino Faggiana 9905669de0 cod
Signed-off-by: Marino Faggiana <[email protected]>
2025-12-06 14:35:24 +01:00
Marino Faggiana 87283c7103 code
Signed-off-by: Marino Faggiana <[email protected]>
2025-12-06 13:57:47 +01:00
Marino Faggiana b9871f8462 GUI Banner (#3904) 2025-12-06 09:51:58 +01:00
Nextcloud bot 0ebf1bea50 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-06 02:36:36 +00:00
Nextcloud bot 4e14c91f62 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-05 02:34:45 +00:00
Nextcloud bot e3af862207 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-04 02:34:37 +00:00
Marino Faggiana f0a571cc32 GUI improvements (#3903)
* Update NCSelect.swift

* DragDrop

* Update NCDragDrop.swift

* rename

* fix

* code
2025-12-03 16:11:29 +01:00
Nextcloud bot 7cd8e423d6 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-03 02:35:23 +00:00
Marino Faggiana 0a15335da3 GUI banner (#3901) 2025-12-02 12:04:10 +01:00
Nextcloud bot ae34d1a7ff fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-02 02:38:11 +00:00
Marino Faggiana ee0d5b8319 Lucid Banner Views (#3898)
* test

Signed-off-by: Marino Faggiana <[email protected]>

* remove code

Signed-off-by: Marino Faggiana <[email protected]>

* mainAppWindow

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* Code refactoring

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-12-01 15:49:08 +01:00
Milen Pivchev 9120e3783f Remove middle dot seperator in tags (#3896)
Signed-off-by: Milen Pivchev <[email protected]>
2025-12-01 15:32:53 +01:00
Milen Pivchev 821c1bac8e Update download limit only when changed by user (#3899)
Signed-off-by: Milen Pivchev <[email protected]>
2025-12-01 15:31:54 +01:00
Nextcloud bot f43a4753f1 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-12-01 02:36:08 +00:00
Nextcloud bot cabdd6776b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-30 02:38:35 +00:00
Nextcloud bot c7e77958e8 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-29 02:35:25 +00:00
Nextcloud bot 038446a18a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-28 02:33:53 +00:00
Milen Pivchev a9ae9e6b9e Fix status message screen
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-27 15:43:41 +01:00
Marino Faggiana 62d114ed82 Hud (#3894)
* fix reloaddatasource download favorite

Signed-off-by: Marino Faggiana <[email protected]>

* add HUD

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* local

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-27 15:05:43 +01:00
Milen Pivchev 12605002df WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-27 14:27:12 +01:00
Milen Pivchev c2e8d47292 Merge branch 'master' of https://github.com/nextcloud/ios into handle-permissions 2025-11-27 14:20:31 +01:00
Milen Pivchev c576fd9f6f PR fixes
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-27 14:17:37 +01:00
Nextcloud bot 8c87f8c736 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-27 02:40:20 +00:00
Marino Faggiana 35d1cbe4d9 Lucid banner (#3844)
* Banner replace

Signed-off-by: Marino Faggiana <[email protected]>

* uploadChunkFile

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* improved

Signed-off-by: Marino Faggiana <[email protected]>

* Update NCNetworking+Upload.swift

* Update NCNetworking+Upload.swift

* code

Signed-off-by: Marino Faggiana <[email protected]>

* test

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* ToastBannerView

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* more error time

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* rebase fix

* rebase fix

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* scene

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* scene

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* new version

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-26 16:55:05 +01:00
Milen Pivchev d6a612c68d Merge branch 'master' of https://github.com/nextcloud/ios into split-user 2025-11-26 16:43:33 +01:00
Milen Pivchev ade9bfb16c Remove comments
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-26 16:43:22 +01:00
Milen Pivchev a08ab7123b Remove old code
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-26 16:41:12 +01:00
Milen Pivchev 93e745e912 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-26 16:36:36 +01:00
Milen Pivchev f4b3bc709d WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-26 16:32:20 +01:00
Milen Pivchev 41a4c1e746 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-26 16:27:11 +01:00
Milen Pivchev 67500a266f WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-26 15:43:01 +01:00
Milen Pivchev 556936369d WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-26 11:34:55 +01:00
Nextcloud bot abd09e5bf4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-25 02:42:11 +00:00
Marino Faggiana 0565a24caf Protocol flush (#3885) 2025-11-22 12:25:18 +01:00
Marino Faggiana 44598f8ac3 feat: cache content of different tabs (#3884)
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-21 10:04:00 +01:00
Milen Pivchev 9b8b989790 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-20 18:19:42 +01:00
Milen Pivchev 18cd6048ed WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-20 16:43:22 +01:00
Marino Faggiana 35bd87bedf Live Photo improvements (#3883)
* fix delete message

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* lint

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-20 11:13:37 +01:00
Nextcloud bot 439275af73 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-20 02:41:13 +00:00
Milen Pivchev 3892467e7b WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-19 14:41:59 +01:00
Milen Pivchev 5ea5172bc2 WIP
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-19 14:00:51 +01:00
7408647n 9eb7e1a9fb Fix: plus button is not in brand color (#3880) 2025-11-19 07:59:39 +01:00
Nextcloud bot 99647e3ec5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-19 02:40:09 +00:00
Marino Faggiana 5483ce91d7 fix (#3882)
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-18 18:35:13 +01:00
Marino Faggiana 5f9874d282 new version (#3881)
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-18 11:13:08 +01:00
Marino Faggiana f02ae46798 fix - Merged
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-18 11:05:16 +01:00
Marino Faggiana 59e4e15479 Fix FPE (#3878) 2025-11-18 10:59:41 +01:00
Nextcloud bot ea0bfd4ebb fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-18 02:38:35 +00:00
Marino Faggiana 1143a37b64 code
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-17 15:48:30 +01:00
Marino Faggiana de314a7539 closed. (#3879)
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-17 11:57:06 +01:00
Nextcloud bot ae1dc2e3e7 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-16 02:33:15 +00:00
Nextcloud bot d19ec07078 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-15 02:34:08 +00:00
Nextcloud bot c85ff69fc4 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-14 02:33:50 +00:00
Marino Faggiana de089a6716 General fix (#3876)
* fix media title

Signed-off-by: Marino Faggiana <[email protected]>

* remove old variable

Signed-off-by: Marino Faggiana <[email protected]>

* fix tabBarController

Signed-off-by: Marino Faggiana <[email protected]>

* License

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

* setNavigationBarAppearance

Signed-off-by: Marino Faggiana <[email protected]>

* code

Signed-off-by: Marino Faggiana <[email protected]>

* bo?

Signed-off-by: Marino Faggiana <[email protected]>

* iPad FIX

Signed-off-by: Marino Faggiana <[email protected]>

* fix Media media only (remove video part livephoto)

Signed-off-by: Marino Faggiana <[email protected]>

* build 1

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-13 17:31:16 +01:00
Milen Pivchev ce4051350d Change ver (#3875)
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-13 17:30:58 +01:00
Nextcloud bot 3dbeb07305 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-13 02:36:56 +00:00
Marino Faggiana 98a738a036 cleaning (#3874)
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-12 16:06:40 +01:00
Milen Pivchev 8136cc73f9 Sort shares by date (#3871)
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-12 15:16:57 +01:00
Marino FaggianaandCopilot da430883f5 Auto Upload (#3873)
* fix auto upload

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

* improvements

Signed-off-by: Marino Faggiana <[email protected]>

* fix counter

Signed-off-by: Marino Faggiana <[email protected]>

* new version

Signed-off-by: Marino Faggiana <[email protected]>

* debouncer / transferChange

Signed-off-by: Marino Faggiana <[email protected]>

* Update iOSClient/Utility/NCDebouncer.swift

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>

* Update iOSClient/Menu/NCContextMenu.swift

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
Co-authored-by: Copilot <[email protected]>
2025-11-12 15:15:53 +01:00
Milen Pivchev 5541955913 Merge branch 'master' of https://github.com/nextcloud/ios 2025-11-10 17:08:58 +01:00
Milen Pivchev 235d0a3d4e Update NC Kit
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-10 17:08:38 +01:00
Milen Pivchev 5c345434e3 Refactor (#3865)
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-10 16:56:24 +01:00
Milen Pivchev 8af20c5e8f Update NC Kit
Signed-off-by: Milen Pivchev <[email protected]>
2025-11-10 13:31:11 +01:00
Marino Faggiana 0fb21e4b3b added X509_verify(cert, serverPubKey) (#3861)
* added X509_verify(cert, serverPubKey)

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-10 10:34:14 +01:00
Milen PivchevandCopilot f38a79e540 Refactor share types and permissions (#3862)
* Refactor shares

Signed-off-by: Milen Pivchev <[email protected]>

* Update iOSClient/Share/Advanced/NCShareDateCell.swift

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Milen Pivchev <[email protected]>

---------

Signed-off-by: Milen Pivchev <[email protected]>
Co-authored-by: Copilot <[email protected]>
2025-11-10 10:06:30 +01:00
Marino Faggiana 84d44f2bf8 FPE (#3870)
* fix create folder

Signed-off-by: Marino Faggiana <[email protected]>

* build 2

Signed-off-by: Marino Faggiana <[email protected]>

* CI

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-10 10:06:08 +01:00
Nextcloud bot 52146ac79a fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-10 02:32:17 +00:00
Marino Faggiana 47fc38d5ce Fpe database (#3868)
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-09 14:28:22 +01:00
Marino Faggiana bf284ac5bb Project (#3867)
* isAppInBackground LivePhoto

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

* proj

Signed-off-by: Marino Faggiana <[email protected]>

* prj

Signed-off-by: Marino Faggiana <[email protected]>

* prj

Signed-off-by: Marino Faggiana <[email protected]>

* proj

Signed-off-by: Marino Faggiana <[email protected]>

* proj

Signed-off-by: Marino Faggiana <[email protected]>

* proj

Signed-off-by: Marino Faggiana <[email protected]>

* proj

Signed-off-by: Marino Faggiana <[email protected]>

* prj

Signed-off-by: Marino Faggiana <[email protected]>

* proj

Signed-off-by: Marino Faggiana <[email protected]>

* prj

Signed-off-by: Marino Faggiana <[email protected]>

* prj

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-08 18:09:34 +01:00
Marino Faggiana 138830fbd8 Fix HTML entities in README (#3866)
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-08 11:35:33 +01:00
Marino Faggiana 44aed13e13 Animation
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-08 11:33:54 +01:00
Marino Faggiana 8c8844fab4 Fpe memory (#3864)
* XCode 26.1

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-08 09:58:28 +01:00
Nextcloud bot 1411997684 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-08 02:32:58 +00:00
Nextcloud bot 789f863137 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-07 02:34:20 +00:00
Nextcloud bot 282498314b fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-06 02:33:33 +00:00
Nextcloud bot f3892b3940 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-05 02:33:22 +00:00
Nextcloud bot 5d545866ba fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-04 02:32:54 +00:00
Marino Faggiana fe258b8a5a restore clear log file (#3858)
Signed-off-by: Marino Faggiana <[email protected]>
2025-11-03 07:41:11 +01:00
Nextcloud bot bd7c73f413 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-03 02:34:10 +00:00
Marino Faggiana 1759cc9413 BGD (#3856)
* cod

Signed-off-by: Marino Faggiana <[email protected]>

* build 1

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-02 17:05:42 +01:00
Nextcloud bot df27f5a1ae fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-02 02:31:28 +00:00
Marino Faggiana b17a0e4df4 Cleaning in Processing Task (#3851)
* cleaningWeek

Signed-off-by: Marino Faggiana <[email protected]>

* cleaningWeek

Signed-off-by: Marino Faggiana <[email protected]>

* app

Signed-off-by: Marino Faggiana <[email protected]>

* cleaning every week

Signed-off-by: Marino Faggiana <[email protected]>

* fix

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-11-01 09:15:01 +01:00
Nextcloud bot 89485a9886 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-11-01 02:30:25 +00:00
rakekniven 5b667d7a99 chore(l10n): Fix typo in confirmation string for resetting uploads (#3846)
Reportet at Transifex

Signed-off-by: rakekniven <[email protected]>
2025-10-31 13:24:11 +01:00
Marino Faggiana af9a6ee749 fix flush (#3848)
* Update NCMetadataTranfersSuccess.swift

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* cod

Signed-off-by: Marino Faggiana <[email protected]>

* clean

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-10-31 13:16:46 +01:00
Nextcloud bot b24a1685b9 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-31 02:32:57 +00:00
Marino Faggiana ae2a8c6711 New V 7.1.9 (#3843)
* new version

Signed-off-by: Marino Faggiana <[email protected]>

* Use 26

Signed-off-by: Marino Faggiana <[email protected]>

* 26

Signed-off-by: Marino Faggiana <[email protected]>

---------

Signed-off-by: Marino Faggiana <[email protected]>
2025-10-29 12:13:05 +01:00
Marino Faggiana 37f566949e Update project.pbxproj 2025-10-28 13:29:30 +01:00
Marino Faggiana 19921dccaa Update project.pbxproj 2025-10-28 13:26:37 +01:00
Marino Faggiana 38a598c165 version 7.1.8 (#3841)
* version

* fix
2025-10-28 13:19:08 +01:00
Nextcloud bot 9224f829b5 fix(l10n): Update translations from Transifex
Signed-off-by: Nextcloud bot <[email protected]>
2025-10-28 02:36:28 +00:00
752 changed files with 59330 additions and 25851 deletions

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
# SPDX-FileCopyrightText: Nextcloud GmbH
# SPDX-FileCopyrightText: 2026 Milen Pivchev
# SPDX-License-Identifier: GPL-3.0-or-later
version: 2
updates:
# SPM packages declared in Nextcloud.xcodeproj (NextcloudKit, Realm, Firebase, …)
- package-ecosystem: "swift"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
labels:
- "dependencies"
commit-message:
prefix: "fix(deps)"
# Keep the GitHub Actions used by our workflows up to date
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
commit-message:
prefix: "ci"
+1 -1
View File
@@ -26,7 +26,7 @@ jobs:
steps:
- name: Set env var
run: echo "DEVELOPER_DIR=$(xcode-select --print-path)" >> $GITHUB_ENV
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Download GoogleService-Info.plist
run: wget "https://raw.githubusercontent.com/firebase/quickstart-ios/master/mock-GoogleService-Info.plist" -O GoogleService-Info.plist
- name: Build iOS Share
+1 -1
View File
@@ -24,7 +24,7 @@ jobs:
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: GitHub Action for SwiftLint
uses: norio-nomura/[email protected]
+17 -15
View File
@@ -19,6 +19,7 @@ env:
PROJECT: Nextcloud.xcodeproj
DESTINATION: platform=iOS Simulator,name=iPhone 16,OS=18.5
SCHEME: Nextcloud
XCODE_VERSION: '26.0.1'
SERVER_BRANCH: stable30
PHP_VERSION: 8.3
@@ -29,15 +30,15 @@ jobs:
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v7
- name: Download GoogleService-Info.plist
run: wget "https://raw.githubusercontent.com/firebase/quickstart-ios/master/mock-GoogleService-Info.plist" -O GoogleService-Info.plist
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: 16.4
xcode-version: ${{ env.XCODE_VERSION }}
- name: Run Xcode Build
run: |
@@ -49,7 +50,7 @@ jobs:
| xcbeautify --quieter
- name: Upload Build Products
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: Nextcloud for iOS
path: DerivedData/Build/Products
@@ -60,12 +61,15 @@ jobs:
runs-on: macos-15
needs: [build]
# Temporarily, project has no effective tests except UI tests which are unfeasible on virtualized GitHub runners (see #3291)
# Previously: github.event.pull_request.draft == false
if: false
if: github.event.pull_request.draft == false
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1.7.0
with:
xcode-version: ${{ env.XCODE_VERSION }}
- name: Prepare PHP ${{ env.PHP_VERSION }}
uses: shivammathur/setup-php@v2
@@ -78,7 +82,7 @@ jobs:
ini-values: apc.enable_cli=on, disable_functions=
- name: Checkout Nextcloud Server
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
submodules: true
repository: nextcloud/server
@@ -86,7 +90,7 @@ jobs:
ref: ${{ env.SERVER_BRANCH }}
- name: Checkout Download Limits App
uses: actions/checkout@v4
uses: actions/checkout@v7
with:
repository: nextcloud/files_downloadlimit
path: server/apps/files_downloadlimit
@@ -99,14 +103,12 @@ jobs:
./server/occ config:system:set hashing_default_password --value=true --type=boolean
./server/occ config:system:set auth.bruteforce.protection.enabled --value false --type bool
./server/occ config:system:set ratelimit.protection.enabled --value false --type bool
./server/occ config:system:set memcache.local --value="\\OC\\Memcache\\APCu"
./server/occ config:system:set memcache.distributed --value="\\OC\\Memcache\\APCu"
./server/occ app:enable files_downloadlimit
./server/occ background:cron
PHP_CLI_SERVER_WORKERS=5 php -S localhost:8080 -t server/ &
- name: Download Build
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: Nextcloud for iOS
@@ -139,7 +141,7 @@ jobs:
-resultBundlePath "TestResult.xcresult"
- name: Upload Xcode Test Results
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
if: ${{ !cancelled() }}
with:
name: TestResult.xcresult
+2 -6
View File
@@ -35,12 +35,8 @@ DerivedData
*.hmap
*.xccheckout
## Package
Carthage/
### SwiftPackageManager ###
.swiftpm
Package.resolved
*.generated.swift
/.env-vars
## Claude Code
.claude/
+1
View File
@@ -47,5 +47,6 @@ excluded:
- iOSClient/NCGlobal.swift
- iOSClient/Utility/NCLivePhoto.swift
- DerivedData
- .claude
reporter: "xcode"
+93
View File
@@ -0,0 +1,93 @@
<!--
- SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
- SPDX-License-Identifier: GPL-3.0-or-later
-->
# AGENTS.md
## Your Role
- You are an experienced engineer specialized in Swift and familiar with the platform-specific details of iOS.
- You implement features and fix bugs.
- Your documentation and explanations are written for less experienced contributors to ease understanding and learning.
- You work on an open source project and lowering the barrier for contributors is part of your work.
## Project Overview
The Nextcloud iOS Client is a tool to access and synchronize files from Nextcloud Server on your iPhone or iPad.
Swift, UIKit and SwiftUI are the key technologies used for building the app on iOS.
Server communication is handled by the NextcloudKit library — a separate repository (https://github.com/nextcloud/NextcloudKit) consumed as a Swift Package pinned to an exact version in `Nextcloud.xcodeproj`. Prefer its APIs over hand-rolled networking code; server API changes belong in that repo.
Other key dependencies (all Swift Packages): Realm (local database), Alamofire (HTTP), Firebase (crash reporting), OpenSSL (end-to-end encryption), VLCKit (media playback). Prefer existing dependencies over adding new ones.
Other platforms like Android are irrelevant for this project.
## Project Structure: AI Agent Handling Guidelines
| Directory | Description | Agent Action |
|-----------------|-----------------------------------------------------|----------------------|
| `.github` | GitHub CI workflows (build & test, SwiftLint, extension-target builds) and issue templates. | Keep all three checks green: `xcode.yml` (builds the `Nextcloud` scheme and runs its tests against a Nextcloud server provisioned in CI), `lint.yml` (SwiftLint), `additional-targets.yml` (build-checks the extension schemes). CI skips draft PRs. |
| `iOSClient` | Main iOS client source code. | — |
| `iOSClient/Supporting Files` | Translation files synced with Transifex (see `iOSClient/.tx/config`). | Only add new strings to `en.lproj` (`Localizable.strings`, plurals in `Localizable.stringsdict`); never edit the other `*.lproj` dirs — Transifex overwrites them. |
| `Brand` | Branding layer: `NCBrand.swift` (app constants, colors), `Database.swift` (Realm database name and schema version), Info.plists and entitlements for all targets, launch screen and intro screens. | Bump `databaseSchemaVersion` in `Brand/Database.swift` when changing Realm models. |
| `File Provider Extension` | Contains business logic for the iOS File Provider extension. | — |
| `File Provider Extension UI` | Contains UI logic for the iOS File Provider extension. | — |
| `Share` | Contains code for the iOS Share extension. | — |
| `Widget` | Contains code for iOS Widgets. | — |
| `WidgetDashboardIntentHandler` | Contains the intent handler for the dashboard widget. | — |
| `Notification Service Extension` | Contains the push notification service extension. | — |
| `Action Assistant` | iOS Action extension that receives shared text from other apps and forwards it to the in-app Nextcloud Assistant. | — |
| `AppIcon.icon` | Icon Composer app-icon bundle. | Do not edit by hand; use Icon Composer. |
| `Tests` | Unit tests (`NextcloudUnitTests`), UI tests (`NextcloudUITests`) and integration tests (`NextcloudIntegrationTests`), plus `TestConstants.swift` and the `Server.sh` test-server script. | Prefer `NextcloudUnitTests` for new tests. Try to add unit tests for new features, where applicable and makes sense; do not overcomplicate them. |
Keep this table up to date: when a change adds, removes or repurposes a directory listed here, update the table in the same PR.
## General Guidance
The project is licensed under GPL-3.0-or-later (`LICENSE.txt`) with an Apple App Store exception (`COPYING.iOS`).
Every new file needs to get a SPDX header in the first rows according to this template.
Replace `<YEAR>` with the year the file is created and `<Author Name>` with the contributing author (Nextcloud has no CLA; copyright stays with the individual contributors).
The commenting signs need to be used depending on the file type.
```plaintext
SPDX-FileCopyrightText: Nextcloud GmbH
SPDX-FileCopyrightText: <YEAR> <Author Name>
SPDX-License-Identifier: GPL-3.0-or-later
```
Some older files still carry legacy “Created by … All rights reserved” Xcode headers — do not copy that style into new files. There is no automated SPDX check in CI, so header correctness is on you.
Avoid creating source files that implement multiple types; instead, place each type in its own dedicated source file.
## Commit and Pull Request Guidelines
- **DCO sign-off (required)**: All commits must comply with the Developer Certificate of Origin (DCO) as described in `README.md` and include a `Signed-off-by: …` line in the commit message. Sign off with `git commit -s`; the DCO status check blocks PRs otherwise.
- **Commits**: In addition to the DCO sign-off, follow the Conventional Commits format for the subject line where reasonable. Use `feat: ...`, `fix: ...`, or `refactor: ...` as appropriate in the commit message prefix.
- Include a short summary of what changed. *Example:* `fix: prevent crash on empty file name`.
- **Pull Request**: When the agent creates a PR, it should include a description summarizing the changes and why they were made. If a GitHub issue exists, reference it (e.g., “Closes #123”). Target `master` (the default branch); `stable-XX.Y.Z` branches are only for backports. Note that `README.md` still mentions a `develop` branch — it no longer exists.
- **AI-assisted changes**: Declare AI tool use in the PR description (the org-level PR template includes an AI checkbox) and add an `Assisted-by: AGENT_NAME:MODEL_VERSION` trailer to each affected commit, per the org-wide policy in `nextcloud/.github`.
## iOS Specifics
The following details are important when working on the iOS client.
### Requirements
- Use at least the Xcode version pinned in `.github/workflows/xcode.yml` — that is what CI builds and tests with.
- A `GoogleService-Info.plist` must exist at the repo root to build; CI downloads Firebase's mock plist (see `xcode.yml`).
### Code Style
- Write new code to be Swift 6-compatible and strict-concurrency-friendly (proper actor isolation, `Sendable` types). Note that the project currently builds in Swift 5 language mode without strict concurrency checking, so the compiler will not enforce this.
- CI runs SwiftLint on every non-draft PR using the root `.swiftlint.yml`; `Tests/`, `Brand/NCBrand.swift`, `iOSClient/NCGlobal.swift` and `iOSClient/Utility/NCLivePhoto.swift` are excluded from linting.
### Tests
- When implementing new test suites, prefer Swift Testing over XCTest for implementation. UI tests are the exception — XCUITest requires XCTest, so new UI tests are XCTest classes subclassing `BaseUIXCTestCase` in `Tests/NextcloudUITests`.
- New unit tests go in `Tests/NextcloudUnitTests` as Swift Testing `@Suite` structs with `@testable import Nextcloud`; they need no server.
- When implementing test cases using Swift Testing, do not prefix test method names with "test".
- If the implementation of mock types is inevitable, implement them in dedicated source code files and in a generic way, so they can be reused across all tests in a test target. Currently no mock types or mocking library exist; reusable UI-test helpers live in `Tests/NextcloudUITests` (`UITestBackend` and its `Responses/` decodables) — extend these before adding new ones.
- If the implementation of an existing mock type does not fulfill the requirements introduced by new tests, prefer updating the existing type before implementing a mostly redundant alternative type.
- UI tests require a Nextcloud server at `http://localhost:8080` (credentials `admin`/`admin`, see `Tests/TestConstants.swift`); start one with `Tests/Server.sh` (requires Docker). CI provisions the same server.
- `NextcloudIntegrationTests` is currently an empty target: `LoginIntegrationTests.swift` is on disk but excluded from the build and references a nonexistent `EnvVars` type — do not model new tests on it.
- Verify that all tests are passing and correct them if necessary.
- Run tests the way CI does (see `.github/workflows/xcode.yml`): `xcodebuild test -scheme Nextcloud -destination "platform=iOS Simulator,name=iPhone 16,OS=18.5"` (adjust the simulator to what is installed locally). Without a local test server, restrict to `-only-testing:NextcloudUnitTests`.
+148
View File
@@ -0,0 +1,148 @@
//
// ActionViewController.swift
// Action Assistant
//
// Created by Marino Faggiana on 14/05/2026.
// Copyright © 2026 Marino Faggiana. All rights reserved.
//
import UIKit
import NextcloudKit
import UniformTypeIdentifiers
final class ActionViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.isHidden = true
view.alpha = 0
view.backgroundColor = .clear
preferredContentSize = .zero
Task {
await handleAction()
}
}
private func handleAction() async {
guard let text = await loadText() else {
extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
return
}
NCAssistantSharedTextStore.save(text)
openMainAppForAssistantSharedText()
}
private func loadText() async -> String? {
guard let extensionItems = extensionContext?.inputItems as? [NSExtensionItem] else {
return nil
}
for extensionItem in extensionItems {
guard let attachments = extensionItem.attachments else {
continue
}
for provider in attachments {
if provider.hasItemConformingToTypeIdentifier(UTType.plainText.identifier) {
return await loadText(from: provider, typeIdentifier: UTType.plainText.identifier)
}
if provider.hasItemConformingToTypeIdentifier(UTType.utf8PlainText.identifier) {
return await loadText(from: provider, typeIdentifier: UTType.utf8PlainText.identifier)
}
if provider.hasItemConformingToTypeIdentifier(UTType.text.identifier) {
return await loadText(from: provider, typeIdentifier: UTType.text.identifier)
}
}
}
return nil
}
private func loadText(from provider: NSItemProvider, typeIdentifier: String) async -> String? {
await withCheckedContinuation { continuation in
provider.loadItem(forTypeIdentifier: typeIdentifier, options: nil) { item, _ in
let text: String?
if let string = item as? String {
text = string
} else if let attributedString = item as? NSAttributedString {
text = attributedString.string
} else if let data = item as? Data {
text = String(data: data, encoding: .utf8)
} else if let url = item as? URL {
text = try? String(contentsOf: url, encoding: .utf8)
} else {
text = nil
}
guard let text, !text.trimmingCharacters(in: .whitespacesAndNewlines).isEmpty else {
continuation.resume(returning: nil)
return
}
continuation.resume(returning: text)
}
}
}
private func openMainAppForAssistantSharedText() {
guard let url = URL(string: "nextcloud://assistant/shared-text") else {
extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
return
}
openAssistantSharedTextURLThroughResponderChain(url)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { [weak self] in
self?.extensionContext?.completeRequest(returningItems: nil, completionHandler: nil)
}
}
/// Opens the Assistant shared-text deep link from the Share extension.
///
/// Share extensions cannot use `UIApplication.shared` directly because it is not
/// extension-safe. This method walks the responder chain until it finds the hidden
/// `UIApplication` responder and invokes the modern `open(_:options:completionHandler:)`
/// Objective-C selector dynamically.
///
/// This is intentionally isolated because it relies on Objective-C runtime dispatch.
///
/// - Parameter url: Deep link URL to open in the containing application.
private func openAssistantSharedTextURLThroughResponderChain(_ url: URL) {
let selector = NSSelectorFromString("openURL:options:completionHandler:")
let applicationClass: AnyClass? = NSClassFromString("UIApplication")
var responder: UIResponder? = self
while let currentResponder = responder {
guard let applicationClass,
currentResponder.isKind(of: applicationClass),
currentResponder.responds(to: selector),
let implementation = currentResponder.method(for: selector) else {
responder = currentResponder.next
continue
}
typealias CompletionBlock = @convention(block) (Bool) -> Void
typealias OpenURLFunction = @convention(c) (AnyObject, Selector, NSURL, NSDictionary, CompletionBlock?) -> Void
let openURL = unsafeBitCast(implementation, to: OpenURLFunction.self)
let completion: CompletionBlock = { success in
if success {
nkLog(debug: "Assistant shared text deep link performed through modern responder chain")
} else {
nkLog(error: "Assistant shared text deep link modern responder chain returned false")
}
}
openURL(currentResponder, selector, url as NSURL, NSDictionary(), completion)
return
}
nkLog(error: "Assistant shared text deep link failed because no UIApplication responder can open URL")
}
}
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="24765" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="ObA-dk-sSI">
<device id="retina6_12" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="24743"/>
</dependencies>
<scenes>
<!--Image-->
<scene sceneID="7MM-of-jgj">
<objects>
<viewController title="Image" id="ObA-dk-sSI" customClass="ActionViewController" customModule="Action_Assistant" sceneMemberID="viewController">
<freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
<size key="freeformSize" width="320" height="528"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="X47-rx-isc" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="139" y="131"/>
</scene>
</scenes>
</document>
@@ -0,0 +1,38 @@
{
"images" : [
{
"filename" : "Senza titolo.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "Senza titolo 1.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"filename" : "Senza titolo 2.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 MiB

After

Width:  |  Height:  |  Size: 3.4 MiB

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:svg="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" version="1.1" viewBox="0 0 141.49 99.6">
<!-- Generator: Adobe Illustrator 30.3.0, SVG Export Plug-In . SVG Version: 2.1.3 Build 182) -->
<defs>
<style>
.st0 {
fill: #fff;
}
</style>
</defs>
<path id="path1052" class="st0" d="M70.83,22.15c-12.59,0-23.26,8.54-26.57,20.1-2.88-6.14-9.1-10.43-16.28-10.43-9.87,0-17.98,8.11-17.98,17.98s8.11,17.99,17.98,17.99c7.18,0,13.41-4.3,16.28-10.44,3.31,11.57,13.98,20.11,26.57,20.11s23.12-8.41,26.51-19.85c2.93,6,9.08,10.18,16.15,10.18,9.87,0,17.99-8.12,17.99-17.99s-8.12-17.98-17.99-17.98c-7.07,0-13.23,4.18-16.15,10.17-3.39-11.44-14.01-19.84-26.51-19.84h0ZM70.83,32.7c9.51,0,17.1,7.59,17.1,17.1s-7.59,17.1-17.1,17.1-17.1-7.59-17.1-17.1,7.59-17.1,17.1-17.1ZM27.98,42.37c4.16,0,7.43,3.26,7.43,7.43s-3.26,7.43-7.43,7.43-7.43-3.26-7.43-7.43,3.26-7.43,7.43-7.43ZM113.5,42.37c4.17,0,7.43,3.26,7.43,7.43s-3.26,7.43-7.43,7.43-7.43-3.26-7.43-7.43,3.26-7.43,7.43-7.43Z" inkscape:connector-curvature="0" inkscape:export-filename="Nextcloud Hub logo variants.png" inkscape:export-xdpi="300" inkscape:export-ydpi="300"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

+49
View File
@@ -0,0 +1,49 @@
{
"fill" : {
"linear-gradient" : [
"display-p3:0.10980,0.68627,1.00000,1.00000",
"srgb:0.00000,0.50980,0.78824,1.00000"
],
"orientation" : {
"start" : {
"x" : 0.5,
"y" : 0
},
"stop" : {
"x" : 0.5,
"y" : 0.7
}
}
},
"groups" : [
{
"layers" : [
{
"image-name" : "Nextcloud-logo-white.svg",
"name" : "Nextcloud-logo-white",
"position" : {
"scale" : 6.8,
"translation-in-points" : [
0,
0
]
}
}
],
"shadow" : {
"kind" : "neutral",
"opacity" : 0.5
},
"translucency" : {
"enabled" : true,
"value" : 0.5
}
}
],
"supported-platforms" : {
"circles" : [
"watchOS"
],
"squares" : "shared"
}
}
+14
View File
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.application-groups</key>
<array>
<string>group.it.twsweb.Crypto-Cloud</string>
</array>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)it.twsweb.Crypto-Cloud</string>
</array>
</dict>
</plist>
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST-1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Nextcloud Assistant</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<dict>
<key>NSExtensionActivationSupportsText</key>
<true/>
</dict>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.ui-services</string>
</dict>
</dict>
</plist>
@@ -1,158 +1,14 @@
{
"images" : [
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "20x20",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "57x57",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "60x60",
"idiom" : "iphone",
"filename" : "[email protected]",
"scale" : "3x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "20x20",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "29x29",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "40x40",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "50x50",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "72x72",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "1x"
},
{
"size" : "76x76",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "83.5x83.5",
"idiom" : "ipad",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"size" : "1024x1024",
"idiom" : "ios-marketing",
"filename" : "[email protected]",
"scale" : "1x"
"filename" : "[email protected]",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

+1 -1
View File
@@ -8,4 +8,4 @@ import Foundation
//
let databaseName = "nextcloud.realm"
let tableAccountBackup = "tableAccountBackup.json"
let databaseSchemaVersion: UInt64 = 404
let databaseSchemaVersion: UInt64 = 414
-11
View File
@@ -6,17 +6,6 @@
<string>Nextcloud</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionFileProviderActions</key>
<array>
<dict>
<key>NSExtensionFileProviderActionActivationRule</key>
<string>TRUEPREDICATE</string>
<key>NSExtensionFileProviderActionIdentifier</key>
<string>com.mycompany.FileProviderUI.CustomAction</string>
<key>NSExtensionFileProviderActionName</key>
<string>Custom Action</string>
</dict>
</array>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
<key>NSExtensionPointIdentifier</key>
+8 -6
View File
@@ -22,6 +22,7 @@ class NCIntroViewController: UIViewController, UICollectionViewDataSource, UICol
private var timer: Timer?
private var textColor: UIColor = .white
private var textColorOpponent: UIColor = .black
private var activeLoginProvider: NCLoginProvider?
// MARK: - View Life Cycle
@@ -53,7 +54,7 @@ class NCIntroViewController: UIViewController, UICollectionViewDataSource, UICol
if !NCManageDatabase.shared.getAllTableAccount().isEmpty {
let navigationItemCancel = UIBarButtonItem(image: UIImage(systemName: "xmark"), style: .plain, target: self, action: #selector(actionCancel(_:)))
navigationItemCancel.tintColor = textColor
navigationItem.leftBarButtonItem = navigationItemCancel
navigationItem.rightBarButtonItem = navigationItemCancel
}
pageControl.currentPageIndicatorTintColor = textColor
@@ -164,11 +165,12 @@ class NCIntroViewController: UIViewController, UICollectionViewDataSource, UICol
}
@IBAction func signupWithProvider(_ sender: Any) {
if let viewController = UIStoryboard(name: "NCLogin", bundle: nil).instantiateViewController(withIdentifier: "NCLoginProvider") as? NCLoginProvider {
viewController.controller = self.controller
viewController.initialURLString = NCBrandOptions.shared.linkloginPreferredProviders
self.navigationController?.pushViewController(viewController, animated: true)
}
let loginProvider = NCLoginProvider()
loginProvider.controller = self.controller
loginProvider.initialURLString = NCBrandOptions.shared.linkloginPreferredProviders
loginProvider.presentingViewController = self
loginProvider.startAuthentication()
self.activeLoginProvider = loginProvider
}
@IBAction func host(_ sender: Any) {
+51 -7
View File
@@ -20,12 +20,49 @@ let userAgent: String = {
The codename embodies the concept of dynamic, living matter — reflecting our vision of a platform that is not only powerful and reliable, but also capable of continuous transformation and intelligent adaptation.
*/
struct NextcloudVersion: Comparable {
let major: Int
let minor: Int
let micro: Int
init(_ major: Int, _ minor: Int = 0, _ micro: Int = 0) {
self.major = major
self.minor = minor
self.micro = micro
}
init(_ capabilities: NKCapabilities.Capabilities) {
self.major = capabilities.serverVersionMajor
self.minor = capabilities.serverVersionMinor
self.micro = capabilities.serverVersionMicro
}
static let v18 = NextcloudVersion(18)
static let v20 = NextcloudVersion(20)
static let v23 = NextcloudVersion(23)
static let v24 = NextcloudVersion(24)
static let v25 = NextcloudVersion(25)
static let v26 = NextcloudVersion(26)
static let v27 = NextcloudVersion(27)
static let v28 = NextcloudVersion(28)
static let v30 = NextcloudVersion(30)
static let v31 = NextcloudVersion(31)
static let v32 = NextcloudVersion(32)
static let v32_0_2 = NextcloudVersion(32, 0, 2)
static let v33 = NextcloudVersion(33)
static let v34 = NextcloudVersion(34)
static func < (lhs: NextcloudVersion, rhs: NextcloudVersion) -> Bool {
(lhs.major, lhs.minor, lhs.micro) < (rhs.major, rhs.minor, rhs.micro)
}
}
final class NCBrandOptions: @unchecked Sendable {
static let shared = NCBrandOptions()
var brand: String = "Nextcloud"
var brandUserAgent: String = ""
var textCopyrightNextcloudiOS: String = "Nextcloud Matheria for iOS %@ © 2025"
var textCopyrightNextcloudiOS: String = "Nextcloud Matheria for iOS %@ © 2026"
var textCopyrightNextcloudServer: String = "Nextcloud Server %@"
var loginBaseUrl: String = "https://cloud.nextcloud.com"
var pushNotificationServerProxy: String = ""
@@ -68,23 +105,23 @@ final class NCBrandOptions: @unchecked Sendable {
var enforce_servers: [(name: String, url: String)] = []
// Internal option behaviour
var cleanUpDay: Int = 0 // Set default "Delete all cached files older than" possible days value are: 0, 1, 7, 30, 90, 180, 365
var cleanUpDay: Int = 0 // Set default "Delete all cached files older than". Possible days value are: 0, 1, 7, 30, 90, 180, 365
// Max request/download/upload concurrent
// Max request/download/upload concurrent connections per host, default is 8 (same as iOS default)
let httpMaximumConnectionsPerHost: Int = 8
let httpMaximumConnectionsPerHostInDownload: Int = 8
let httpMaximumConnectionsPerHostInUpload: Int = 8
// Max request/download/upload process
// Max request/download/upload processes
let numMaximumProcess: Int = 20
// Number of failed attempts after reset app
// Number of failed attempts before resetting the app
let resetAppPasscodeAttempts: Int = 10
let passcodeSecondsFail: Int = 60
// Info Paging
enum NCInfoPagingTab: Int, CaseIterable {
case activity, sharing
case activity, sharing, details
}
init() {
@@ -127,13 +164,18 @@ final class NCBrandOptions: @unchecked Sendable {
@objc func getUserAgent() -> String {
return userAgent
}
func isServerVersion(_ capabilities: NKCapabilities.Capabilities,
greaterOrEqualTo version: NextcloudVersion) -> Bool {
return NextcloudVersion(capabilities) >= version
}
}
final class NCBrandColor: @unchecked Sendable {
static let shared = NCBrandColor()
// This is rewrited from customet theme, default is Nextcloud color
let customer: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0) // Nextcloud : #0082C9
let customer: UIColor = UIColor(red: 0.0 / 255.0, green: 130.0 / 255.0, blue: 201.0 / 255.0, alpha: 1.0) // Nextcloud default: #0082C9
var customerText: UIColor = .white
// INTERNAL DEFINE COLORS
@@ -310,12 +352,14 @@ final class NCBrandColor: @unchecked Sendable {
return false
}
/*
public func getTheming(account: String?) -> UIColor {
if let account, let color = self.themingColor[account] {
return color
}
return customer
}
*/
public func getElement(account: String?) -> UIColor {
if let account, let color = self.themingColorElement[account] {
+2 -3
View File
@@ -30,8 +30,7 @@
<key>NSExtensionAttributes</key>
<dict>
<key>NSExtensionActivationRule</key>
<string>SUBQUERY (extensionItems, $extensionItem, SUBQUERY ($extensionItem.attachments,$attachment,(ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data")).@count == $extensionItem.attachments.@count).@count &gt; 0
</string>
<string>SUBQUERY (extensionItems, $extensionItem, SUBQUERY ($extensionItem.attachments, $attachment, (ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.data" OR ANY $attachment.registeredTypeIdentifiers UTI-CONFORMS-TO "public.text")).@count == $extensionItem.attachments.@count).@count &gt; 0</string>
</dict>
<key>NSExtensionMainStoryboard</key>
<string>MainInterface</string>
@@ -39,4 +38,4 @@
<string>com.apple.share-services</string>
</dict>
</dict>
</plist>
</plist>
-5
View File
@@ -2,11 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
+3 -3
View File
@@ -63,7 +63,7 @@
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>Camera access is required to scan documents and make photo and video.</string>
<string>Camera access is required to scan documents and take photos in this app.</string>
<key>NSFaceIDUsageDescription</key>
<string>Face ID is required to authenticate using face recognition.</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
@@ -75,9 +75,9 @@
<key>NSMicrophoneUsageDescription</key>
<string>Microphone access is required to create voice notes.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>Photo library access is required to upload your photos and videos to your cloud.</string>
<string>This lets you upload and save photos using this app. Photos can then be browsed and viewed via the Media tab.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>Photo library access is required to upload your photos and videos to your cloud.</string>
<string>This lets you upload and save photos using this app. Photos can then be browsed and viewed via the Media tab.</string>
<key>NSUserActivityTypes</key>
<array>
<string>AccountIntent</string>
@@ -1,90 +0,0 @@
//
// NCApplicationHandle.swift
// Nextcloud
//
// Created by Marino Faggiana on 25/11/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
import Foundation
import NextcloudKit
import UIKit
import Parchment
class NCApplicationHandle: NSObject {
// class: AppDelegate
// func nextcloudPushNotificationAction(data: [String: AnyObject])
func nextcloudPushNotificationAction(data: [String: AnyObject]) -> [String: AnyObject]? {
return data
}
// class: AppDelegate
// func application(_ application: UIApplication, continue userActivity: NSUserActivity, restorationHandler: @escaping ([UIUserActivityRestoring]?) -> Void)
func applicationOpenUserActivity(_ userActivity: NSUserActivity) -> Bool {
return false
}
// class: AppDelegate
// func: application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:])
func applicationOpenURL(_ url: URL) -> Bool {
return false
}
// class: NCFunctionCenter
// func: downloadedFile(_ notification: NSNotification)
func downloadedFile(selector: String, metadata: tableMetadata) {
}
// class: NCCollectionViewCommon (+Menu)
// func: toggleMenu(metadata: tableMetadata, imageIcon: UIImage?)
func addCollectionViewCommonMenu(metadata: tableMetadata, image: UIImage?, actions: inout [NCMenuAction]) {
}
// class: NCMore
// func: loadItems()
func loadItems(functionMenu: inout [NKExternalSite]) {
}
// class: NCMore
// func: tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath)
func didSelectItem(_ item: NKExternalSite, viewController: UIViewController) {
}
// class: NCSharePaging
// func pagingViewController(_: PagingViewController, viewControllerAt index: Int) -> UIViewController
func pagingViewController(_: PagingViewController, viewControllerAt index: Int, metadata: tableMetadata, topHeight: CGFloat) -> UIViewController {
return UIViewController()
}
// class: NCSharePaging
// func pagingViewController(_: PagingViewController, pagingItemAt index: Int) -> PagingItem
func pagingViewController(_: PagingViewController, pagingItemAt index: Int) -> PagingItem {
return PagingIndexItem(index: index, title: "")
}
// class: NCActionCenter
func filterPages(pages: [NCBrandOptions.NCInfoPagingTab], page: NCBrandOptions.NCInfoPagingTab, metadata: tableMetadata) -> ([NCBrandOptions.NCInfoPagingTab], NCBrandOptions.NCInfoPagingTab) {
return (pages, page)
}
// class: NCNotification
func didSelectNotification(_ notification: NKNotifications, viewController: UIViewController) -> NKNotifications? {
return notification
}
}
+56 -34
View File
@@ -4,16 +4,14 @@
import UIKit
import NextcloudKit
import FileProvider
class FileProviderData: NSObject {
static let shared = FileProviderData()
let utilityFileSystem = NCUtilityFileSystem()
let global = NCGlobal.shared
let database = NCManageDatabase.shared
var domain: NSFileProviderDomain?
var session: NCSession.Session?
private var isPaginated: Bool?
var listFavoriteIdentifierRank: [String: NSNumber] = [:]
var fileProviderSignalDeleteContainerItemIdentifier: [NSFileProviderItemIdentifier: NSFileProviderItemIdentifier] = [:]
@@ -40,8 +38,8 @@ class FileProviderData: NSObject {
func setupAccount(domain: NSFileProviderDomain? = nil,
tblAccount: tableAccount? = nil,
providerExtension: NSFileProviderExtension) -> tableAccount? {
let version = NSString(format: NCBrandOptions.shared.textCopyrightNextcloudiOS as NSString, NCUtility().getVersionBuild()) as String
let tblAccounts = self.database.getAllTableAccount()
let version = NSString(format: NCBrandOptions.shared.textCopyrightNextcloudiOS as NSString, fileProviderUtility().getVersionBuild()) as String
let tblAccounts = NCManageDatabase.shared.getAllTableAccount()
var matchAccount: tableAccount?
NextcloudKit.configureLogger(logLevel: (NCBrandOptions.shared.disable_log ? .disabled : NCPreferences().log))
@@ -55,9 +53,9 @@ class FileProviderData: NSObject {
}
let accountDomain = "\($0.userId) (\(host))"
return accountDomain == domain.identifier.rawValue
}) ?? self.database.getActiveTableAccount()
}) ?? NCManageDatabase.shared.getActiveTableAccount()
} else {
matchAccount = self.database.getActiveTableAccount()
matchAccount = NCManageDatabase.shared.getActiveTableAccount()
}
guard let matchAccount else {
@@ -86,11 +84,24 @@ class FileProviderData: NSObject {
return matchAccount
}
// Get capabilities -> Paginate is availible from NC server 32.0.2
func isPaginatedAvailabile(serverUrl: String, session: NCSession.Session) async -> Bool {
if let isPaginated {
return isPaginated
} else if serverUrl == NCUtilityFileSystem().getHomeServer(session: session),
let capabilities = await NextcloudKit.shared.getCapabilitiesAsync(account: session.account).capabilities,
NCBrandOptions.shared.isServerVersion(capabilities, greaterOrEqualTo: .v32_0_2) {
isPaginated = true
return true
}
return false
}
// MARK: -
@discardableResult
func signalEnumerator(ocId: String, type: TypeSignal) async -> FileProviderItem? {
guard let metadata = await self.database.getMetadataFromOcIdAsync(ocId),
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(ocId),
let parentItemIdentifier = await fileProviderUtility().getParentItemIdentifierAsync(metadata: metadata) else {
return nil
}
@@ -136,14 +147,11 @@ class FileProviderData: NSObject {
func downloadComplete(fileName: String,
serverUrl: String,
etag: String?,
date: Date?,
dateLastModified: Date?,
length: Int64,
allHeaderFields: [AnyHashable: Any]?,
task: URLSessionTask,
error: NKError) async {
let taskIdentifier = task.taskIdentifier
let metadata = await self.database.getMetadataAsync(predicate: NSPredicate(format: "serverUrl == %@ AND fileName == %@", serverUrl, fileName))
let metadata = await NCManageDatabase.shared.getMetadataAsync(predicate: NSPredicate(format: "serverUrl == %@ AND fileName == %@", serverUrl, fileName))
guard let metadata else {
downloadPendingCompletionHandlers[taskIdentifier]?(nil)
@@ -154,17 +162,18 @@ class FileProviderData: NSObject {
}
let ocId = metadata.ocId
let etag = NextcloudKit.shared.nkCommonInstance.findHeader("oc-etag", allHeaderFields: allHeaderFields)
await self.database.setMetadataSessionAsync(ocId: ocId,
session: "",
sessionTaskIdentifier: 0,
sessionError: "",
status: self.global.metadataStatusNormal,
etag: etag)
await NCManageDatabase.shared.setMetadataSessionAsync(ocId: ocId,
session: "",
sessionTaskIdentifier: 0,
sessionError: "",
status: NCGlobal.shared.metadataStatusNormal,
etag: etag)
if error == .success {
if let metadata = await self.database.getMetadataFromOcIdAsync(ocId) {
await self.database.addLocalFilesAsync(metadatas: [metadata])
if let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(ocId) {
await NCManageDatabase.shared.addLocalFilesAsync(metadatas: [metadata])
}
}
@@ -185,27 +194,29 @@ class FileProviderData: NSObject {
ocId: String?,
etag: String?,
date: Date?,
size: Int64,
ownerId: String?,
permissions: String?,
task: URLSessionTask,
error: NKError) async {
guard let metadata = await self.database.getMetadataAsync(predicate: NSPredicate(format: "serverUrl == %@ AND fileName == %@ AND sessionTaskIdentifier == %d", serverUrl, fileName, task.taskIdentifier)) else {
guard let metadata = await NCManageDatabase.shared.getMetadataAsync(predicate: NSPredicate(format: "serverUrl == %@ AND fileName == %@ AND sessionTaskIdentifier == %d", serverUrl, fileName, task.taskIdentifier)) else {
let predicate = NSPredicate(format: "fileName == %@ AND serverUrl == %@", fileName, serverUrl)
await self.database.deleteMetadataAsync(predicate: predicate)
await NCManageDatabase.shared.deleteMetadataAsync(predicate: predicate)
return
}
if let ocId, !metadata.ocIdTransfer.isEmpty {
let atPath = self.utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocIdTransfer, userId: metadata.userId, urlBase: metadata.urlBase)
let toPath = self.utilityFileSystem.getDirectoryProviderStorageOcId(ocId, userId: metadata.userId, urlBase: metadata.urlBase)
self.utilityFileSystem.copyFile(atPath: atPath, toPath: toPath)
let utilityFileSystem = NCUtilityFileSystem()
let atPath = utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocIdTransfer, userId: metadata.userId, urlBase: metadata.urlBase)
let toPath = utilityFileSystem.getDirectoryProviderStorageOcId(ocId, userId: metadata.userId, urlBase: metadata.urlBase)
utilityFileSystem.copyFile(atPath: atPath, toPath: toPath)
}
if error == .success, let ocId {
await signalEnumerator(ocId: metadata.ocIdTransfer, type: .delete)
if !metadata.ocIdTransfer.isEmpty, ocId != metadata.ocIdTransfer {
await self.database.deleteMetadataAsync(id: metadata.ocIdTransfer)
await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocIdTransfer)
}
metadata.fileName = fileName
@@ -213,11 +224,22 @@ class FileProviderData: NSObject {
metadata.uploadDate = (date as? NSDate) ?? NSDate()
metadata.etag = etag ?? ""
metadata.ocId = ocId
metadata.size = size
if let fileId = NCUtility().ocIdToFileId(ocId: ocId) {
if let fileId = fileProviderUtility().ocIdToFileId(ocId: ocId) {
metadata.fileId = fileId
}
if let ownerId, !ownerId.isEmpty {
metadata.ownerId = ownerId
if let ownerDisplayName = await NCManageDatabase.shared.getOwnerDisplayName(account: metadata.account, ownerId: ownerId) {
metadata.ownerDisplayName = ownerDisplayName
}
}
if let permissions, !permissions.isEmpty {
metadata.permissions = permissions
}
metadata.sceneIdentifier = nil
metadata.session = ""
metadata.sessionError = ""
@@ -226,14 +248,14 @@ class FileProviderData: NSObject {
metadata.sessionTaskIdentifier = 0
metadata.status = NCGlobal.shared.metadataStatusNormal
await self.database.addMetadataAsync(metadata)
await self.database.addLocalFilesAsync(metadatas: [metadata])
await NCManageDatabase.shared.addMetadataAsync(metadata)
await NCManageDatabase.shared.addLocalFilesAsync(metadatas: [metadata])
await signalEnumerator(ocId: ocId, type: .update)
} else {
await self.database.deleteMetadataAsync(id: metadata.ocIdTransfer)
await NCManageDatabase.shared.deleteMetadataAsync(id: metadata.ocIdTransfer)
await signalEnumerator(ocId: metadata.ocIdTransfer, type: .delete)
}
@@ -10,33 +10,40 @@ import NextcloudKit
class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
var enumeratedItemIdentifier: NSFileProviderItemIdentifier
var serverUrl: String?
let fileProviderData = FileProviderData.shared
let providerUtility = fileProviderUtility()
let database = NCManageDatabase.shared
let utilityFileSystem = NCUtilityFileSystem()
var anchor: UInt64 = 0
var readCapabilities: Bool = false
// X-NC-PAGINATE
var recordsPerPage: Int = 100
#if DEBUG
var paginateCount: Int = 50
#else
var paginateCount: Int = 200
#endif
// X-NC-PAGINATE
var paginateToken: String?
var paginatedTotal: Int = 0
struct PageInfo {
let page: Int
let items: Int
}
var paginateItems: [PageInfo] = []
init(enumeratedItemIdentifier: NSFileProviderItemIdentifier) {
self.enumeratedItemIdentifier = enumeratedItemIdentifier
super.init()
guard let session = fileProviderData.session else {
guard let session = FileProviderData.shared.session else {
return
}
if enumeratedItemIdentifier == .rootContainer {
self.serverUrl = NCUtilityFileSystem().getHomeServer(session: session)
} else {
if let metadata = providerUtility.getTableMetadataFromItemIdentifier(enumeratedItemIdentifier),
let directorySource = self.database.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) {
serverUrl = utilityFileSystem.createServerUrl(serverUrl: directorySource.serverUrl, fileName: metadata.fileName)
if let metadata = fileProviderUtility().getTableMetadataFromItemIdentifier(enumeratedItemIdentifier),
let directorySource = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) {
serverUrl = NCUtilityFileSystem().createServerUrl(serverUrl: directorySource.serverUrl, fileName: metadata.fileName)
}
}
}
@@ -46,7 +53,7 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
func enumerateItems(for observer: NSFileProviderEnumerationObserver, startingAt page: NSFileProviderPage) {
Task {
var items: [NSFileProviderItemProtocol] = []
guard let session = fileProviderData.session else {
guard let session = FileProviderData.shared.session else {
return
}
@@ -55,27 +62,27 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
var itemIdentifierMetadata: [NSFileProviderItemIdentifier: tableMetadata] = [:]
// Tags
if let tags = await self.database.getTagsAsync(predicate: NSPredicate(format: "account == %@", session.account)) {
if let tags = await NCManageDatabase.shared.getTagsAsync(predicate: NSPredicate(format: "account == %@", session.account)) {
for tag in tags {
guard let metadata = await self.database.getMetadataFromOcIdAsync(tag.ocId) else {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(tag.ocId) else {
continue
}
itemIdentifierMetadata[providerUtility.getItemIdentifier(metadata: metadata)] = metadata
itemIdentifierMetadata[fileProviderUtility().getItemIdentifier(metadata: metadata)] = metadata
}
}
// Favorite
fileProviderData.listFavoriteIdentifierRank = await self.database.getTableMetadatasDirectoryFavoriteIdentifierRankAsync(account: session.account)
for (identifier, _) in fileProviderData.listFavoriteIdentifierRank {
guard let metadata = await self.database.getMetadataFromOcIdAsync(identifier) else {
FileProviderData.shared.listFavoriteIdentifierRank = await NCManageDatabase.shared.getTableMetadatasDirectoryFavoriteIdentifierRankAsync(account: session.account)
for (identifier, _) in FileProviderData.shared.listFavoriteIdentifierRank {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(identifier) else {
continue
}
itemIdentifierMetadata[providerUtility.getItemIdentifier(metadata: metadata)] = metadata
itemIdentifierMetadata[fileProviderUtility().getItemIdentifier(metadata: metadata)] = metadata
}
// Create items
for (_, metadata) in itemIdentifierMetadata {
if let parentItemIdentifier = await providerUtility.getParentItemIdentifierAsync(metadata: metadata) {
if let parentItemIdentifier = await fileProviderUtility().getParentItemIdentifierAsync(metadata: metadata) {
let item = FileProviderItem(metadata: metadata, parentItemIdentifier: parentItemIdentifier)
items.append(item)
}
@@ -84,8 +91,6 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
observer.finishEnumerating(upTo: nil)
} else {
// ServerUrl
guard let serverUrl = serverUrl else {
observer.finishEnumerating(upTo: nil)
return
@@ -96,28 +101,15 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
pageNumber = intPage
}
let (metadatas, isPaginated) = await fetchItemsForPage(serverUrl: serverUrl, pageNumber: pageNumber, account: session.account)
if let metadatas {
for metadata in metadatas {
if metadata.e2eEncrypted || (!metadata.session.isEmpty && metadata.session != NCNetworking.shared.sessionUploadBackgroundExt) {
continue
}
if let parentItemIdentifier = await self.providerUtility.getParentItemIdentifierAsync(metadata: metadata) {
let item = FileProviderItem(metadata: metadata, parentItemIdentifier: parentItemIdentifier)
items.append(item)
}
}
}
let (items, ncPaginated) = await fetchItemsForPage(session: session,
serverUrl: serverUrl,
pageNumber: pageNumber)
observer.didEnumerate(items)
if let metadatas,
isPaginated,
metadatas.count == self.recordsPerPage {
if !items.isEmpty,
ncPaginated {
pageNumber += 1
let providerPage = NSFileProviderPage("\(pageNumber)".data(using: .utf8)!)
observer.finishEnumerating(upTo: providerPage)
observer.finishEnumerating(upTo: NSFileProviderPage(Data("\(pageNumber)".utf8)))
} else {
observer.finishEnumerating(upTo: nil)
}
@@ -131,113 +123,170 @@ class FileProviderEnumerator: NSObject, NSFileProviderEnumerator {
// Report the deleted items
if self.enumeratedItemIdentifier == .workingSet {
for (itemIdentifier, _) in fileProviderData.fileProviderSignalDeleteWorkingSetItemIdentifier {
for (itemIdentifier, _) in FileProviderData.shared.fileProviderSignalDeleteWorkingSetItemIdentifier {
itemsDelete.append(itemIdentifier)
}
fileProviderData.fileProviderSignalDeleteWorkingSetItemIdentifier.removeAll()
FileProviderData.shared.fileProviderSignalDeleteWorkingSetItemIdentifier.removeAll()
} else {
for (itemIdentifier, _) in fileProviderData.fileProviderSignalDeleteContainerItemIdentifier {
for (itemIdentifier, _) in FileProviderData.shared.fileProviderSignalDeleteContainerItemIdentifier {
itemsDelete.append(itemIdentifier)
}
fileProviderData.fileProviderSignalDeleteContainerItemIdentifier.removeAll()
FileProviderData.shared.fileProviderSignalDeleteContainerItemIdentifier.removeAll()
}
// Report the updated items
if self.enumeratedItemIdentifier == .workingSet {
for (_, item) in fileProviderData.fileProviderSignalUpdateWorkingSetItem {
for (_, item) in FileProviderData.shared.fileProviderSignalUpdateWorkingSetItem {
itemsUpdate.append(item)
}
fileProviderData.fileProviderSignalUpdateWorkingSetItem.removeAll()
FileProviderData.shared.fileProviderSignalUpdateWorkingSetItem.removeAll()
} else {
for (_, item) in fileProviderData.fileProviderSignalUpdateContainerItem {
for (_, item) in FileProviderData.shared.fileProviderSignalUpdateContainerItem {
itemsUpdate.append(item)
}
fileProviderData.fileProviderSignalUpdateContainerItem.removeAll()
FileProviderData.shared.fileProviderSignalUpdateContainerItem.removeAll()
}
observer.didDeleteItems(withIdentifiers: itemsDelete)
observer.didUpdate(itemsUpdate)
let data = "\(self.anchor)".data(using: .utf8)
observer.finishEnumeratingChanges(upTo: NSFileProviderSyncAnchor(data!), moreComing: false)
let data = Data("\(self.anchor)".utf8)
observer.finishEnumeratingChanges(upTo: NSFileProviderSyncAnchor(data), moreComing: false)
}
func currentSyncAnchor(completionHandler: @escaping (NSFileProviderSyncAnchor?) -> Void) {
let data = "\(self.anchor)".data(using: .utf8)
completionHandler(NSFileProviderSyncAnchor(data!))
let data = Data("\(self.anchor)".utf8)
completionHandler(NSFileProviderSyncAnchor(data))
}
func fetchItemsForPage(serverUrl: String, pageNumber: Int, account: String) async -> (metadatas: [tableMetadata]?, isPaginated: Bool) {
var serverUrlMetadataFolder: String?
var isPaginated: Bool = false
var paginateCount = recordsPerPage
if pageNumber == 0 {
paginateCount += 1
func fetchItemsForPage(session: NCSession.Session, serverUrl: String, pageNumber: Int) async -> (items: [NSFileProviderItem], ncPaginate: Bool) {
let fileProviderUtility = fileProviderUtility()
let createMetadata = NCManageDatabaseCreateMetadata()
func getItemsFrom(metadatas: [tableMetadata], addOnDB: Bool) async -> [NSFileProviderItem] {
var items: [NSFileProviderItem] = []
// Get parentItemIdentifier
guard let directory = await NCManageDatabase.shared.getTableDirectoryAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", session.account, serverUrl)),
let parentItemIdentifier = await fileProviderUtility.getParentItemIdentifierAsync(
session: session,
directory: directory
) else {
return ([])
}
// make items
for metadata in metadatas {
// NO E2EE OR NO VIDEO PART OF LIVE PHOTO
if metadata.e2eEncrypted || (metadata.classFile == NKTypeClassFile.video.rawValue && !metadata.livePhotoFile.isEmpty) {
continue
}
if addOnDB {
if metadata.directory {
await NCManageDatabase.shared.createDirectory(metadata: metadata)
}
await NCManageDatabase.shared.addMetadataAsync(metadata)
}
autoreleasepool {
let item = FileProviderItem(metadata: metadata, parentItemIdentifier: parentItemIdentifier)
items.append(item)
}
}
return items
}
var offset = pageNumber * recordsPerPage
// Request pagination
//
let showHiddenFiles = NCPreferences().getShowHiddenFiles(account: session.account)
var paginateOffset = 0
if pageNumber > 0 {
offset += 1
paginateOffset = getOffset(for: pageNumber)
}
let showHiddenFiles = NCPreferences().getShowHiddenFiles(account: account)
let options = NKRequestOptions(paginate: true,
let optionsPaginate = await FileProviderData.shared.isPaginatedAvailabile(serverUrl: serverUrl, session: session)
let options = NKRequestOptions(paginate: optionsPaginate,
paginateToken: self.paginateToken,
paginateOffset: offset,
paginateOffset: paginateOffset,
paginateCount: paginateCount,
queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)
queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue
)
print("PAGINATE OFFSET: \(offset) COUNT: \(paginateCount) TOTAL: \(self.paginatedTotal)")
// Read folder metadata
//
let resultsRead = await NextcloudKit.shared.readFileOrFolderAsync(
serverUrlFileName: serverUrl,
depth: "1",
showHiddenFiles: showHiddenFiles,
account: session.account,
options: options
)
let resultsRead = await NextcloudKit.shared.readFileOrFolderAsync(serverUrlFileName: serverUrl,
depth: "1",
showHiddenFiles: showHiddenFiles,
account: account,
options: options)
print("PAGINATE OFFSET: \(paginateOffset) COUNT: \(resultsRead.files?.count ?? 0) PAGE NUMBER: \(pageNumber) TOTAL: \(self.paginatedTotal) SERVERURL: \(serverUrl)")
// Header for paginate
//
var ncPaginate: Bool = false
if let headers = resultsRead.responseData?.response?.allHeaderFields as? [String: String] {
let normalizedHeaders = Dictionary(uniqueKeysWithValues: headers.map { ($0.key.lowercased(), $0.value) })
isPaginated = Bool(normalizedHeaders["x-nc-paginate"] ?? "false") ?? false
ncPaginate = Bool(normalizedHeaders["x-nc-paginate"] ?? "false") ?? false
self.paginateToken = normalizedHeaders["x-nc-paginate-token"]
self.paginatedTotal = Int(normalizedHeaders["x-nc-paginate-total"] ?? "0") ?? 0
if let totalString = normalizedHeaders["x-nc-paginate-total"],
let total = Int(totalString) {
self.paginatedTotal = total
}
}
if resultsRead.error == .success, let files = resultsRead.files {
let (metadataFolder, metadatas) = await createMetadata.convertFilesToMetadatasAsync(files, serverUrlMetadataFolder: pageNumber == 0 ? serverUrl : nil)
self.paginateItems.append(PageInfo(page: pageNumber, items: metadatas.count))
if pageNumber == 0 {
await self.database.deleteMetadataAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND status == %d AND fileName != %@", account, serverUrl, NCGlobal.shared.metadataStatusNormal, NextcloudKit.shared.nkCommonInstance.rootFileName))
serverUrlMetadataFolder = serverUrl
await NCManageDatabase.shared.deleteMetadataAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@ AND status == %d", session.account, serverUrl, NCGlobal.shared.metadataStatusNormal))
await NCManageDatabase.shared.createDirectory(metadata: metadataFolder)
}
let (metadataFolder, metadatas) = await self.database.convertFilesToMetadatasAsync(files, serverUrlMetadataFolder: serverUrlMetadataFolder)
// FOLDER
if serverUrlMetadataFolder != nil {
await self.database.createDirectory(metadata: metadataFolder)
let items = await getItemsFrom(metadatas: Array(metadatas), addOnDB: true)
if self.totalItems() >= self.paginatedTotal {
ncPaginate = false
}
// METADATA
var metadataToInsert: [tableMetadata] = []
for metadata in metadatas {
if metadata.directory {
await self.database.createDirectory(metadata: metadata)
} else {
metadataToInsert.append(metadata)
}
}
await self.database.addMetadatasAsync(metadataToInsert)
return(metadatas, isPaginated)
return (items, ncPaginate)
} else {
if isPaginated {
let predicate = NSPredicate(
format: """
account == %@ AND
serverUrl == %@ AND
status == %d AND
(
classFile != 'video' OR
(classFile == 'video' AND livePhotoFile == '')
)
""",
session.account,
serverUrl,
NCGlobal.shared.metadataStatusNormal
)
return (nil, isPaginated)
} else {
let metadatas = await self.database.getMetadatasAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", account, serverUrl))
return (metadatas, isPaginated)
guard let metadatas = await NCManageDatabase.shared.getResultsMetadatasAsync(predicate: predicate) else {
return ([], false)
}
let items = await getItemsFrom(metadatas: Array(metadatas), addOnDB: false)
return (items, false)
}
}
func getOffset(for page: Int) -> Int {
let items = paginateItems
.filter { $0.page < page }
.map { $0.items }
.reduce(0, +)
// + 1 for the next
return items == 0 ? 0 : items + 1
}
func totalItems() -> Int {
let total = paginateItems.map { $0.items }.reduce(0, +)
// + 1 for the first "root directory"
return total == 0 ? 0 : total + 1
}
}
@@ -9,12 +9,13 @@ import NextcloudKit
extension FileProviderExtension {
override func createDirectory(withName directoryName: String, inParentItemIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
Task {
guard let session = fileProviderData.session,
let tableDirectory = await providerUtility.getTableDirectoryFromParentItemIdentifierAsync(parentItemIdentifier, account: session.account, homeServerUrl: utilityFileSystem.getHomeServer(session: session)) else {
let utilityFileSystem = NCUtilityFileSystem()
guard let session = FileProviderData.shared.session,
let tableDirectory = await fileProviderUtility().getTableDirectoryFromParentItemIdentifierAsync(parentItemIdentifier, account: session.account, homeServerUrl: utilityFileSystem.getHomeServer(session: session)) else {
return completionHandler(nil, NSFileProviderError(.noSuchItem))
}
let account = session.account
let fileNameFolder = utilityFileSystem.createFileName(directoryName, serverUrl: tableDirectory.serverUrl, account: account)
let fileNameFolder = fileProviderUtility().createFileName(directoryName, serverUrl: tableDirectory.serverUrl, account: account)
let serverUrlFileName = utilityFileSystem.createServerUrl(serverUrl: tableDirectory.serverUrl, fileName: fileNameFolder)
let showHiddenFiles = NCPreferences().getShowHiddenFiles(account: account)
@@ -24,8 +25,10 @@ extension FileProviderExtension {
let resultsReadFile = await NextcloudKit.shared.readFileOrFolderAsync(serverUrlFileName: serverUrlFileName, depth: "0", showHiddenFiles: showHiddenFiles, account: account)
if resultsReadFile.error == .success, let file = resultsReadFile.files?.first {
let metadata = await self.database.convertFileToMetadataAsync(file)
await self.database.createDirectory(metadata: metadata)
let metadata = await NCManageDatabaseCreateMetadata().convertFileToMetadataAsync(file)
await NCManageDatabase.shared.createDirectory(metadata: metadata)
NCUtilityFileSystem().getDirectoryProviderStorageOcId(metadata.ocId, fileName: metadata.fileName, userId: metadata.userId, urlBase: metadata.urlBase)
let item = FileProviderItem(metadata: metadata, parentItemIdentifier: parentItemIdentifier)
@@ -49,10 +52,11 @@ extension FileProviderExtension {
override func deleteItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (Error?) -> Void) {
Task {
guard let metadata = await providerUtility.getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
guard let metadata = await fileProviderUtility().getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
completionHandler(NSFileProviderError(.noSuchItem))
return
}
let utilityFileSystem = NCUtilityFileSystem()
let ocId = metadata.ocId
let serverUrlFileName = utilityFileSystem.createServerUrl(serverUrl: metadata.serverUrl, fileName: metadata.fileName)
let isDirectory = metadata.directory
@@ -63,21 +67,21 @@ extension FileProviderExtension {
let resultsDelete = await NextcloudKit.shared.deleteFileOrFolderAsync(serverUrlFileName: serverUrlFileName, account: account)
if resultsDelete.error == .success {
let fileNamePath = self.utilityFileSystem.getDirectoryProviderStorageOcId(itemIdentifier.rawValue, userId: metadata.userId, urlBase: metadata.urlBase)
let fileNamePath = utilityFileSystem.getDirectoryProviderStorageOcId(itemIdentifier.rawValue, userId: metadata.userId, urlBase: metadata.urlBase)
do {
try self.providerUtility.fileManager.removeItem(atPath: fileNamePath)
try fileProviderUtility().fileManager.removeItem(atPath: fileNamePath)
} catch let error {
print("error: \(error)")
}
if isDirectory {
let dirForDelete = self.utilityFileSystem.createServerUrl(serverUrl: serverUrl, fileName: fileName)
await self.database.deleteDirectoryAndSubDirectoryAsync(serverUrl: dirForDelete, account: account)
let dirForDelete = utilityFileSystem.createServerUrl(serverUrl: serverUrl, fileName: fileName)
await NCManageDatabase.shared.deleteDirectoryAndSubDirectoryAsync(serverUrl: dirForDelete, account: account)
}
await self.database.deleteMetadataAsync(id: ocId)
await self.database.deleteLocalFileAsync(id: ocId)
await NCManageDatabase.shared.deleteMetadataAsync(id: ocId)
await NCManageDatabase.shared.deleteLocalFileAsync(id: ocId)
completionHandler(nil)
return
@@ -93,16 +97,17 @@ extension FileProviderExtension {
override func reparentItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toParentItemWithIdentifier parentItemIdentifier: NSFileProviderItemIdentifier, newName: String?, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
Task {
guard let itemFrom = try? item(for: itemIdentifier),
let metadataFrom = await providerUtility.getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
let metadataFrom = await fileProviderUtility().getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
let utilityFileSystem = NCUtilityFileSystem()
let ocIdFrom = metadataFrom.ocId
let serverUrlFrom = metadataFrom.serverUrl
let fileNameFrom = utilityFileSystem.createServerUrl(serverUrl: serverUrlFrom, fileName: itemFrom.filename)
let account = metadataFrom.account
guard let tableDirectoryTo = await providerUtility.getTableDirectoryFromParentItemIdentifierAsync(parentItemIdentifier, account: account, homeServerUrl: utilityFileSystem.getHomeServer(urlBase: metadataFrom.urlBase, userId: metadataFrom.userId)) else {
guard let tableDirectoryTo = await fileProviderUtility().getTableDirectoryFromParentItemIdentifierAsync(parentItemIdentifier, account: account, homeServerUrl: utilityFileSystem.getHomeServer(urlBase: metadataFrom.urlBase, userId: metadataFrom.userId)) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
@@ -117,12 +122,12 @@ extension FileProviderExtension {
if resultsMove.error == .success {
if metadataFrom.directory {
await self.database.deleteDirectoryAndSubDirectoryAsync(serverUrl: serverUrlFrom, account: account)
await self.database.renameDirectoryAsync(ocId: ocIdFrom, serverUrl: serverUrlTo)
await NCManageDatabase.shared.deleteDirectoryAndSubDirectoryAsync(serverUrl: serverUrlFrom, account: account)
await NCManageDatabase.shared.renameDirectoryAsync(ocId: ocIdFrom, serverUrl: serverUrlTo)
}
await self.database.moveMetadataAsync(ocId: ocIdFrom, serverUrlTo: serverUrlTo)
await NCManageDatabase.shared.moveMetadataAsync(ocId: ocIdFrom, serverUrlTo: serverUrlTo)
guard let metadata = await self.database.getMetadataFromOcIdAsync(ocIdFrom) else {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(ocIdFrom) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
@@ -142,10 +147,11 @@ extension FileProviderExtension {
override func renameItem(withIdentifier itemIdentifier: NSFileProviderItemIdentifier, toName itemName: String, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
Task {
guard let metadata = await providerUtility.getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
guard let metadata = await fileProviderUtility().getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
let utilityFileSystem = NCUtilityFileSystem()
let fileNameFrom = metadata.fileNameView
let fileNamePathFrom = utilityFileSystem.createServerUrl(serverUrl: metadata.serverUrl, fileName: fileNameFrom)
let fileNamePathTo = utilityFileSystem.createServerUrl(serverUrl: metadata.serverUrl, fileName: itemName)
@@ -154,11 +160,11 @@ extension FileProviderExtension {
let resultsMove = await NextcloudKit.shared.moveFileOrFolderAsync(serverUrlFileNameSource: fileNamePathFrom, serverUrlFileNameDestination: fileNamePathTo, overwrite: false, account: metadata.account)
if resultsMove.error == .success {
await self.database.renameMetadata(fileNameNew: itemName, ocId: ocId)
await self.database.setMetadataServerUrlFileNameStatusNormalAsync(ocId: ocId)
await NCManageDatabase.shared.renameMetadata(fileNameNew: itemName, ocId: ocId)
await NCManageDatabase.shared.setMetadataServerUrlFileNameStatusNormalAsync(ocId: ocId)
guard let metadata = await self.database.getMetadataFromOcIdAsync(ocId),
let parentItemIdentifier = await self.providerUtility.getParentItemIdentifierAsync(metadata: metadata) else {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(ocId),
let parentItemIdentifier = await fileProviderUtility().getParentItemIdentifierAsync(metadata: metadata) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
@@ -184,7 +190,7 @@ extension FileProviderExtension {
override func setFavoriteRank(_ favoriteRank: NSNumber?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
Task {
guard let metadata = await providerUtility.getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
guard let metadata = await fileProviderUtility().getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
@@ -192,43 +198,43 @@ extension FileProviderExtension {
let ocId = metadata.ocId
if favoriteRank == nil {
fileProviderData.listFavoriteIdentifierRank.removeValue(forKey: itemIdentifier.rawValue)
FileProviderData.shared.listFavoriteIdentifierRank.removeValue(forKey: itemIdentifier.rawValue)
} else {
if fileProviderData.listFavoriteIdentifierRank[itemIdentifier.rawValue] == nil {
fileProviderData.listFavoriteIdentifierRank[itemIdentifier.rawValue] = favoriteRank
if FileProviderData.shared.listFavoriteIdentifierRank[itemIdentifier.rawValue] == nil {
FileProviderData.shared.listFavoriteIdentifierRank[itemIdentifier.rawValue] = favoriteRank
}
favorite = true
}
if (favorite == true && !metadata.favorite) || (!favorite && metadata.favorite) {
let fileNamePath = utilityFileSystem.getFileNamePath(metadata.fileName, serverUrl: metadata.serverUrl, urlBase: metadata.urlBase, userId: metadata.userId)
let fileNamePath = NCUtilityFileSystem().getRelativeFilePath(metadata.fileName, serverUrl: metadata.serverUrl, urlBase: metadata.urlBase, userId: metadata.userId)
let resultsFavorite = await NextcloudKit.shared.setFavoriteAsync(fileName: fileNamePath, favorite: favorite, account: metadata.account)
if resultsFavorite.error == .success {
guard let metadata = await self.database.getMetadataFromOcIdAsync(ocId) else {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(ocId) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
// Change DB
metadata.favorite = favorite
await self.database.addMetadataAsync(metadata)
await NCManageDatabase.shared.addMetadataAsync(metadata)
let item = await fileProviderData.signalEnumerator(ocId: metadata.ocId, type: .workingSet)
let item = await FileProviderData.shared.signalEnumerator(ocId: metadata.ocId, type: .workingSet)
completionHandler(item, nil)
return
} else {
guard let metadata = await self.database.getMetadataFromOcIdAsync(ocId) else {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(ocId) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
// Errore, remove from listFavoriteIdentifierRank
fileProviderData.listFavoriteIdentifierRank.removeValue(forKey: itemIdentifier.rawValue)
FileProviderData.shared.listFavoriteIdentifierRank.removeValue(forKey: itemIdentifier.rawValue)
let item = await fileProviderData.signalEnumerator(ocId: metadata.ocId, type: .workingSet)
let item = await FileProviderData.shared.signalEnumerator(ocId: metadata.ocId, type: .workingSet)
completionHandler(item, NSFileProviderError(.serverUnreachable))
return
@@ -239,16 +245,16 @@ extension FileProviderExtension {
override func setTagData(_ tagData: Data?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
Task {
guard let metadataForTag = await providerUtility.getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
guard let metadataForTag = await fileProviderUtility().getTableMetadataFromItemIdentifierAsync(itemIdentifier) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
let ocId = metadataForTag.ocId
let account = metadataForTag.account
await self.database.addTagAsunc(ocId, tagIOS: tagData, account: account)
await NCManageDatabase.shared.addTagAsync(ocId, tagIOS: tagData, account: account)
let item = await fileProviderData.signalEnumerator(ocId: ocId, type: .workingSet)
let item = await FileProviderData.shared.signalEnumerator(ocId: ocId, type: .workingSet)
completionHandler(item, nil)
}
@@ -257,8 +263,8 @@ extension FileProviderExtension {
override func setLastUsedDate(_ lastUsedDate: Date?, forItemIdentifier itemIdentifier: NSFileProviderItemIdentifier, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void) {
Task {
guard let metadata = await providerUtility.getTableMetadataFromItemIdentifierAsync(itemIdentifier),
let parentItemIdentifier = await providerUtility.getParentItemIdentifierAsync(metadata: metadata) else {
guard let metadata = await fileProviderUtility().getTableMetadataFromItemIdentifierAsync(itemIdentifier),
let parentItemIdentifier = await fileProviderUtility().getParentItemIdentifierAsync(metadata: metadata) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
}
@@ -12,9 +12,10 @@ extension FileProviderExtension {
let progress = Progress(totalUnitCount: Int64(itemIdentifiers.count))
var counterProgress: Int64 = 0
let fileProviderUtility = fileProviderUtility()
for itemIdentifier in itemIdentifiers {
guard let metadata = providerUtility.getTableMetadataFromItemIdentifier(itemIdentifier),
guard let metadata = fileProviderUtility.getTableMetadataFromItemIdentifier(itemIdentifier),
metadata.hasPreview
else {
counterProgress += 1
@@ -7,50 +7,21 @@ import UniformTypeIdentifiers
import FileProvider
import NextcloudKit
import Alamofire
/* -----------------------------------------------------------------------------------------------------------------------------------------------
STRUCT item
-----------------------------------------------------------------------------------------------------------------------------------------------
itemIdentifier = NSFileProviderItemIdentifier.rootContainer.rawValue --> _ROOT_
parentItemIdentifier = NSFileProviderItemIdentifier.rootContainer.rawValue --> _ROOT_
↓
itemIdentifier = metadata.ocId (ex. 00ABC1) --> func getItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier
parentItemIdentifier = NSFileProviderItemIdentifier.rootContainer.rawValue --> func getParentItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier?
↓
itemIdentifier = metadata.ocId (ex. 00CCC) --> func getItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier
parentItemIdentifier = parent itemIdentifier (00ABC1) --> func getParentItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier?
↓
itemIdentifier = metadata.ocId (ex. 000DD) --> func getItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier
parentItemIdentifier = parent itemIdentifier (00CCC) --> func getParentItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier?
-------------------------------------------------------------------------------------------------------------------------------------------- */
import RealmSwift
final class FileProviderExtension: NSFileProviderExtension {
lazy var providerUtility = fileProviderUtility()
lazy var utilityFileSystem = NCUtilityFileSystem()
let fileProviderData = FileProviderData.shared
let global = NCGlobal.shared
let database = NCManageDatabase.shared
let backgroundSession = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance)
override init() { }
deinit { }
// MARK: - Enumeration
override func enumerator(for containerItemIdentifier: NSFileProviderItemIdentifier) throws -> NSFileProviderEnumerator {
// Skip authentication checks for the working set container
if containerItemIdentifier != .workingSet {
let versionApp = NCUtility().getVersionMaintenance()
let versionApp = fileProviderUtility().getVersionMaintenance()
// Verify / Open REALM
guard let url = NCManageDatabase.shared.databaseURL,
let version = try? schemaVersionAtURL(url),
version == databaseSchemaVersion else {
throw NSError(domain: NSFileProviderErrorDomain, code: NSFileProviderError.notAuthenticated.rawValue, userInfo: ["code": NSNumber(value: NCGlobal.shared.errorVersionMismatch)])
}
NCManageDatabase.shared.openRealm()
// Verify version
if let groupDefaults = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroup) {
@@ -61,7 +32,7 @@ final class FileProviderExtension: NSFileProviderExtension {
}
// Ensure a valid account is configured for the extension
guard fileProviderData.setupAccount(domain: self.domain, providerExtension: self) != nil else {
guard FileProviderData.shared.setupAccount(domain: self.domain, providerExtension: self) != nil else {
throw NSError(domain: NSFileProviderErrorDomain, code: NSFileProviderError.notAuthenticated.rawValue, userInfo: [:])
}
@@ -83,26 +54,27 @@ final class FileProviderExtension: NSFileProviderExtension {
// MARK: - Item
override func item(for identifier: NSFileProviderItemIdentifier) throws -> NSFileProviderItem {
if identifier == .rootContainer, let session = fileProviderData.session {
let metadata = database.createMetadataDirectory(fileName: NextcloudKit.shared.nkCommonInstance.rootFileName,
ocId: NSFileProviderItemIdentifier.rootContainer.rawValue,
serverUrl: utilityFileSystem.getHomeServer(session: session),
session: session)
if identifier == .rootContainer, let session = FileProviderData.shared.session {
let metadata = NCManageDatabaseCreateMetadata().createMetadataDirectory(
fileName: NextcloudKit.shared.nkCommonInstance.rootFileName,
ocId: NSFileProviderItemIdentifier.rootContainer.rawValue,
serverUrl: NCUtilityFileSystem().getHomeServer(session: session),
session: session)
return FileProviderItem(metadata: metadata, parentItemIdentifier: NSFileProviderItemIdentifier(NSFileProviderItemIdentifier.rootContainer.rawValue))
} else {
guard let metadata = providerUtility.getTableMetadataFromItemIdentifier(identifier),
let parentItemIdentifier = providerUtility.getParentItemIdentifier(metadata: metadata) else {
let fileProviderUtility = fileProviderUtility()
guard let metadata = fileProviderUtility.getTableMetadataFromItemIdentifier(identifier),
let parentItemIdentifier = fileProviderUtility.getParentItemIdentifier(metadata: metadata) else {
throw NSFileProviderError(.noSuchItem)
}
let item = FileProviderItem(metadata: metadata, parentItemIdentifier: parentItemIdentifier)
return item
}
}
override func urlForItem(withPersistentIdentifier identifier: NSFileProviderItemIdentifier) -> URL? {
guard let session = fileProviderData.session,
guard let session = FileProviderData.shared.session,
let item = try? item(for: identifier),
let rootURL = fileProviderUtility().getDocumentStorageURL(for: domain, userId: session.userId, urlBase: session.urlBase) else {
return nil
@@ -112,7 +84,6 @@ final class FileProviderExtension: NSFileProviderExtension {
// (fix copy/paste directory -> isDirectory = false)
url = url.appendingPathComponent(item.filename, isDirectory: false)
return url
}
@@ -123,7 +94,6 @@ final class FileProviderExtension: NSFileProviderExtension {
assert(pathComponents.count > 2)
let itemIdentifier = NSFileProviderItemIdentifier(pathComponents[pathComponents.count - 2])
return itemIdentifier
}
@@ -139,7 +109,6 @@ final class FileProviderExtension: NSFileProviderExtension {
completionHandler(nil)
} catch {
completionHandler(error)
}
}
@@ -148,9 +117,11 @@ final class FileProviderExtension: NSFileProviderExtension {
Task {
autoreleasepool {
Task {
let backgroundSession = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance)
let pathComponents = url.pathComponents
let utilityFileSystem = NCUtilityFileSystem()
let itemIdentifier = NSFileProviderItemIdentifier(pathComponents[pathComponents.count - 2])
guard let metadata = await self.database.getMetadataFromOcIdAndocIdTransferAsync(itemIdentifier.rawValue) else {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAndocIdTransferAsync(itemIdentifier.rawValue) else {
completionHandler(NSFileProviderError(.noSuchItem))
return
}
@@ -166,14 +137,14 @@ final class FileProviderExtension: NSFileProviderExtension {
let ocId = metadata.ocId
// Exists
if let tableLocalFile = await self.database.getTableLocalFileAsync(predicate: NSPredicate(format: "ocId == %@", metadata.ocId)),
fileProviderUtility().fileProviderStorageExists(metadata),
if let tableLocalFile = await NCManageDatabase.shared.getTableLocalFileAsync(predicate: NSPredicate(format: "ocId == %@", metadata.ocId)),
NCUtilityFileSystem().fileProviderStorageExists(metadata),
tableLocalFile.etag == metadata.etag {
completionHandler(nil)
return
}
await fileProviderData.signalEnumerator(ocId: ocId, type: .update)
await FileProviderData.shared.signalEnumerator(ocId: ocId, type: .update)
let (task, error) = backgroundSession.download(serverUrlFileName: serverUrlFileName,
fileNameLocalPath: fileNameLocalPath,
@@ -182,12 +153,13 @@ final class FileProviderExtension: NSFileProviderExtension {
sessionIdentifier: NCNetworking.shared.sessionDownloadBackgroundExt)
if let task, error == .success {
await self.database.setMetadataSessionAsync(ocId: metadata.ocId,
session: NCNetworking.shared.sessionDownload,
sessionTaskIdentifier: task.taskIdentifier,
sessionError: "",
selector: "",
status: NCGlobal.shared.metadataStatusDownloading)
await NCManageDatabase.shared.setMetadataSessionAsync(
ocId: metadata.ocId,
session: NCNetworking.shared.sessionDownload,
sessionTaskIdentifier: task.taskIdentifier,
sessionError: "",
selector: "",
status: NCGlobal.shared.metadataStatusDownloading)
do {
if let domain = self.domain,
let manager = NSFileProviderManager(for: domain) {
@@ -199,9 +171,9 @@ final class FileProviderExtension: NSFileProviderExtension {
print(error)
}
await fileProviderData.signalEnumerator(ocId: metadata.ocId, type: .update)
await FileProviderData.shared.signalEnumerator(ocId: metadata.ocId, type: .update)
fileProviderData.downloadPendingCompletionHandlers[task.taskIdentifier] = completionHandler
FileProviderData.shared.downloadPendingCompletionHandlers[task.taskIdentifier] = completionHandler
task.resume()
}
@@ -214,24 +186,26 @@ final class FileProviderExtension: NSFileProviderExtension {
Task {
autoreleasepool {
Task {
let backgroundSession = NKBackground(nkCommonInstance: NextcloudKit.shared.nkCommonInstance)
let pathComponents = url.pathComponents
assert(pathComponents.count > 2)
let itemIdentifier = NSFileProviderItemIdentifier(pathComponents[pathComponents.count - 2])
let fileName = pathComponents[pathComponents.count - 1]
guard let metadata = await self.database.getMetadataFromOcIdAndocIdTransferAsync(itemIdentifier.rawValue),
metadata.status == global.metadataStatusNormal else {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAndocIdTransferAsync(itemIdentifier.rawValue),
metadata.status == NCGlobal.shared.metadataStatusNormal else {
return
}
let serverUrlFileName = utilityFileSystem.createServerUrl(serverUrl: metadata.serverUrl, fileName: fileName)
let serverUrlFileName = NCUtilityFileSystem().createServerUrl(serverUrl: metadata.serverUrl, fileName: fileName)
let ocId = metadata.ocId
let account = metadata.account
await self.database.setMetadataSessionAsync(ocId: ocId,
session: NCNetworking.shared.sessionUploadBackgroundExt,
sessionTaskIdentifier: 0,
sessionError: "",
selector: "",
status: NCGlobal.shared.metadataStatusUploading)
await NCManageDatabase.shared.setMetadataSessionAsync(
ocId: ocId,
session: NCNetworking.shared.sessionUploadBackgroundExt,
sessionTaskIdentifier: 0,
sessionError: "",
selector: "",
status: NCGlobal.shared.metadataStatusUploading)
let (task, error) = await backgroundSession.uploadAsync(serverUrlFileName: serverUrlFileName,
fileNameLocalPath: url.path,
@@ -243,9 +217,10 @@ final class FileProviderExtension: NSFileProviderExtension {
sessionIdentifier: NCNetworking.shared.sessionUploadBackgroundExt)
if let task, error == .success {
await self.database.setMetadataSessionAsync(ocId: ocId,
sessionTaskIdentifier: task.taskIdentifier,
status: NCGlobal.shared.metadataStatusUploading)
await NCManageDatabase.shared.setMetadataSessionAsync(
ocId: ocId,
sessionTaskIdentifier: task.taskIdentifier,
status: NCGlobal.shared.metadataStatusUploading)
do {
if let domain = self.domain,
@@ -258,7 +233,7 @@ final class FileProviderExtension: NSFileProviderExtension {
print(error)
}
await fileProviderData.signalEnumerator(ocId: ocId, type: .update)
await FileProviderData.shared.signalEnumerator(ocId: ocId, type: .update)
task.resume()
}
@@ -272,7 +247,7 @@ final class FileProviderExtension: NSFileProviderExtension {
let pathComponents = url.pathComponents
assert(pathComponents.count > 2)
let itemIdentifier = NSFileProviderItemIdentifier(pathComponents[pathComponents.count - 2])
guard let metadata = await self.database.getMetadataFromOcIdAndocIdTransferAsync(itemIdentifier.rawValue) else {
guard let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAndocIdTransferAsync(itemIdentifier.rawValue) else {
return
}
@@ -298,11 +273,12 @@ final class FileProviderExtension: NSFileProviderExtension {
Task {
autoreleasepool {
Task {
guard let session = fileProviderData.session,
let tableDirectory = await self.providerUtility.getTableDirectoryFromParentItemIdentifierAsync(
let utilityFileSystem = NCUtilityFileSystem()
guard let session = FileProviderData.shared.session,
let tableDirectory = await fileProviderUtility().getTableDirectoryFromParentItemIdentifierAsync(
parentItemIdentifier,
account: session.account,
homeServerUrl: self.utilityFileSystem.getHomeServer(session: session)
homeServerUrl: utilityFileSystem.getHomeServer(session: session)
) else {
completionHandler(nil, NSFileProviderError(.noSuchItem))
return
@@ -313,7 +289,7 @@ final class FileProviderExtension: NSFileProviderExtension {
_ = fileURL.startAccessingSecurityScopedResource()
do {
let attributes = try self.providerUtility.fileManager.attributesOfItem(atPath: fileURL.path)
let attributes = try fileProviderUtility().fileManager.attributesOfItem(atPath: fileURL.path)
size = attributes[.size] as? Int64 ?? 0
if attributes[.type] as? FileAttributeType == .typeDirectory {
completionHandler(nil, NSFileProviderError(.noSuchItem))
@@ -324,34 +300,38 @@ final class FileProviderExtension: NSFileProviderExtension {
return
}
let fileName = self.utilityFileSystem.createFileName(fileURL.lastPathComponent,
serverUrl: tableDirectory.serverUrl,
account: session.account)
let fileName = fileProviderUtility().createFileName(fileURL.lastPathComponent,
serverUrl: tableDirectory.serverUrl,
account: session.account)
let ocIdTransfer = UUID().uuidString.lowercased()
NSFileCoordinator().coordinate(readingItemAt: fileURL,
options: .withoutChanges,
error: &errorCoordinator) { url in
self.providerUtility.copyFile(url.path,
toPath: self.utilityFileSystem.getDirectoryProviderStorageOcId(ocIdTransfer,
fileName: fileName,
userId: session.userId,
urlBase: session.urlBase))
NSFileCoordinator().coordinate(
readingItemAt: fileURL,
options: .withoutChanges,
error: &errorCoordinator) { url in
NCUtilityFileSystem().copyFile(
atPath: url.path,
toPath: utilityFileSystem.getDirectoryProviderStorageOcId(
ocIdTransfer,
fileName: fileName,
userId: session.userId,
urlBase: session.urlBase))
}
fileURL.stopAccessingSecurityScopedResource()
let metadata = await self.database.createMetadataAsync(fileName: fileName,
ocId: ocIdTransfer,
serverUrl: tableDirectory.serverUrl,
session: session,
sceneIdentifier: nil)
let metadata = await NCManageDatabaseCreateMetadata().createMetadataAsync(
fileName: fileName,
ocId: ocIdTransfer,
serverUrl: tableDirectory.serverUrl,
session: session,
sceneIdentifier: nil)
metadata.session = NCNetworking.shared.sessionUploadBackgroundExt
metadata.size = size
metadata.status = NCGlobal.shared.metadataStatusUploading
await database.addMetadataAsync(metadata)
await NCManageDatabase.shared.addMetadataAsync(metadata)
let serverUrlFileName = utilityFileSystem.createServerUrl(serverUrl: tableDirectory.serverUrl, fileName: fileName)
let fileNameLocalPath = utilityFileSystem.getDirectoryProviderStorageOcId(ocIdTransfer,
fileName: fileName,
@@ -369,9 +349,10 @@ final class FileProviderExtension: NSFileProviderExtension {
sessionIdentifier: metadata.session)
if let task, error == .success {
await self.database.setMetadataSessionAsync(ocId: metadata.ocId,
sessionTaskIdentifier: task.taskIdentifier,
status: NCGlobal.shared.metadataStatusUploading)
await NCManageDatabase.shared.setMetadataSessionAsync(
ocId: metadata.ocId,
sessionTaskIdentifier: task.taskIdentifier,
status: NCGlobal.shared.metadataStatusUploading)
do {
if let domain = self.domain,
@@ -384,7 +365,7 @@ final class FileProviderExtension: NSFileProviderExtension {
print(error)
}
await fileProviderData.signalEnumerator(ocId: metadata.ocId, type: .update)
await FileProviderData.shared.signalEnumerator(ocId: metadata.ocId, type: .update)
task.resume()
+16 -12
View File
@@ -12,7 +12,7 @@ class FileProviderItem: NSObject, NSFileProviderItem {
/// Providing Required Properties
var itemIdentifier: NSFileProviderItemIdentifier {
return fileProviderUtility().getItemIdentifier(metadata: metadata)
return NSFileProviderItemIdentifier(metadata.ocId)
}
var filename: String {
return metadata.fileNameView
@@ -58,11 +58,15 @@ class FileProviderItem: NSObject, NSFileProviderItem {
return metadata.etag.data(using: .utf8)
}
var isMostRecentVersionDownloaded: Bool {
if NCManageDatabase.shared.getResultTableLocalFile(ocId: metadata.ocId) == nil {
return false
} else {
if metadata.directory {
return true
}
let path = NCUtilityFileSystem().getDirectoryProviderStorageOcId(metadata.ocId, fileName: metadata.fileName, userId: metadata.userId, urlBase: metadata.urlBase)
guard let attributes = try? FileManager.default.attributesOfItem(atPath: path),
let fileSize = attributes[.size] as? UInt64 else {
return false
}
return fileSize > 0
}
/// Monitoring File Transfers
var isUploading: Bool {
@@ -90,11 +94,15 @@ class FileProviderItem: NSObject, NSFileProviderItem {
}
}
var isDownloaded: Bool {
if NCUtilityFileSystem().fileProviderStorageExists(metadata) {
if metadata.directory {
return true
} else {
return false
}
let path = NCUtilityFileSystem().getDirectoryProviderStorageOcId(metadata.ocId, fileName: metadata.fileName, userId: metadata.userId, urlBase: metadata.urlBase)
guard let attributes = try? FileManager.default.attributesOfItem(atPath: path),
let fileSize = attributes[.size] as? UInt64 else {
return false
}
return fileSize > 0
}
var downloadingError: Error? {
if metadata.status == NCGlobal.shared.metadataStatusDownloadError {
@@ -106,11 +114,7 @@ class FileProviderItem: NSObject, NSFileProviderItem {
/// Sharing
/// Managing Metadata
var tagData: Data? {
if let tableTag = NCManageDatabase.shared.getTag(predicate: NSPredicate(format: "ocId == %@", metadata.ocId)) {
return tableTag.tagIOS
} else {
return nil
}
return nil
}
var favoriteRank: NSNumber? {
if let rank = FileProviderData.shared.listFavoriteIdentifierRank[metadata.ocId] {
@@ -4,14 +4,11 @@
import UIKit
import NextcloudKit
import FileProvider
class fileProviderUtility: NSObject {
let fileManager = FileManager()
let utilityFileSystem = NCUtilityFileSystem()
let database = NCManageDatabase.shared
/// Returns the expected documentStorageURL for a specific domain or constructs a fallback path manually.
/// This is used to ensure consistency even in single-domain fallback mode.
func getDocumentStorageURL(for domain: NSFileProviderDomain?, userId: String, urlBase: String) -> URL? {
guard let urlBase = NSURL(string: urlBase),
let host = urlBase.host else {
@@ -39,17 +36,17 @@ class fileProviderUtility: NSObject {
func getAccountFromItemIdentifier(_ itemIdentifier: NSFileProviderItemIdentifier) -> String? {
let ocId = itemIdentifier.rawValue
return self.database.getMetadataFromOcId(ocId)?.account
return NCManageDatabase.shared.getMetadataFromOcId(ocId)?.account
}
func getTableMetadataFromItemIdentifier(_ itemIdentifier: NSFileProviderItemIdentifier) -> tableMetadata? {
let ocId = itemIdentifier.rawValue
return self.database.getMetadataFromOcId(ocId)
return NCManageDatabase.shared.getMetadataFromOcId(ocId)
}
func getTableMetadataFromItemIdentifierAsync(_ itemIdentifier: NSFileProviderItemIdentifier) async -> tableMetadata? {
let ocId = itemIdentifier.rawValue
return await self.database.getMetadataFromOcIdAsync(ocId)
return await NCManageDatabase.shared.getMetadataFromOcIdAsync(ocId)
}
func getItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier {
@@ -57,13 +54,13 @@ class fileProviderUtility: NSObject {
}
func getParentItemIdentifier(metadata: tableMetadata) -> NSFileProviderItemIdentifier? {
let homeServerUrl = utilityFileSystem.getHomeServer(urlBase: metadata.urlBase, userId: metadata.userId)
if let directory = self.database.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) {
let homeServerUrl = NCUtilityFileSystem().getHomeServer(urlBase: metadata.urlBase, userId: metadata.userId)
if let directory = NCManageDatabase.shared.getTableDirectory(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) {
if directory.serverUrl == homeServerUrl {
return NSFileProviderItemIdentifier(NSFileProviderItemIdentifier.rootContainer.rawValue)
} else {
// get the metadata.ocId of parent Directory
if let metadata = self.database.getMetadataFromOcId(directory.ocId) {
if let metadata = NCManageDatabase.shared.getMetadataFromOcId(directory.ocId) {
let identifier = getItemIdentifier(metadata: metadata)
return identifier
}
@@ -73,13 +70,13 @@ class fileProviderUtility: NSObject {
}
func getParentItemIdentifierAsync(metadata: tableMetadata) async -> NSFileProviderItemIdentifier? {
let homeServerUrl = utilityFileSystem.getHomeServer(urlBase: metadata.urlBase, userId: metadata.userId)
if let directory = await self.database.getTableDirectoryAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) {
let homeServerUrl = NCUtilityFileSystem().getHomeServer(urlBase: metadata.urlBase, userId: metadata.userId)
if let directory = await NCManageDatabase.shared.getTableDirectoryAsync(predicate: NSPredicate(format: "account == %@ AND serverUrl == %@", metadata.account, metadata.serverUrl)) {
if directory.serverUrl == homeServerUrl {
return NSFileProviderItemIdentifier(NSFileProviderItemIdentifier.rootContainer.rawValue)
} else {
// get the metadata.ocId of parent Directory
if let metadata = await self.database.getMetadataFromOcIdAsync(directory.ocId) {
if let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(directory.ocId) {
let identifier = getItemIdentifier(metadata: metadata)
return identifier
}
@@ -88,6 +85,23 @@ class fileProviderUtility: NSObject {
return nil
}
func getParentItemIdentifierAsync(session: NCSession.Session, directory: tableDirectory?) async -> NSFileProviderItemIdentifier? {
let homeServerUrl = NCUtilityFileSystem().getHomeServer(urlBase: session.urlBase, userId: session.userId)
guard let directory else {
return nil
}
if directory.serverUrl == homeServerUrl {
return NSFileProviderItemIdentifier(NSFileProviderItemIdentifier.rootContainer.rawValue)
} else {
// get the metadata.ocId of parent Directory
if let metadata = await NCManageDatabase.shared.getMetadataFromOcIdAsync(directory.ocId) {
let identifier = getItemIdentifier(metadata: metadata)
return identifier
}
}
return nil
}
func getTableDirectoryFromParentItemIdentifier(_ parentItemIdentifier: NSFileProviderItemIdentifier, account: String, homeServerUrl: String) -> tableDirectory? {
var predicate: NSPredicate
if parentItemIdentifier == .rootContainer {
@@ -96,7 +110,7 @@ class fileProviderUtility: NSObject {
guard let metadata = getTableMetadataFromItemIdentifier(parentItemIdentifier) else { return nil }
predicate = NSPredicate(format: "ocId == %@", metadata.ocId)
}
guard let directory = self.database.getTableDirectory(predicate: predicate) else { return nil }
guard let directory = NCManageDatabase.shared.getTableDirectory(predicate: predicate) else { return nil }
return directory
}
@@ -110,80 +124,80 @@ class fileProviderUtility: NSObject {
}
predicate = NSPredicate(format: "ocId == %@", metadata.ocId)
}
guard let directory = await self.database.getTableDirectoryAsync(predicate: predicate) else {
guard let directory = await NCManageDatabase.shared.getTableDirectoryAsync(predicate: predicate) else {
return nil
}
return directory
}
func copyFile(_ atPath: String, toPath: String) {
if !fileManager.fileExists(atPath: atPath) { return }
func createFileName(_ fileName: String, serverUrl: String, account: String) -> String {
var resultFileName = fileName
var exitLoop = false
do {
try fileManager.removeItem(atPath: toPath)
} catch let error {
print("Error: \(error.localizedDescription)")
}
do {
try fileManager.copyItem(atPath: atPath, toPath: toPath)
} catch let error {
print("Error: \(error.localizedDescription)")
}
}
while exitLoop == false {
if NCManageDatabase.shared.getMetadata(predicate: NSPredicate(format: "fileNameView ==[c] %@ AND serverUrl == %@ AND account == %@", resultFileName, serverUrl, account)) != nil {
var name = NSString(string: resultFileName).deletingPathExtension
let ext = NSString(string: resultFileName).pathExtension
let characters = Array(name)
func moveFile(_ atPath: String, toPath: String) {
if !fileManager.fileExists(atPath: atPath) { return }
do {
try fileManager.removeItem(atPath: toPath)
} catch let error {
print("Error: \(error.localizedDescription)")
}
do {
try fileManager.moveItem(atPath: atPath, toPath: toPath)
} catch let error {
print("Error: \(error.localizedDescription)")
}
}
func getFileSize(from url: URL) -> Int64? {
do {
let attributes = try fileManager.attributesOfItem(atPath: url.path)
if let fileSize = attributes[FileAttributeKey.size] as? Int64 {
return fileSize
if characters.count < 2 {
if ext.isEmpty {
resultFileName = name + " " + "1"
} else {
resultFileName = name + " " + "1" + "." + ext
}
} else {
let space = characters[characters.count - 2]
let numChar = characters[characters.count - 1]
var num = Int(String(numChar))
if space == " " && num != nil {
name = String(name.dropLast())
num = num! + 1
if ext.isEmpty {
resultFileName = name + "\(num!)"
} else {
resultFileName = name + "\(num!)" + "." + ext
}
} else {
if ext.isEmpty {
resultFileName = name + " " + "1"
} else {
resultFileName = name + " " + "1" + "." + ext
}
}
}
} else {
print("Failed to retrieve file size.")
return nil
exitLoop = true
}
} catch {
print("Error: \(error.localizedDescription)")
return nil
}
return resultFileName
}
func fileProviderStorageExists(_ metadata: tableMetadata) -> Bool {
let pathA = utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, fileName: metadata.fileName, userId: metadata.userId, urlBase: metadata.urlBase)
let pathB = utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId, fileName: metadata.fileNameView, userId: metadata.userId, urlBase: metadata.urlBase)
let sizeA = fileSize(at: pathA)
let sizeB = fileSize(at: pathB)
if metadata.isDirectoryE2EE == true {
return (sizeA == metadata.size || sizeB == metadata.size) && sizeB > 0
func getVersionBuild() -> String {
if let dictionary = Bundle.main.infoDictionary,
let version = dictionary["CFBundleShortVersionString"],
let build = dictionary["CFBundleVersion"] {
return "\(version).\(build)"
}
return sizeB == metadata.size && metadata.size > 0
return ""
}
private func fileSize(at path: String) -> UInt64 {
do {
let attr = try fileManager.attributesOfItem(atPath: path)
return attr[.size] as? UInt64 ?? 0
} catch {
nkLog(error: " [fileSize] Errore accesso a '\(path)': \(error)")
return 0
func getVersionMaintenance() -> String {
if let dictionary = Bundle.main.infoDictionary,
let version = dictionary["CFBundleShortVersionString"] {
return "\(version)"
}
return ""
}
func ocIdToFileId(ocId: String?) -> String? {
guard let ocId = ocId else { return nil }
let items = ocId.components(separatedBy: "oc")
if items.count < 2 { return nil }
guard let intFileId = Int(items[0]) else { return nil }
return String(intFileId)
}
}
@@ -0,0 +1,48 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2025 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Foundation
import NextcloudKit
import RealmSwift
final class NCManageDatabase {
static let shared = NCManageDatabase()
internal let core: NCManageDatabaseCore
internal let databaseURL: URL?
private init() {
self.core = NCManageDatabaseCore()
if let dirGroup = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: NCBrandOptions.shared.capabilitiesGroup) {
self.databaseURL = dirGroup
.appendingPathComponent(NCGlobal.shared.appDatabaseNextcloud)
.appendingPathComponent(databaseName)
} else {
self.databaseURL = nil
}
}
func openRealm() {
do {
let configuration = Realm.Configuration(
fileURL: databaseURL,
schemaVersion: databaseSchemaVersion,
objectTypes: [
NCKeyValue.self, tableMetadata.self, tableMetadataTag.self, tableLocalFile.self,
tableDirectory.self, tableTag.self, tableAccount.self
]
)
Realm.Configuration.defaultConfiguration = configuration
let realm = try Realm(configuration: configuration)
if let url = realm.configuration.fileURL {
nkLog(tag: NCGlobal.shared.logTagDatabase, emoji: .start, message: "Realm is located at: \(url.path)", consoleOnly: true)
}
} catch let error {
nkLog(tag: NCGlobal.shared.logTagDatabase, emoji: .error, message: "Realm error: \(error)")
isSuspendingDatabaseOperation = true
}
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,366 @@
{
"originHash" : "b092e04dd25276db24ca02e5c41e732c10cb4045264d961e3b6b734943656553",
"pins" : [
{
"identity" : "abseil-cpp-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/abseil-cpp-binary.git",
"state" : {
"revision" : "bbe8b69694d7873315fd3a4ad41efe043e1c07c5",
"version" : "1.2024072200.0"
}
},
{
"identity" : "alamofire",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Alamofire/Alamofire",
"state" : {
"revision" : "3494b7c1d4e08be98bbb2244fd55ca5a029ff4a2",
"version" : "5.12.1"
}
},
{
"identity" : "app-check",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/app-check.git",
"state" : {
"revision" : "3e33dd27dd4c69bd81c7c81fe61d8ccf58846902",
"version" : "11.3.1"
}
},
{
"identity" : "codescanner",
"kind" : "remoteSourceControl",
"location" : "https://github.com/twostraws/CodeScanner.git",
"state" : {
"revision" : "5e886430238944c7200fc9e10dbf2d9550dba865",
"version" : "2.5.2"
}
},
{
"identity" : "dropdown",
"kind" : "remoteSourceControl",
"location" : "https://github.com/AssistoLab/DropDown",
"state" : {
"branch" : "master",
"revision" : "2ab6f6ce19f0117d1a76ea043ef8f57722c65d16"
}
},
{
"identity" : "easytipview",
"kind" : "remoteSourceControl",
"location" : "https://github.com/marinofaggiana/EasyTipView",
"state" : {
"branch" : "master",
"revision" : "bb25a13c8fa5d65144c8e5b5d31237b80a001b07"
}
},
{
"identity" : "firebase-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/firebase-ios-sdk",
"state" : {
"revision" : "346daa9f46316aa372b35b317e18224acc2e9063",
"version" : "12.18.0"
}
},
{
"identity" : "google-ads-on-device-conversion-ios-sdk",
"kind" : "remoteSourceControl",
"location" : "https://github.com/googleads/google-ads-on-device-conversion-ios-sdk",
"state" : {
"revision" : "dc39082d8881109d35b94b1c122164c0e8d08a55",
"version" : "3.6.1"
}
},
{
"identity" : "googleappmeasurement",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleAppMeasurement.git",
"state" : {
"revision" : "f04760d460296cc0fa430935a7be212e5bd67fc5",
"version" : "12.18.0"
}
},
{
"identity" : "googledatatransport",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleDataTransport.git",
"state" : {
"revision" : "ba3358d3c3dbae8ef230b58a46b97ad65e84e974",
"version" : "10.1.1"
}
},
{
"identity" : "googleutilities",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/GoogleUtilities.git",
"state" : {
"revision" : "92c8f6dc3ac375d6febdfcb3db68bc3d10633db3",
"version" : "8.1.3"
}
},
{
"identity" : "grpc-binary",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/grpc-binary.git",
"state" : {
"revision" : "75b31c842f664a0f46a2e590a570e370249fd8f6",
"version" : "1.69.1"
}
},
{
"identity" : "gtm-session-fetcher",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/gtm-session-fetcher.git",
"state" : {
"revision" : "724a52eea6329b7e12d3ad8300d76ca9f3895fcc",
"version" : "5.3.1"
}
},
{
"identity" : "gzipswift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/1024jp/GzipSwift",
"state" : {
"revision" : "99cf703b461916279cbbb50068e904df86c37133",
"version" : "6.0.0"
}
},
{
"identity" : "interop-ios-for-google-sdks",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/interop-ios-for-google-sdks.git",
"state" : {
"revision" : "040d087ac2267d2ddd4cca36c757d1c6a05fdbfe",
"version" : "101.0.0"
}
},
{
"identity" : "keychainaccess",
"kind" : "remoteSourceControl",
"location" : "https://github.com/kishikawakatsumi/KeychainAccess",
"state" : {
"revision" : "84e546727d66f1adc5439debad16270d0fdd04e7",
"version" : "4.2.2"
}
},
{
"identity" : "leveldb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/leveldb.git",
"state" : {
"revision" : "a0bc79961d7be727d258d33d5a6b2f1023270ba1",
"version" : "1.22.5"
}
},
{
"identity" : "lucidbanner",
"kind" : "remoteSourceControl",
"location" : "https://github.com/marinofaggiana/LucidBanner",
"state" : {
"revision" : "d7ea11cac476f32f63e0ad60f393bc7937b1d019",
"version" : "0.7.1"
}
},
{
"identity" : "mantis",
"kind" : "remoteSourceControl",
"location" : "https://github.com/marinofaggiana/Mantis",
"state" : {
"revision" : "d145ce2403e0d94d4926eb8510bc4966fbf1bfca",
"version" : "1.0.0"
}
},
{
"identity" : "markdownkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/bmoliveira/MarkdownKit",
"state" : {
"revision" : "39ea7a3fc7e65bcafe55152592b834859be574a5",
"version" : "1.7.3"
}
},
{
"identity" : "nanopb",
"kind" : "remoteSourceControl",
"location" : "https://github.com/firebase/nanopb.git",
"state" : {
"revision" : "3851d94a41890dea16dc3db34caf60e585cb4163",
"version" : "2.30910.1"
}
},
{
"identity" : "nextcloudkit",
"kind" : "remoteSourceControl",
"location" : "https://github.com/nextcloud/NextcloudKit",
"state" : {
"branch" : "unified-sharing",
"revision" : "1897d66c1687d85ec7c5acbf9fe7fd396b511257"
}
},
{
"identity" : "openssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/krzyzanowskim/OpenSSL",
"state" : {
"revision" : "4b1188ba947ddc23d03b13096b9e44b804e146c9",
"version" : "3.6.3000"
}
},
{
"identity" : "popupview",
"kind" : "remoteSourceControl",
"location" : "https://github.com/exyte/PopupView.git",
"state" : {
"revision" : "62e1698164c352e4cae074bb30eff011ef1b9af6",
"version" : "5.0.5"
}
},
{
"identity" : "promises",
"kind" : "remoteSourceControl",
"location" : "https://github.com/google/promises.git",
"state" : {
"revision" : "f4a19a3c313dc2616c70bb49d29a799fb16be837",
"version" : "2.4.1"
}
},
{
"identity" : "qrcodereader.swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/yannickl/QRCodeReader.swift",
"state" : {
"revision" : "5020b5a47199d8ba80c83a4b4fafd70e9dc9dc7f",
"version" : "10.1.1"
}
},
{
"identity" : "realm-core",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-core.git",
"state" : {
"revision" : "b4192c46305570577c4d08df790fddec5ab3aa04",
"version" : "20.1.5"
}
},
{
"identity" : "realm-swift",
"kind" : "remoteSourceControl",
"location" : "https://github.com/realm/realm-swift",
"state" : {
"revision" : "ca03df491ec5e4bb8af0bca1e9957d08c10ec2da",
"version" : "20.0.5"
}
},
{
"identity" : "swift-atomics",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-atomics.git",
"state" : {
"revision" : "0442cb5a3f98ab802acb777929fdb446bda11a34",
"version" : "1.3.1"
}
},
{
"identity" : "swift-collections",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-collections.git",
"state" : {
"revision" : "a0cb0954ecb21e4e31b0070e6ed5674e8556685a",
"version" : "1.6.0"
}
},
{
"identity" : "swift-nio",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio.git",
"state" : {
"revision" : "a931f2c1de8dd49381ce3bf2e279d033f68d8865",
"version" : "2.102.0"
}
},
{
"identity" : "swift-nio-ssl",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-nio-ssl",
"state" : {
"revision" : "03827c1a9fdb2b6b00a4e93ede8861520263af8c",
"version" : "2.37.4"
}
},
{
"identity" : "swift-system",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-system.git",
"state" : {
"revision" : "869129b7bf4ecc57b97d0193ad29690ca2134750",
"version" : "1.8.1"
}
},
{
"identity" : "swifter",
"kind" : "remoteSourceControl",
"location" : "https://github.com/httpswift/swifter.git",
"state" : {
"branch" : "stable",
"revision" : "1e4f51c92d7ca486242d8bf0722b99de2c3531aa"
}
},
{
"identity" : "swiftrichstring",
"kind" : "remoteSourceControl",
"location" : "https://github.com/malcommac/SwiftRichString",
"state" : {
"revision" : "9bf4b5af6bb4386865636fc504d6c588c2b65040",
"version" : "3.7.2"
}
},
{
"identity" : "swiftyjson",
"kind" : "remoteSourceControl",
"location" : "https://github.com/SwiftyJSON/SwiftyJSON",
"state" : {
"revision" : "af76cf3ef710b6ca5f8c05f3a31307d44a3c5828",
"version" : "5.0.2"
}
},
{
"identity" : "swiftyxmlparser",
"kind" : "remoteSourceControl",
"location" : "https://github.com/yahoojapan/SwiftyXMLParser",
"state" : {
"revision" : "d7a1d23f04c86c1cd2e8f19247dd15d74e0ea8be",
"version" : "5.6.0"
}
},
{
"identity" : "taglistview",
"kind" : "remoteSourceControl",
"location" : "https://github.com/ElaWorkshop/TagListView",
"state" : {
"revision" : "b30b61826736f4d9ec04aef5df891f3914423f16",
"version" : "1.4.1"
}
},
{
"identity" : "tlphotopicker",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tilltue/TLPhotoPicker",
"state" : {
"revision" : "91d7bca65721928af30c6a2bb1a1f517f7862964",
"version" : "2.1.21"
}
},
{
"identity" : "vlckit-spm",
"kind" : "remoteSourceControl",
"location" : "https://github.com/tylerjonesio/vlckit-spm",
"state" : {
"revision" : "e932bbd488872fdb74f6654d28c2f291eae03daf",
"version" : "3.6.0"
}
}
],
"version" : 3
}
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1630"
LastUpgradeVersion = "2640"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1630"
LastUpgradeVersion = "2640"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
@@ -121,9 +121,9 @@
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<RemoteRunnable
runnableDebuggingMode = "0"
runnableDebuggingMode = "1"
BundleIdentifier = "it.twsweb.Nextcloud"
RemotePath = "/var/containers/Bundle/Application/92F13FE8-7056-4509-8468-5856675AB1CA/Nextcloud.app">
RemotePath = "/Users/marinofaggiana/Library/Developer/CoreSimulator/Devices/F424A0A4-ADE0-4955-969F-C6426054B5C6/data/Containers/Bundle/Application/76DC966F-BA80-4ECE-B970-4FCAF9F503D8/Nextcloud.app">
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1630"
LastUpgradeVersion = "2640"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
@@ -140,6 +140,10 @@
argument = "whitelist:NETWORKING TASKS"
isEnabled = "NO">
</CommandLineArgument>
<CommandLineArgument
argument = "-FIRDebugEnabled"
isEnabled = "YES">
</CommandLineArgument>
<CommandLineArgument
argument = "blacklist:"
isEnabled = "NO">
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1630"
LastUpgradeVersion = "2640"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1630"
LastUpgradeVersion = "2640"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1630"
LastUpgradeVersion = "2640"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1630"
LastUpgradeVersion = "2640"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
@@ -21,12 +21,14 @@
import UIKit
import UserNotifications
import os
import NextcloudKit
class NotificationService: UNNotificationServiceExtension {
var contentHandler: ((UNNotificationContent) -> Void)?
var bestAttemptContent: UNMutableNotificationContent?
var request: UNNotificationRequest?
private let deliveryLock = OSAllocatedUnfairLock()
override func didReceive(_ request: UNNotificationRequest, withContentHandler contentHandler: @escaping (UNNotificationContent) -> Void) {
self.contentHandler = contentHandler
@@ -35,59 +37,101 @@ class NotificationService: UNNotificationServiceExtension {
NextcloudKit.configureLogger(logLevel: .verbose)
if let bestAttemptContent = bestAttemptContent {
bestAttemptContent.title = ""
bestAttemptContent.body = "Nextcloud notification"
do {
if let message = bestAttemptContent.userInfo["subject"] as? String {
for tableAccount in NCManageDatabase.shared.getAllTableAccount() {
guard let privateKey = NCPreferences().getPushNotificationPrivateKey(account: tableAccount.account) else {
bestAttemptContent.body = "Error retrieving private key for \(tableAccount.account)"
continue
}
guard let bestAttemptContent else { return }
let prefixData = Data(privateKey.prefix(8))
let prefixBase64 = prefixData.base64EncodedString()
nkLog(debug: "🔑 Loaded private key for \(tableAccount.account): prefix(Base64)=\(prefixBase64)")
bestAttemptContent.title = ""
bestAttemptContent.body = "Nextcloud notification"
guard let decryptedMessage = NCPushNotificationEncryption.shared().decryptPushNotification(message, withDevicePrivateKey: privateKey) else {
bestAttemptContent.body = "Error decryption for \(tableAccount.account)"
continue
}
guard let data = decryptedMessage.data(using: .utf8) else {
bestAttemptContent.body = "Error decryption data utf8 for \(tableAccount.account)"
continue
}
var matchedAccount: tableAccount?
var payload: [String: AnyObject]?
if var json = try JSONSerialization.jsonObject(with: data) as? [String: AnyObject],
let subject = json["subject"] as? String {
bestAttemptContent.body = subject
if let pref = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroup) {
json["account"] = tableAccount.account as AnyObject
pref.set(json, forKey: "NOTIFICATION_DATA")
pref.synchronize()
}
} else {
bestAttemptContent.body = "Error JSON Serialization for \(tableAccount.account)"
}
break
do {
if let message = bestAttemptContent.userInfo["subject"] as? String {
for tableAccount in NCManageDatabase.shared.getAllTableAccount() {
guard let privateKey = NCPreferences().getPushNotificationPrivateKey(account: tableAccount.account) else {
bestAttemptContent.body = "Error retrieving private key for \(tableAccount.account)"
continue
}
let prefixData = Data(privateKey.prefix(8))
let prefixBase64 = prefixData.base64EncodedString()
nkLog(debug: "🔑 Loaded private key for \(tableAccount.account): prefix(Base64)=\(prefixBase64)")
guard let decryptedMessage = NCPushNotificationEncryption.shared().decryptPushNotification(message, withDevicePrivateKey: privateKey) else {
bestAttemptContent.body = "Error decrypting notification for \(tableAccount.account)"
continue
}
guard let data = decryptedMessage.data(using: .utf8) else {
bestAttemptContent.body = "Error decrypting UTF8 notification data for \(tableAccount.account)"
continue
}
if var json = try JSONSerialization.jsonObject(with: data) as? [String: AnyObject],
let subject = json["subject"] as? String {
bestAttemptContent.body = subject
if let pref = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroup) {
json["account"] = tableAccount.account as AnyObject
pref.set(json, forKey: "NOTIFICATION_DATA")
pref.synchronize()
}
matchedAccount = tableAccount
payload = json
} else {
bestAttemptContent.body = "Error with notification JSON for \(tableAccount.account)"
}
break
}
} catch let error as NSError {
nkLog(error: "Failed : \(error.localizedDescription)")
}
} catch let error as NSError {
nkLog(error: "Failed : \(error.localizedDescription)")
}
guard let tblAccount = matchedAccount,
let nid = payload?["nid"] as? Int,
payload?["delete"] as? Bool != true,
payload?["delete-all"] as? Bool != true else {
deliver()
return
}
// NextcloudKit Session
NextcloudKit.shared.setup(groupIdentifier: NCBrandOptions.shared.capabilitiesGroup, delegate: NCNetworking.shared)
NextcloudKit.shared.appendSession(account: tblAccount.account,
urlBase: tblAccount.urlBase,
user: tblAccount.user,
userId: tblAccount.userId,
password: NCPreferences().getPassword(account: tblAccount.account),
userAgent: userAgent,
groupIdentifier: NCBrandOptions.shared.capabilitiesGroup)
Task {
let results = await NextcloudKit.shared.getNotificationsAsync(idNotification: nid,
account: tblAccount.account,
options: NKRequestOptions(timeout: 20))
if results.error == .success, let notification = results.notifications?.first {
bestAttemptContent.title = notification.message.isEmpty ? NCBrandOptions.shared.brand : notification.subject
bestAttemptContent.body = notification.message.isEmpty ? notification.subject : notification.message
}
contentHandler(bestAttemptContent)
deliver()
}
}
override func serviceExtensionTimeWillExpire() {
// Called just before the extension will be terminated by the system.
// Use this as an opportunity to deliver your "best attempt" at modified content, otherwise the original push payload will be used.
if let contentHandler = contentHandler, let bestAttemptContent = bestAttemptContent {
bestAttemptContent.title = ""
bestAttemptContent.body = "Nextcloud Notification Time Will Expire"
contentHandler(bestAttemptContent)
deliver()
}
private func deliver() {
let handler = deliveryLock.withLock {
let handler = contentHandler
contentHandler = nil
return handler
}
if let handler, let bestAttemptContent {
handler(bestAttemptContent)
}
}
}
+2 -2
View File
@@ -2,7 +2,7 @@
[![Releases](https://img.shields.io/github/release/nextcloud/ios.svg)](https://github.com/nextcloud/ios/releases/latest) [![Build](https://github.com/nextcloud/ios/actions/workflows/xcode.yml/badge.svg)](https://github.com/nextcloud/ios/actions/workflows/xcode.yml) [![SwiftLint](https://github.com/nextcloud/ios/actions/workflows/lint.yml/badge.svg)](https://github.com/nextcloud/ios/actions/workflows/lint.yml)
[![irc](https://img.shields.io/badge/IRC-%23nextcloud--mobile%20on%20freenode-blue.svg)](https://webchat.freenode.net/?channels=nextcloud-mobile)
<img src="Animation.gif" alt="Demo of the Nextcloud iOS files app" width="277" height="600"><img src="widget.png" alt="Widget of the Nextcloud iOS files app" width="277" height="600">
<img src="Animation.gif" alt="Demo of the Nextcloud iOS files app" width="277" height="600">
[<img src="https://developer.apple.com/assets/elements/badges/download-on-the-app-store.svg"
alt="Demo of the Nextcloud iOS files app"
@@ -38,7 +38,7 @@ branch. Maybe start working on [starter issues](https://github.com/nextcloud/ios
Easy starting points are also reviewing [pull requests](https://github.com/nextcloud/ios/pulls)
### Xcode 16 Project Setup
### Xcode 26.1 Project Setup
#### Dependencies
+11 -2
View File
@@ -59,12 +59,18 @@
<constraint firstAttribute="height" constant="40" id="wvf-Ey-woY"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="filename" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rz6-pe-DB5">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="750" verticalHuggingPriority="251" horizontalCompressionResistancePriority="250" text="filename" textAlignment="natural" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="rz6-pe-DB5">
<rect key="frame" x="60" y="10" width="284" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="1000" verticalHuggingPriority="251" horizontalCompressionResistancePriority="1000" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ext-Lb-scl">
<rect key="frame" x="344" y="10" width="0.0" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="size" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QFh-Vy-b4Z">
<rect key="frame" x="60" y="29.999999999999996" width="284" height="14.333333333333332"/>
<fontDescription key="fontDescription" type="system" pointSize="12"/>
@@ -92,13 +98,16 @@
<constraint firstItem="uvl-De-S9p" firstAttribute="leading" secondItem="WGN-Zn-lR8" secondAttribute="leading" constant="10" id="ko0-iM-oWa"/>
<constraint firstItem="rz6-pe-DB5" firstAttribute="top" secondItem="WGN-Zn-lR8" secondAttribute="top" constant="10" id="rF0-WD-Hfk"/>
<constraint firstAttribute="trailing" secondItem="OGY-95-ZYi" secondAttribute="trailing" constant="10" id="si1-LI-Ldn"/>
<constraint firstItem="OGY-95-ZYi" firstAttribute="leading" secondItem="rz6-pe-DB5" secondAttribute="trailing" constant="10" id="vCb-2c-vWa"/>
<constraint firstItem="Ext-Lb-scl" firstAttribute="leading" secondItem="rz6-pe-DB5" secondAttribute="trailing" id="ext-ld-scl"/>
<constraint firstItem="Ext-Lb-scl" firstAttribute="firstBaseline" secondItem="rz6-pe-DB5" secondAttribute="firstBaseline" id="ext-bl-scl"/>
<constraint firstItem="OGY-95-ZYi" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="Ext-Lb-scl" secondAttribute="trailing" constant="10" id="vCb-2c-vWa"/>
<constraint firstItem="QFh-Vy-b4Z" firstAttribute="leading" secondItem="uvl-De-S9p" secondAttribute="trailing" constant="10" id="xAp-ri-eOc"/>
</constraints>
</tableViewCellContentView>
<inset key="separatorInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
<connections>
<outlet property="fileNameCell" destination="rz6-pe-DB5" id="e8w-G7-bBe"/>
<outlet property="fileNameExtensionCell" destination="Ext-Lb-scl" id="ext-out-scl"/>
<outlet property="imageCell" destination="uvl-De-S9p" id="S4F-TD-YGI"/>
<outlet property="moreButton" destination="OGY-95-ZYi" id="vA3-mU-S1e"/>
<outlet property="sizeCell" destination="QFh-Vy-b4Z" id="rmM-qr-QXU"/>
+7 -2
View File
@@ -15,6 +15,7 @@ protocol NCShareCellDelegate: AnyObject {
class NCShareCell: UITableViewCell {
@IBOutlet weak var imageCell: UIImageView!
@IBOutlet weak var fileNameCell: UILabel!
@IBOutlet weak var fileNameExtensionCell: UILabel!
@IBOutlet weak var moreButton: UIButton!
@IBOutlet weak var sizeCell: UILabel!
weak var delegate: (NCShareCellDelegate & UIViewController)?
@@ -41,7 +42,7 @@ class NCShareCell: UITableViewCell {
imageCell.contentMode = .scaleAspectFit
}
fileNameCell?.text = fileName
setBidiSafeFilename(fileName, isDirectory: false, titleLabel: fileNameCell, extensionLabel: fileNameExtensionCell)
let fileSize = utilityFileSystem.getFileSize(filePath: (NSTemporaryDirectory() + fileName))
sizeCell?.text = utilityFileSystem.transformedSize(fileSize)
@@ -50,7 +51,11 @@ class NCShareCell: UITableViewCell {
}
@IBAction func buttonTapped(_ sender: Any) {
let alertController = UIAlertController(title: "", message: fileName, preferredStyle: .alert)
let nsName = fileName as NSString
let ext = nsName.pathExtension
let base = nsName.deletingPathExtension
let displayName = ext.isEmpty || base.isEmpty ? fileName : base + "." + ext
let alertController = UIAlertController(title: "", message: displayName, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: NSLocalizedString("_rename_file_", comment: ""), style: .default) { _ in
self.delegate?.showRenameFileDialog(named: self.fileName, account: self.account)
+14 -18
View File
@@ -19,6 +19,7 @@ extension NCShareExtension: UICollectionViewDelegate {
if metadata.e2eEncrypted && !NCPreferences().isEndToEndEnabled(account: tblAccount.account) {
self.showAlert(title: "_info_", description: "_e2e_goto_settings_for_enable_")
return
}
let capabilities = await NKCapabilities.shared.getCapabilities(for: tblAccount.account)
@@ -81,19 +82,11 @@ extension NCShareExtension: UICollectionViewDataSource {
return cell
}
cell.fileOcId = metadata.ocId
cell.fileOcIdTransfer = metadata.ocIdTransfer
cell.fileUser = metadata.ownerId
cell.labelTitle.text = metadata.fileNameView
cell.metadata = metadata
cell.setBidiSafeFilename(metadata.fileNameView, isDirectory: metadata.directory, titleLabel: cell.labelTitle, extensionLabel: cell.labelExtension)
cell.labelTitle.textColor = NCBrandColor.shared.textColor
cell.imageSelect.image = nil
cell.imageStatus.image = nil
cell.imageLocal.image = nil
cell.imageFavorite.image = nil
cell.imageShared.image = nil
cell.imageMore.image = nil
cell.imageItem.image = nil
cell.imageItem.backgroundColor = nil
cell.labelExtension?.textColor = NCBrandColor.shared.textColor
cell.setButtonsHidden(true)
if metadata.directory {
setupDirectoryCell(cell, indexPath: indexPath, with: metadata)
@@ -103,11 +96,7 @@ extension NCShareExtension: UICollectionViewDataSource {
cell.imageFavorite.image = NCImageCache.shared.getImageFavorite()
}
cell.imageSelect.isHidden = true
cell.backgroundView = nil
cell.hideButtonMore(true)
cell.hideButtonShare(true)
cell.selected(false, isEditMode: false)
cell.writeInfoDateSize(date: metadata.date, size: metadata.size)
if metadata.isLivePhoto {
cell.imageStatus.image = utility.loadImage(named: "livephoto", colors: [NCBrandColor.shared.iconImageColor2])
@@ -115,6 +104,13 @@ extension NCShareExtension: UICollectionViewDataSource {
cell.setTags(tags: Array(metadata.tags))
let accessibilityLabel = [metadata.fileNameView, cell.labelInfo.text, cell.labelSubinfo.text]
.compactMap { $0?.trimmingCharacters(in: .whitespacesAndNewlines) }
.filter { !$0.isEmpty }
.joined(separator: ", ")
cell.setAccessibility(label: accessibilityLabel, value: "")
cell.accessibilityTraits = .button
cell.separator.isHidden = collectionView.numberOfItems(inSection: indexPath.section) == indexPath.row + 1
return cell
@@ -155,7 +151,7 @@ extension NCShareExtension: UICollectionViewDataSource {
// Local image: offline
if tableDirectory != nil && tableDirectory!.offline {
cell.imageLocal.image = NCImageCache.shared.getImageOfflineFlag()
cell.imageLocal?.image = NCImageCache.shared.getImageOfflineFlag()
}
}
}
+16 -1
View File
@@ -12,7 +12,22 @@ extension NCShareExtension {
func reloadData() async {
let session = NCShareExtensionData.shared.getSession()
let layoutForView = NCManageDatabase.shared.getLayoutForView(account: session.account, key: keyLayout, serverUrl: serverUrl)
let predicate = NSPredicate(format: "account == %@ AND serverUrl == %@ AND fileName != %@ AND directory == true", session.account, serverUrl, NextcloudKit.shared.nkCommonInstance.rootFileName)
let showHiddenFiles = NCPreferences().getShowHiddenFiles(account: session.account)
let predicate = showHiddenFiles
? NSPredicate(
format: "account == %@ AND serverUrl == %@ AND fileName != %@ AND directory == true",
session.account,
serverUrl,
NextcloudKit.shared.nkCommonInstance.rootFileName
)
: NSPredicate(
format: "account == %@ AND serverUrl == %@ AND fileName != %@ AND directory == true AND NOT fileName BEGINSWITH[c] %@",
session.account,
serverUrl,
NextcloudKit.shared.nkCommonInstance.rootFileName,
"."
)
let metadatas = await NCManageDatabase.shared.getMetadatasAsync(predicate: predicate,
withLayout: layoutForView,
withAccount: session.account)
+124 -64
View File
@@ -4,7 +4,10 @@
// SPDX-License-Identifier: GPL-3.0-or-later
import UIKit
import UniformTypeIdentifiers
import NextcloudKit
import LucidBanner
import SwiftUI
enum NCShareExtensionError: Error {
case cancel, fileUpload, noAccount, noFiles, versionMismatch
@@ -42,11 +45,13 @@ class NCShareExtension: UIViewController {
var progress: CGFloat = 0
var counterUploaded: Int = 0
var uploadMetadata: [tableMetadata] = []
let hud = NCHud()
let utilityFileSystem = NCUtilityFileSystem()
let utility = NCUtility()
let global = NCGlobal.shared
var maintenanceMode: Bool = false
var token: Int?
var banner: LucidBanner?
var sceneIdentifier: String = UUID().uuidString
// MARK: - View Life Cycle
@@ -88,6 +93,13 @@ class NCShareExtension: UIViewController {
NCBrandColor.shared.createUserColors()
registerForTraitChanges([UITraitUserInterfaceStyle.self]) { (self: Self, _) in
guard !self.maintenanceMode else {
return
}
self.updateAppearance()
}
NotificationCenter.default.addObserver(forName: UIApplication.willEnterForegroundNotification, object: nil, queue: nil) { _ in
if NCPreferences().presentPasscode {
NCPasscode.shared.presentPasscode(viewController: self, delegate: self) {
@@ -109,6 +121,12 @@ class NCShareExtension: UIViewController {
if let account = NCShareExtensionData.shared.getTblAccoun()?.account {
accountRequestChangeAccount(account: account, controller: nil)
}
NCNetworking.shared.setupScene(sceneIdentifier: sceneIdentifier, controller: self)
if let windowScene = view.window?.windowScene {
banner = LucidBannerRegistry.shared.banner(for: windowScene)
}
}
override func viewWillAppear(_ animated: Bool) {
@@ -133,20 +151,22 @@ class NCShareExtension: UIViewController {
return
}
NCFilesExtensionHandler(items: inputItems) { fileNames in
self.filesName = fileNames
DispatchQueue.main.async {
self.setCommandView()
Task { @MainActor in
NCFilesExtensionHandler(items: inputItems) { fileNames in
self.filesName = fileNames
DispatchQueue.main.async {
self.setCommandView()
}
}
}
if NCPreferences().presentPasscode {
NCPasscode.shared.presentPasscode(viewController: self, delegate: self) {
NCPasscode.shared.enableTouchFaceID()
if NCPreferences().presentPasscode {
NCPasscode.shared.presentPasscode(viewController: self, delegate: self) {
NCPasscode.shared.enableTouchFaceID()
}
}
}
self.collectionView.reloadData()
self.collectionView.reloadData()
}
}
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
@@ -157,20 +177,19 @@ class NCShareExtension: UIViewController {
}
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
super.traitCollectionDidChange(previousTraitCollection)
if !maintenanceMode {
collectionView.reloadData()
tableView.reloadData()
}
private func updateAppearance() {
collectionView.visibleCells.forEach { $0.setNeedsLayout() }
tableView.visibleCells.forEach { $0.setNeedsLayout() }
}
// MARK: -
func cancel(with error: NCShareExtensionError) {
// make sure no uploads are continued
extensionContext?.cancelRequest(withError: error)
func cancel(with error: NCShareExtensionError? = nil) {
if let error {
extensionContext?.cancelRequest(withError: error)
} else {
extensionContext?.completeRequest(returningItems: extensionContext?.inputItems, completionHandler: nil)
}
}
func showAlert(title: String = "_error_", description: String, onDismiss: (() -> Void)? = nil) {
@@ -259,7 +278,7 @@ class NCShareExtension: UIViewController {
// MARK: ACTION
@IBAction func actionCancel(_ sender: UIBarButtonItem) {
cancel(with: .cancel)
cancel()
}
@objc func actionCreateFolder(_ sender: Any?) {
@@ -267,7 +286,7 @@ class NCShareExtension: UIViewController {
guard let capabilities = NCNetworking.shared.capabilities[session.account] else {
return
}
let alertController = UIAlertController.createFolder(serverUrl: serverUrl, session: session, capabilities: capabilities) { error in
let alertController = UIAlertController.createFolderWith(serverUrl: serverUrl, session: session, capabilities: capabilities) { error in
if error == .success {
Task {
await self.loadFolder()
@@ -324,11 +343,12 @@ extension NCShareExtension {
guard utilityFileSystem.copyFile(atPath: (NSTemporaryDirectory() + fileName), toPath: toPath) else {
continue
}
let metadataForUpload = await NCManageDatabase.shared.createMetadataAsync(fileName: fileName,
ocId: ocId,
serverUrl: serverUrl,
session: session,
sceneIdentifier: nil)
let metadataForUpload = await NCManageDatabaseCreateMetadata().createMetadataAsync(
fileName: fileName,
ocId: ocId,
serverUrl: serverUrl,
session: session,
sceneIdentifier: self.sceneIdentifier)
metadataForUpload.session = NCNetworking.shared.sessionUpload
metadataForUpload.sessionSelector = NCGlobal.shared.selectorUploadFileShareExtension
@@ -361,8 +381,33 @@ extension NCShareExtension {
@MainActor
func uploadAndExit() async {
// A Share extension process can be reused by the system. Treat each
// explicit share operation as a new server-key validation cycle.
await NCNetworkingE2EE.beginNewServerKeyValidationCycle()
var error: NKError?
guard let window = self.view.window else {
return
}
let payload = LucidBannerPayload(stage: .button,
vPosition: .center,
blocksTouches: true)
(banner, token) = showUploadBanner(windowScene: window.windowScene,
payload: payload,
allowMinimizeOnTap: false,
onButtonTap: {
self.cancel()
})
for metadata in self.uploadMetadata {
// BANNER
let payloadUpdate = LucidBannerPayload.Update(
title: NSLocalizedString("_upload_file_", comment: "") + " \(self.counterUploaded + 1) " + NSLocalizedString("_of_", comment: "") + " \(self.filesName.count)",
systemImage: "arrowshape.up.circle",
imageAnimation: .breathe,
progress: 0)
banner?.update(payload: payloadUpdate)
error = await self.upload(metadata: metadata)
if error != .success {
break
@@ -370,14 +415,16 @@ extension NCShareExtension {
}
if error == .success {
self.hud.success()
banner?.update(payload: LucidBannerPayload.Update(stage: .success, horizontalLayout: .centered(width: 100)), for: self.token)
} else {
self.hud.error(text: error?.errorDescription)
banner?.update(payload: LucidBannerPayload.Update(subtitle: error?.errorDescription, stage: .error), for: self.token)
}
try? await Task.sleep(nanoseconds: 1_500_000_000)
self.extensionContext?.completeRequest(returningItems: self.extensionContext?.inputItems, completionHandler: nil)
Task { @MainActor in
try? await Task.sleep(for: .seconds(2))
banner?.dismiss()
extensionContext?.completeRequest(returningItems: extensionContext?.inputItems, completionHandler: nil)
}
}
@MainActor
@@ -406,38 +453,49 @@ extension NCShareExtension {
metadata.e2eEncrypted = metadata.isDirectoryE2EE
self.counterUploaded += 1
hud.ringProgress(view: self.view, text: NSLocalizedString("_upload_file_", comment: "") + " \(self.counterUploaded) " + NSLocalizedString("_of_", comment: "") + " \(self.filesName.count)")
if metadata.isDirectoryE2EE {
error = await NCNetworkingE2EEUpload().upload(metadata: metadata, session: session, controller: self)
error = await NCNetworkingE2EEUpload().upload(metadata: metadata,
session: session,
controller: self,
banner: banner,
stageBanner: nil,
tokenBanner: self.token)
} else if metadata.chunk > 0 {
var numChunks = 0
var countUpload: Int = 0
var taskHandler: URLSessionTask?
hud.pieProgress(text: NSLocalizedString("_wait_file_preparation_", comment: ""), tapToCancelDetailText: true) {
NotificationCenter.default.postOnMainThread(name: NextcloudKit.shared.nkCommonInstance.notificationCenterChunkedFileStop.rawValue)
}
let results = await NCNetworking.shared.uploadChunkFile(metadata: metadata) { num in
numChunks = num
} counterChunk: { counter in
self.hud.progress(num: Float(counter), total: Float(numChunks))
} startFilesChunk: { _ in
self.hud.pieProgress(text: NSLocalizedString("_keep_active_for_upload_", comment: ""), tapToCancelDetailText: true) {
taskHandler?.cancel()
banner?.update(payload: LucidBannerPayload.Update(systemImage: "gearshape.arrow.triangle.2.circlepath",
imageAnimation: .rotate),
for: self.token)
let task = Task { () -> (account: String, file: NKFile?, error: NKError) in
let results = await NCNetworking.shared.uploadChunkFile(metadata: metadata) { total, counter in
Task {@MainActor in
self.banner?.update(payload: LucidBannerPayload.Update(progress: Double(counter) / Double(total)), for: self.token)
}
} uploadStart: { _ in
Task {@MainActor in
let payload = LucidBannerPayload.Update(
systemImage: "arrowshape.up.circle",
imageAnimation: .breathe
)
self.banner?.update(payload: payload, for: self.token)
}
} uploadProgressHandler: { _, _, progress in
Task {@MainActor in
self.banner?.update(payload: LucidBannerPayload.Update(progress: progress), for: self.token)
}
} assembling: {
Task {@MainActor in
let payload = LucidBannerPayload.Update(
systemImage: "gearshape.arrow.triangle.2.circlepath",
imageAnimation: .rotate
)
self.banner?.update(payload: payload, for: self.token)
}
}
} requestHandler: { _ in
self.hud.progress(num: Float(countUpload), total: Float(numChunks))
countUpload += 1
} taskHandler: { task in
taskHandler = task
} assembling: {
self.hud.setText(NSLocalizedString("_wait_", comment: ""))
return results
}
hud.dismiss()
let results = await task.value
error = results.error
} else {
let fileNameLocalPath = utilityFileSystem.getDirectoryProviderStorageOcId(metadata.ocId,
@@ -445,14 +503,16 @@ extension NCShareExtension {
userId: metadata.userId,
urlBase: metadata.urlBase)
let results = await NCNetworking.shared.uploadFile(fileNameLocalPath: fileNameLocalPath,
let results = await NCNetworking.shared.uploadFile(account: metadata.account,
fileNameLocalPath: fileNameLocalPath,
serverUrlFileName: metadata.serverUrlFileName,
creationDate: metadata.creationDate as Date,
dateModificationFile: metadata.date as Date,
account: metadata.account,
metadata: metadata) { _ in
dateModificationFile: metadata.date as Date) { _ in
} progressHandler: { _, _, fractionCompleted in
self.hud.progress(fractionCompleted)
Task {@MainActor in
self.banner?.update(payload: LucidBannerPayload.Update(progress: fractionCompleted),
for: self.token)
}
}
error = results.error
}
@@ -1,7 +0,0 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2025 Iva Horn
// SPDX-License-Identifier: GPL-3.0-or-later
// There are no unit tests yet.
// This is an empty placeholder file.
// The compiler requires at least an empty file for every target.
+153 -153
View File
@@ -1,153 +1,153 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2025 Iva Horn
// SPDX-License-Identifier: GPL-3.0-or-later
import XCTest
///
/// User interface tests for the download limits management on shares.
///
@MainActor
final class AssistantUITests: BaseUIXCTestCase {
let taskInputCreated = "TestTaskCreated" + UUID().uuidString
let taskInputRetried = "TestTaskRetried" + UUID().uuidString
let taskInputToEdit = "TestTaskToEdit" + UUID().uuidString
let taskInputDeleted = "TestTaskDeleted" + UUID().uuidString
// MARK: - Lifecycle
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
// Handle alerts presented by the system.
addUIInterruptionMonitor(withDescription: "Allow Notifications", for: "Allow")
addUIInterruptionMonitor(withDescription: "Save Password", for: "Not Now")
// Launch the app.
app = XCUIApplication()
app.launchArguments = ["UI_TESTING"]
app.launch()
try await logIn()
// Set up test backend communication.
backend = UITestBackend()
try await backend.assertCapability(true, capability: \.assistant)
}
///
/// Leads to the Assistant screen.
///
private func goToAssistant() {
let button = app.tabBars["Tab Bar"].buttons["More"]
guard button.await() else { return }
button.tap()
let talkStaticText = app.tables.staticTexts["Assistant"]
talkStaticText.tap()
}
private func createTask(input: String) {
app.navigationBars["Assistant"].buttons["CreateButton"].tap()
let inputTextEditor = app.textViews["InputTextEditor"]
inputTextEditor.await()
inputTextEditor.typeText(input)
app.navigationBars["New Free text to text prompt task"].buttons["Create"].tap()
}
private func retryTask() {
let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
cell.staticTexts[taskInputRetried].press(forDuration: 2);
let retryButton = app.buttons["TaskRetryContextMenu"]
XCTAssertTrue(retryButton.waitForExistence(timeout: 2), "Edit button not found in context menu")
retryButton.tap()
}
private func editTask() {
let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
cell.staticTexts[taskInputToEdit].press(forDuration: 2);
let editButton = app.buttons["TaskEditContextMenu"]
XCTAssertTrue(editButton.waitForExistence(timeout: 2), "Edit button not found in context menu")
editButton.tap()
app.textViews["InputTextEditor"].typeText("Edited")
app.navigationBars["Edit Free text to text prompt task"].buttons["Edit"].tap()
}
private func deleteTask() {
let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
cell.staticTexts[taskInputDeleted].press(forDuration: 2);
let deleteButton = app.buttons["TaskDeleteContextMenu"]
XCTAssertTrue(deleteButton.waitForExistence(timeout: 2), "Edit button not found in context menu")
deleteButton.tap()
app.sheets.scrollViews.otherElements.buttons["Delete"].tap()
}
// MARK: - Tests
func testCreateAssistantTask() async throws {
goToAssistant()
createTask(input: taskInputCreated)
pullToRefresh()
try await aMoment()
let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
XCTAssert(cell.staticTexts[taskInputCreated].exists)
}
func testRetryAssistantTask() async throws {
goToAssistant()
createTask(input: taskInputRetried)
retryTask()
pullToRefresh()
try await aMoment()
let matchingElements = app.collectionViews.cells.staticTexts.matching(identifier: taskInputRetried)
print(app.collectionViews.staticTexts.debugDescription)
XCTAssertEqual(matchingElements.count, 2, "Expected 2 elements")
}
func testEditAssistantTask() async throws {
goToAssistant()
createTask(input: taskInputToEdit)
editTask()
pullToRefresh()
try await aMoment()
let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
XCTAssert(cell.staticTexts[taskInputToEdit + "Edited"].exists)
}
func testDeleteAssistantTask() async throws {
goToAssistant()
createTask(input: taskInputDeleted)
deleteTask()
pullToRefresh()
try await aMoment()
let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
XCTAssert(!cell.staticTexts[taskInputDeleted].exists)
}
}
//// SPDX-FileCopyrightText: Nextcloud GmbH
//// SPDX-FileCopyrightText: 2025 Iva Horn
//// SPDX-License-Identifier: GPL-3.0-or-later
//
//import XCTest
//
/////
///// User interface tests for the download limits management on shares.
/////
//@MainActor
//final class AssistantUITests: BaseUIXCTestCase {
// let taskInputCreated = "TestTaskCreated" + UUID().uuidString
// let taskInputRetried = "TestTaskRetried" + UUID().uuidString
// let taskInputToEdit = "TestTaskToEdit" + UUID().uuidString
// let taskInputDeleted = "TestTaskDeleted" + UUID().uuidString
//
// // MARK: - Lifecycle
//
// override func setUp() async throws {
// try await super.setUp()
// continueAfterFailure = false
//
// // Handle alerts presented by the system.
// addUIInterruptionMonitor(withDescription: "Allow Notifications", for: "Allow")
// addUIInterruptionMonitor(withDescription: "Save Password", for: "Not Now")
//
// // Launch the app.
// app = XCUIApplication()
// app.launchArguments = ["UI_TESTING"]
// app.launch()
//
// try await logIn()
//
// // Set up test backend communication.
// backend = UITestBackend()
//
// try await backend.assertCapability(true, capability: \.assistant)
// }
//
// ///
// /// Leads to the Assistant screen.
// ///
// private func goToAssistant() {
// let button = app.tabBars["Tab Bar"].buttons["More"]
// guard button.await() else { return }
// button.tap()
//
// let talkStaticText = app.tables.staticTexts["Assistant"]
// talkStaticText.tap()
// }
//
// private func createTask(input: String) {
// app.navigationBars["Assistant"].buttons["ConversationsButton"].tap()
//
// let inputTextEditor = app.textViews["InputTextEditor"]
// inputTextEditor.await()
// inputTextEditor.typeText(input)
// app.navigationBars["New Free text to text prompt task"].buttons["Create"].tap()
// }
//
// private func retryTask() {
// let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
// cell.staticTexts[taskInputRetried].press(forDuration: 2);
//
// let retryButton = app.buttons["TaskRetryContextMenu"]
// XCTAssertTrue(retryButton.waitForExistence(timeout: 2), "Edit button not found in context menu")
// retryButton.tap()
// }
//
// private func editTask() {
// let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
// cell.staticTexts[taskInputToEdit].press(forDuration: 2);
//
// let editButton = app.buttons["TaskEditContextMenu"]
// XCTAssertTrue(editButton.waitForExistence(timeout: 2), "Edit button not found in context menu")
// editButton.tap()
//
// app.textViews["InputTextEditor"].typeText("Edited")
// app.navigationBars["Edit Free text to text prompt task"].buttons["Edit"].tap()
// }
//
// private func deleteTask() {
// let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
// cell.staticTexts[taskInputDeleted].press(forDuration: 2);
//
// let deleteButton = app.buttons["TaskDeleteContextMenu"]
// XCTAssertTrue(deleteButton.waitForExistence(timeout: 2), "Edit button not found in context menu")
// deleteButton.tap()
//
// app.sheets.scrollViews.otherElements.buttons["Delete"].tap()
// }
//
// // MARK: - Tests
//
// func testCreateAssistantTask() async throws {
// goToAssistant()
//
// createTask(input: taskInputCreated)
//
// pullToRefresh()
//
// try await aMoment()
//
// let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
// XCTAssert(cell.staticTexts[taskInputCreated].exists)
// }
//
// func testRetryAssistantTask() async throws {
// goToAssistant()
//
// createTask(input: taskInputRetried)
//
// retryTask()
//
// pullToRefresh()
//
// try await aMoment()
//
// let matchingElements = app.collectionViews.cells.staticTexts.matching(identifier: taskInputRetried)
// print(app.collectionViews.staticTexts.debugDescription)
// XCTAssertEqual(matchingElements.count, 2, "Expected 2 elements")
// }
//
// func testEditAssistantTask() async throws {
// goToAssistant()
//
// createTask(input: taskInputToEdit)
//
// editTask()
//
// pullToRefresh()
//
// try await aMoment()
//
// let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
// XCTAssert(cell.staticTexts[taskInputToEdit + "Edited"].exists)
// }
//
// func testDeleteAssistantTask() async throws {
// goToAssistant()
//
// createTask(input: taskInputDeleted)
//
// deleteTask()
//
// pullToRefresh()
//
// try await aMoment()
//
// let cell = app.collectionViews.children(matching: .cell).element(boundBy: 0)
// XCTAssert(!cell.staticTexts[taskInputDeleted].exists)
// }
//}
+127 -127
View File
@@ -1,127 +1,127 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2025 Iva Horn
// SPDX-License-Identifier: GPL-3.0-or-later
import XCTest
///
/// User interface tests for the download limits management on shares.
///
@MainActor
final class AutoUploadUITests: BaseUIXCTestCase {
// MARK: - Lifecycle
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
// Handle alerts presented by the system.
addUIInterruptionMonitor(withDescription: "Allow Notifications", for: "Allow")
addUIInterruptionMonitor(withDescription: "Save Password", for: "Not Now")
// Launch the app.
app = XCUIApplication()
app.launchArguments = ["UI_TESTING"]
app.launch()
try await logIn()
// Set up test backend communication.
backend = UITestBackend()
}
private func goToAutoUpload() async throws {
addUIInterruptionMonitor(withDescription: "Are you sure you want to upload all photos?", for: "Confirm")
app.tabBars["Tab Bar"].buttons["More"].tap()
app.tables/*@START_MENU_TOKEN@*/.staticTexts["Settings"]/*[[".cells.staticTexts[\"Settings\"]",".staticTexts[\"Settings\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
let collectionViewsQuery = app.collectionViews
collectionViewsQuery/*@START_MENU_TOKEN@*/.staticTexts["Auto upload"]/*[[".cells",".buttons[\"Auto upload\"].staticTexts[\"Auto upload\"]",".staticTexts[\"Auto upload\"]"],[[[-1,2],[-1,1],[-1,0,1]],[[-1,2],[-1,1]]],[0]]@END_MENU_TOKEN@*/.tap()
try await aSmallMoment()
let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
let allowButton = springboard.buttons["Allow Full Access"]
if allowButton.await() {
allowButton.tap()
}
}
func testAutoUploadAllPhotos() async throws {
try await goToAutoUpload()
let collectionViewsQuery = app.collectionViews
let turnOnAutoUploadingSwitch = collectionViewsQuery.switches["Turn on auto uploading"]
collectionViewsQuery/*@START_MENU_TOKEN@*/.switches["Auto upload photos"]/*[[".cells.switches[\"Auto upload photos\"]",".switches[\"Auto upload photos\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.swipeUp()
if turnOnAutoUploadingSwitch.await() {
turnOnAutoUploadingSwitch.tap()
}
app.tabBars["Tab Bar"].buttons["Files"].tap()
try await aSmallMoment()
pullToRefresh()
let photosItem = app.collectionViews["NCCollectionViewCommon"]/*@START_MENU_TOKEN@*/.staticTexts["Photos"]/*[[".cells[\"Photos\"].staticTexts[\"Photos\"]",".cells[\"Cell\/Photos\"].staticTexts[\"Photos\"]",".staticTexts[\"Photos\"]"],[[[-1,2],[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/
if photosItem.await() {
photosItem.tap()
}
try await aSmallMoment()
XCTAssertTrue(app.collectionViews.cells.count == 6)
}
func testAutoUploadNewPhotos() async throws {
try await goToAutoUpload()
let backUpNewPhotosVideosOnlySwitch = app.collectionViews.switches["NewPhotosToggle"]
if backUpNewPhotosVideosOnlySwitch.await() {
backUpNewPhotosVideosOnlySwitch.switches.firstMatch.tap()
}
let collectionViewsQuery = app.collectionViews
let turnOnAutoUploadingSwitch = collectionViewsQuery.switches["Turn on auto uploading"]
collectionViewsQuery/*@START_MENU_TOKEN@*/.switches["Auto upload photos"]/*[[".cells.switches[\"Auto upload photos\"]",".switches[\"Auto upload photos\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.swipeUp()
if turnOnAutoUploadingSwitch.await() {
turnOnAutoUploadingSwitch.tap()
}
app.tabBars["Tab Bar"].buttons["Files"].tap()
try await aSmallMoment()
pullToRefresh()
let photosItem = app.collectionViews["NCCollectionViewCommon"]/*@START_MENU_TOKEN@*/.staticTexts["Photos"]/*[[".cells[\"Photos\"].staticTexts[\"Photos\"]",".cells[\"Cell\/Photos\"].staticTexts[\"Photos\"]",".staticTexts[\"Photos\"]"],[[[-1,2],[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/
// Does not seem possible to take a screenshot on Simulator or easily transfer a new photo in Simulator.
// Thus for now we can only rely on the Photos folder not existing at all to test this.
XCTAssertFalse(photosItem.exists)
}
override func tearDown() async throws {
let tabBar = app.tabBars["Tab Bar"]
tabBar.buttons["Files"].tap()
let nccollectionviewcommonCollectionView = app.collectionViews["NCCollectionViewCommon"]
let cell = nccollectionviewcommonCollectionView/*@START_MENU_TOKEN@*/.cells["Cell/Photos"]/*[[".cells[\"Photos\"]",".cells[\"Cell\/Photos\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/
if !cell.exists { return }
cell.otherElements.containing(.button, identifier:"Cell/Photos/shareButton").children(matching: .button).element(boundBy: 1).tap()
let tablesQuery = app.tables
tablesQuery/*@START_MENU_TOKEN@*/.staticTexts["Delete folder"]/*[[".cells.staticTexts[\"Delete folder\"]",".staticTexts[\"Delete folder\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
app.alerts["Delete folder?"].scrollViews.otherElements.buttons["Yes"].tap()
cell.awaitInexistence()
}
}
//// SPDX-FileCopyrightText: Nextcloud GmbH
//// SPDX-FileCopyrightText: 2025 Iva Horn
//// SPDX-License-Identifier: GPL-3.0-or-later
//
//import XCTest
//
/////
///// User interface tests for the download limits management on shares.
/////
//@MainActor
//final class AutoUploadUITests: BaseUIXCTestCase {
// // MARK: - Lifecycle
// override func setUp() async throws {
// try await super.setUp()
// continueAfterFailure = false
//
// // Handle alerts presented by the system.
// addUIInterruptionMonitor(withDescription: "Allow Notifications", for: "Allow")
// addUIInterruptionMonitor(withDescription: "Save Password", for: "Not Now")
//
// // Launch the app.
// app = XCUIApplication()
// app.launchArguments = ["UI_TESTING"]
// app.launch()
//
// try await logIn()
//
// // Set up test backend communication.
// backend = UITestBackend()
// }
//
// private func goToAutoUpload() async throws {
// addUIInterruptionMonitor(withDescription: "Are you sure you want to upload all photos?", for: "Confirm")
//
// app.tabBars["Tab Bar"].buttons["More"].tap()
//
// app.tables/*@START_MENU_TOKEN@*/.staticTexts["Settings"]/*[[".cells.staticTexts[\"Settings\"]",".staticTexts[\"Settings\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
//
// let collectionViewsQuery = app.collectionViews
// collectionViewsQuery/*@START_MENU_TOKEN@*/.staticTexts["Auto upload"]/*[[".cells",".buttons[\"Auto upload\"].staticTexts[\"Auto upload\"]",".staticTexts[\"Auto upload\"]"],[[[-1,2],[-1,1],[-1,0,1]],[[-1,2],[-1,1]]],[0]]@END_MENU_TOKEN@*/.tap()
//
// try await aSmallMoment()
//
// let springboard = XCUIApplication(bundleIdentifier: "com.apple.springboard")
// let allowButton = springboard.buttons["Allow Full Access"]
//
// if allowButton.await() {
// allowButton.tap()
// }
// }
//
// func testAutoUploadAllPhotos() async throws {
// try await goToAutoUpload()
//
// let collectionViewsQuery = app.collectionViews
//
// let turnOnAutoUploadingSwitch = collectionViewsQuery.switches["Turn on auto uploading"]
//
// collectionViewsQuery/*@START_MENU_TOKEN@*/.switches["Auto upload photos"]/*[[".cells.switches[\"Auto upload photos\"]",".switches[\"Auto upload photos\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.swipeUp()
//
// if turnOnAutoUploadingSwitch.await() {
// turnOnAutoUploadingSwitch.tap()
// }
//
// app.tabBars["Tab Bar"].buttons["Files"].tap()
//
// try await aSmallMoment()
//
// pullToRefresh()
//
// let photosItem = app.collectionViews["NCCollectionViewCommon"]/*@START_MENU_TOKEN@*/.staticTexts["Photos"]/*[[".cells[\"Photos\"].staticTexts[\"Photos\"]",".cells[\"Cell\/Photos\"].staticTexts[\"Photos\"]",".staticTexts[\"Photos\"]"],[[[-1,2],[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/
// if photosItem.await() {
// photosItem.tap()
// }
//
// try await aSmallMoment()
//
// XCTAssertTrue(app.collectionViews.cells.count == 6)
// }
//
// func testAutoUploadNewPhotos() async throws {
// try await goToAutoUpload()
//
// let backUpNewPhotosVideosOnlySwitch = app.collectionViews.switches["NewPhotosToggle"]
//
// if backUpNewPhotosVideosOnlySwitch.await() {
// backUpNewPhotosVideosOnlySwitch.switches.firstMatch.tap()
// }
//
// let collectionViewsQuery = app.collectionViews
//
// let turnOnAutoUploadingSwitch = collectionViewsQuery.switches["Turn on auto uploading"]
//
// collectionViewsQuery/*@START_MENU_TOKEN@*/.switches["Auto upload photos"]/*[[".cells.switches[\"Auto upload photos\"]",".switches[\"Auto upload photos\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.swipeUp()
//
// if turnOnAutoUploadingSwitch.await() {
// turnOnAutoUploadingSwitch.tap()
// }
//
// app.tabBars["Tab Bar"].buttons["Files"].tap()
//
// try await aSmallMoment()
//
// pullToRefresh()
//
// let photosItem = app.collectionViews["NCCollectionViewCommon"]/*@START_MENU_TOKEN@*/.staticTexts["Photos"]/*[[".cells[\"Photos\"].staticTexts[\"Photos\"]",".cells[\"Cell\/Photos\"].staticTexts[\"Photos\"]",".staticTexts[\"Photos\"]"],[[[-1,2],[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/
//
// // Does not seem possible to take a screenshot on Simulator or easily transfer a new photo in Simulator.
// // Thus for now we can only rely on the Photos folder not existing at all to test this.
// XCTAssertFalse(photosItem.exists)
// }
//
// override func tearDown() async throws {
// let tabBar = app.tabBars["Tab Bar"]
// tabBar.buttons["Files"].tap()
// let nccollectionviewcommonCollectionView = app.collectionViews["NCCollectionViewCommon"]
// let cell = nccollectionviewcommonCollectionView/*@START_MENU_TOKEN@*/.cells["Cell/Photos"]/*[[".cells[\"Photos\"]",".cells[\"Cell\/Photos\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/
// if !cell.exists { return }
//
// cell.otherElements.containing(.button, identifier:"Cell/Photos/shareButton").children(matching: .button).element(boundBy: 1).tap()
// let tablesQuery = app.tables
// tablesQuery/*@START_MENU_TOKEN@*/.staticTexts["Delete folder"]/*[[".cells.staticTexts[\"Delete folder\"]",".staticTexts[\"Delete folder\"]"],[[[-1,1],[-1,0]]],[0]]@END_MENU_TOKEN@*/.tap()
// app.alerts["Delete folder?"].scrollViews.otherElements.buttons["Yes"].tap()
//
// cell.awaitInexistence()
// }
//}
+484 -484
View File
@@ -1,484 +1,484 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2025 Iva Horn
// SPDX-License-Identifier: GPL-3.0-or-later
import XCTest
///
/// User interface tests for the download limits management on shares.
///
@MainActor
final class DownloadLimitUITests: BaseUIXCTestCase {
///
/// Name of the file to work with.
///
/// The leading underscore is required for the file to appear at the top of the list.
/// Obviously, this is fragile by making some assumptions of the user interface state.
///
let testFileName = "_Xcode UI Test Subject.md"
// MARK: - Lifecycle
override func setUp() async throws {
try await super.setUp()
continueAfterFailure = false
// Handle alerts presented by the system.
addUIInterruptionMonitor(withDescription: "Allow Notifications", for: "Allow")
addUIInterruptionMonitor(withDescription: "Save Password", for: "Not Now")
// Launch the app.
app = XCUIApplication()
app.launchArguments = ["UI_TESTING"]
app.launch()
try await logIn()
// Set up test backend communication.
backend = UITestBackend()
try await backend.assertCapability(true, capability: \.downloadLimit)
try await backend.delete(testFileName)
try await backend.prepareTestFile(testFileName)
}
// MARK: - Tests
func testShareWithoutDownloadLimitCapability() async throws {
// This cannot be implemented at the time of writing.
// There is no way to disable and enable server apps via web API.
// The Xcode UI test process cannot access Docker.
throw XCTSkip("Not implemented yet!")
}
func testNewShareWithoutDownloadLimit() async throws {
pullToRefresh()
// Tap share button.
let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
guard shareButton.exists else {
throw UITestError.waitForExistence(shareButton)
}
shareButton.tap()
// Tap add share link button.
let addShareLinkButton = app.buttons["addShareLink"]
guard addShareLinkButton.await() else { return }
addShareLinkButton.tap()
// Tap confirm share button.
let confirmShareButton = app.buttons["confirmShare"]
guard confirmShareButton.exists else {
throw UITestError.waitForExistence(confirmShareButton)
}
confirmShareButton.tap()
confirmShareButton.awaitInexistence()
// Then
let shares = try await backend.getShares(byPath: "/\(testFileName)")
XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
guard let token = shares.first?.token else {
throw UITestError.missingValue
}
try await backend.assertNoDownloadLimit(by: token)
}
func testNewShareWithDownloadLimit() async throws {
pullToRefresh()
// Tap share button.
let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
guard shareButton.await() else { return }
shareButton.tap()
// Tap add share link button.
let addShareLinkButton = app.buttons["addShareLink"]
guard addShareLinkButton.await() else { return }
addShareLinkButton.tap()
// Tap download limits.
let downloadLimitCell = app.cells["downloadLimit"]
guard downloadLimitCell.await() else { return }
downloadLimitCell.tap()
// Tap download limit switch.
let downloadLimitSwitch = app.switches["downloadLimitSwitch"]
guard downloadLimitSwitch.await() else { return }
downloadLimitSwitch.tap()
// Update allowed downloads.
let allowedDownloadsTextField = app.textFields["downloadLimitTextField"]
guard allowedDownloadsTextField.await() else { return }
allowedDownloadsTextField.tap()
allowedDownloadsTextField.typeText("3")
// Tap navigation back button.
app.navigationBars.buttons.firstMatch.tap()
// Tap confirm share button.
let confirmShareButton = app.buttons["confirmShare"]
guard confirmShareButton.await() else { return }
confirmShareButton.tap()
confirmShareButton.awaitInexistence()
// Then
let shares = try await backend.getShares(byPath: "/\(testFileName)")
XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
guard let token = shares.first?.token else {
throw UITestError.missingValue
}
try await backend.assertDownloadLimit(by: token, count: 0, limit: 3)
}
func testShareOfFolder() async throws {
let testSubject = "_Xcode UI Test Subject"
try await backend.createFolder(testSubject)
pullToRefresh()
// Tap share button.
let shareButton = app.buttons["Cell/\(testSubject)/shareButton"]
guard shareButton.await() else { return }
shareButton.tap()
// Tap add share link button.
let addShareLinkButton = app.buttons["addShareLink"]
guard addShareLinkButton.await() else { return }
addShareLinkButton.tap()
// Verify download limits being unavailable.
let downloadLimitCell = app.cells["downloadLimit"]
XCTAssertFalse(downloadLimitCell.exists, "Folder shares cannot have download limits")
// Cleanup
try await backend.delete(testSubject)
}
func testAddingDownloadLimitToExistingShare() async throws {
try await backend.createShare(byPath: testFileName)
pullToRefresh()
// Tap share button.
let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
guard shareButton.await() else { return }
shareButton.tap()
// Tap show share link details button.
let showShareLinkDetailsButton = app.buttons["showShareLinkDetails"]
guard showShareLinkDetailsButton.await() else { return }
showShareLinkDetailsButton.tap()
// Tap share link details button in share menu sheet.
let shareMenuDetailsCell = app.cells["shareMenu/details"]
guard shareMenuDetailsCell.await() else { return }
shareMenuDetailsCell.tap()
// Tap download limits.
let downloadLimitCell = app.cells["downloadLimit"]
guard downloadLimitCell.await() else { return }
downloadLimitCell.tap()
// Tap download limit switch.
let downloadLimitSwitch = app.switches["downloadLimitSwitch"]
guard downloadLimitSwitch.await() else { return }
downloadLimitSwitch.tap()
// Update allowed downloads.
let allowedDownloadsTextField = app.textFields["downloadLimitTextField"]
guard allowedDownloadsTextField.await() else { return }
allowedDownloadsTextField.tap()
allowedDownloadsTextField.typeText("3")
// Tap navigation back button.
app.navigationBars.buttons.firstMatch.tap()
// Tap confirm share button.
let confirmShareButton = app.buttons["confirmShare"]
guard confirmShareButton.await() else { return }
confirmShareButton.tap()
confirmShareButton.awaitInexistence()
// Then
let shares = try await backend.getShares(byPath: "\(testFileName)")
XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
guard let token = shares.first?.token else {
throw UITestError.missingValue
}
try await aMoment()
try await backend.assertDownloadLimit(by: token, count: 0, limit: 3)
}
func testUpdatingDownloadLimitOnExistingShare() async throws {
try await backend.createShare(byPath: testFileName)
var shares = try await backend.getShares(byPath: testFileName)
guard let token = shares.first?.token else {
XCTFail("Failed to fetch token of share for test file!")
return
}
try await backend.setDownloadLimit(to: 4, by: token)
pullToRefresh()
// Tap share button.
let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
guard shareButton.await() else { return }
shareButton.tap()
// Tap show share link details button.
let showShareLinkDetailsButton = app.buttons["showShareLinkDetails"]
guard showShareLinkDetailsButton.await() else { return }
showShareLinkDetailsButton.tap()
// Tap share link details button in share menu sheet.
let shareMenuDetailsCell = app.cells["shareMenu/details"]
guard shareMenuDetailsCell.await() else { return }
shareMenuDetailsCell.tap()
// Tap download limits.
let downloadLimitCell = app.cells["downloadLimit"]
guard downloadLimitCell.await() else { return }
downloadLimitCell.tap()
// Check download limit switch.
let downloadLimitSwitch = app.switches["downloadLimitSwitch"].firstMatch
guard downloadLimitSwitch.await() else { return }
guard let downloadLimitSwitchValue = (downloadLimitSwitch.value as? String) else {
XCTFail("Failed to get value of user interface control!")
return
}
guard downloadLimitSwitchValue == "1" else {
XCTFail("The switch is not on!")
return
}
// Check and update allowed downloads.
let allowedDownloadsTextField = app.textFields["downloadLimitTextField"]
guard allowedDownloadsTextField.await() else { return }
guard let allowedDownloadsTextFieldValue = (allowedDownloadsTextField.value as? String) else {
XCTFail("Failed to get value of user interface control!")
return
}
guard allowedDownloadsTextFieldValue == "4" else {
XCTFail("The text field value is wrong!")
return
}
allowedDownloadsTextField.tap()
allowedDownloadsTextField.typeText("6")
// Tap navigation back button.
app.navigationBars.buttons.firstMatch.tap()
// Tap confirm share button.
let confirmShareButton = app.buttons["confirmShare"]
guard confirmShareButton.await() else { return }
confirmShareButton.tap()
confirmShareButton.awaitInexistence()
// Then
shares = try await backend.getShares(byPath: "\(testFileName)")
XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
guard let token = shares.first?.token else {
throw UITestError.missingValue
}
try await aMoment()
try await backend.assertDownloadLimit(by: token, count: 0, limit: 6)
}
func testDiscardingDownloadLimitChangesOnExistingShare() async throws {
try await backend.createShare(byPath: testFileName)
var shares = try await backend.getShares(byPath: testFileName)
guard let token = shares.first?.token else {
XCTFail("Failed to fetch token of share for test file!")
return
}
try await backend.setDownloadLimit(to: 8, by: token)
pullToRefresh()
// Tap share button.
let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
guard shareButton.await() else { return }
shareButton.tap()
// Tap show share link details button.
let showShareLinkDetailsButton = app.buttons["showShareLinkDetails"]
guard showShareLinkDetailsButton.await() else { return }
showShareLinkDetailsButton.tap()
// Tap share link details button in share menu sheet.
let shareMenuDetailsCell = app.cells["shareMenu/details"]
guard shareMenuDetailsCell.await() else { return }
shareMenuDetailsCell.tap()
// Tap download limits.
let downloadLimitCell = app.cells["downloadLimit"]
guard downloadLimitCell.await() else { return }
downloadLimitCell.tap()
// Check download limit switch.
let downloadLimitSwitch = app.switches["downloadLimitSwitch"].firstMatch
guard downloadLimitSwitch.await() else { return }
guard let downloadLimitSwitchValue = (downloadLimitSwitch.value as? String) else {
XCTFail("Failed to get value of user interface control!")
return
}
guard downloadLimitSwitchValue == "1" else {
XCTFail("The switch is not on!")
return
}
// Check and update allowed downloads.
let allowedDownloadsTextField = app.textFields["downloadLimitTextField"]
guard allowedDownloadsTextField.await() else { return }
guard let allowedDownloadsTextFieldValue = (allowedDownloadsTextField.value as? String) else {
XCTFail("Failed to get value of user interface control!")
return
}
allowedDownloadsTextField.tap()
allowedDownloadsTextField.typeText("9")
// Tap navigation back button.
app.navigationBars.buttons.firstMatch.tap()
// Tap confirm share button.
let cancelShareButton = app.buttons["cancelShare"]
guard cancelShareButton.await() else { return }
cancelShareButton.tap()
// Then
shares = try await backend.getShares(byPath: "\(testFileName)")
XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
guard let token = shares.first?.token else {
throw UITestError.missingValue
}
try await aMoment()
try await backend.assertDownloadLimit(by: token, count: 0, limit: 8)
}
func testRemovingDownloadLimitFromExistingShare() async throws {
try await backend.createShare(byPath: testFileName)
var shares = try await backend.getShares(byPath: testFileName)
guard let token = shares.first?.token else {
XCTFail("Failed to fetch token of share for test file!")
return
}
try await backend.setDownloadLimit(to: 4, by: token)
pullToRefresh()
// Tap share button.
let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
guard shareButton.await() else { return }
shareButton.tap()
// Tap show share link details button.
let showShareLinkDetailsButton = app.buttons["showShareLinkDetails"]
guard showShareLinkDetailsButton.await() else { return }
showShareLinkDetailsButton.tap()
// Tap share link details button in share menu sheet.
let shareMenuDetailsCell = app.cells["shareMenu/details"]
guard shareMenuDetailsCell.await() else { return }
shareMenuDetailsCell.tap()
// Tap download limits.
let downloadLimitCell = app.cells["downloadLimit"]
guard downloadLimitCell.await() else { return }
downloadLimitCell.tap()
// Check download limit switch.
let downloadLimitSwitch = app.switches["downloadLimitSwitch"].firstMatch
guard downloadLimitSwitch.await() else { return }
downloadLimitSwitch.tap()
// Tap navigation back button.
app.navigationBars.buttons.firstMatch.tap()
// Tap confirm share button.
let confirmShareButton = app.buttons["confirmShare"]
guard confirmShareButton.await() else { return }
confirmShareButton.tap()
confirmShareButton.awaitInexistence()
// Then
shares = try await backend.getShares(byPath: "\(testFileName)")
XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
guard let token = shares.first?.token else {
throw UITestError.missingValue
}
try await aMoment()
try await backend.assertDownloadLimit(by: token, count: nil, limit: nil)
}
}
//// SPDX-FileCopyrightText: Nextcloud GmbH
//// SPDX-FileCopyrightText: 2025 Iva Horn
//// SPDX-License-Identifier: GPL-3.0-or-later
//
//import XCTest
//
/////
///// User interface tests for the download limits management on shares.
/////
//@MainActor
//final class DownloadLimitUITests: BaseUIXCTestCase {
// ///
// /// Name of the file to work with.
// ///
// /// The leading underscore is required for the file to appear at the top of the list.
// /// Obviously, this is fragile by making some assumptions of the user interface state.
// ///
// let testFileName = "_Xcode UI Test Subject.md"
//
// // MARK: - Lifecycle
//
// override func setUp() async throws {
// try await super.setUp()
// continueAfterFailure = false
//
// // Handle alerts presented by the system.
// addUIInterruptionMonitor(withDescription: "Allow Notifications", for: "Allow")
// addUIInterruptionMonitor(withDescription: "Save Password", for: "Not Now")
//
// // Launch the app.
// app = XCUIApplication()
// app.launchArguments = ["UI_TESTING"]
// app.launch()
//
// try await logIn()
//
// // Set up test backend communication.
// backend = UITestBackend()
//
// try await backend.assertCapability(true, capability: \.downloadLimit)
// try await backend.delete(testFileName)
// try await backend.prepareTestFile(testFileName)
// }
//
// // MARK: - Tests
//
// func testShareWithoutDownloadLimitCapability() async throws {
// // This cannot be implemented at the time of writing.
// // There is no way to disable and enable server apps via web API.
// // The Xcode UI test process cannot access Docker.
// throw XCTSkip("Not implemented yet!")
// }
//
// func testNewShareWithoutDownloadLimit() async throws {
// pullToRefresh()
//
// // Tap share button.
//
// let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
//
// guard shareButton.exists else {
// throw UITestError.waitForExistence(shareButton)
// }
//
// shareButton.tap()
//
// // Tap add share link button.
//
// let addShareLinkButton = app.buttons["addShareLink"]
// guard addShareLinkButton.await() else { return }
// addShareLinkButton.tap()
//
// // Tap confirm share button.
//
// let confirmShareButton = app.buttons["confirmShare"]
//
// guard confirmShareButton.exists else {
// throw UITestError.waitForExistence(confirmShareButton)
// }
//
// confirmShareButton.tap()
// confirmShareButton.awaitInexistence()
//
// // Then
// let shares = try await backend.getShares(byPath: "/\(testFileName)")
// XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
//
// guard let token = shares.first?.token else {
// throw UITestError.missingValue
// }
//
// try await backend.assertNoDownloadLimit(by: token)
// }
//
// func testNewShareWithDownloadLimit() async throws {
// pullToRefresh()
//
// // Tap share button.
//
// let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
// guard shareButton.await() else { return }
// shareButton.tap()
//
// // Tap add share link button.
//
// let addShareLinkButton = app.buttons["addShareLink"]
// guard addShareLinkButton.await() else { return }
// addShareLinkButton.tap()
//
// // Tap download limits.
//
// let downloadLimitCell = app.cells["downloadLimit"]
// guard downloadLimitCell.await() else { return }
// downloadLimitCell.tap()
//
// // Tap download limit switch.
//
// let downloadLimitSwitch = app.switches["downloadLimitSwitch"]
// guard downloadLimitSwitch.await() else { return }
// downloadLimitSwitch.tap()
//
// // Update allowed downloads.
//
// let allowedDownloadsTextField = app.textFields["downloadLimitTextField"]
// guard allowedDownloadsTextField.await() else { return }
// allowedDownloadsTextField.tap()
// allowedDownloadsTextField.typeText("3")
//
// // Tap navigation back button.
//
// app.navigationBars.buttons.firstMatch.tap()
//
// // Tap confirm share button.
//
// let confirmShareButton = app.buttons["confirmShare"]
// guard confirmShareButton.await() else { return }
// confirmShareButton.tap()
// confirmShareButton.awaitInexistence()
//
// // Then
// let shares = try await backend.getShares(byPath: "/\(testFileName)")
// XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
//
// guard let token = shares.first?.token else {
// throw UITestError.missingValue
// }
//
// try await backend.assertDownloadLimit(by: token, count: 0, limit: 3)
// }
//
// func testShareOfFolder() async throws {
// let testSubject = "_Xcode UI Test Subject"
// try await backend.createFolder(testSubject)
// pullToRefresh()
//
// // Tap share button.
//
// let shareButton = app.buttons["Cell/\(testSubject)/shareButton"]
// guard shareButton.await() else { return }
// shareButton.tap()
//
// // Tap add share link button.
//
// let addShareLinkButton = app.buttons["addShareLink"]
// guard addShareLinkButton.await() else { return }
// addShareLinkButton.tap()
//
// // Verify download limits being unavailable.
//
// let downloadLimitCell = app.cells["downloadLimit"]
// XCTAssertFalse(downloadLimitCell.exists, "Folder shares cannot have download limits")
//
// // Cleanup
//
// try await backend.delete(testSubject)
// }
//
// func testAddingDownloadLimitToExistingShare() async throws {
// try await backend.createShare(byPath: testFileName)
// pullToRefresh()
//
// // Tap share button.
//
// let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
// guard shareButton.await() else { return }
// shareButton.tap()
//
// // Tap show share link details button.
//
// let showShareLinkDetailsButton = app.buttons["showShareLinkDetails"]
// guard showShareLinkDetailsButton.await() else { return }
// showShareLinkDetailsButton.tap()
//
// // Tap share link details button in share menu sheet.
//
// let shareMenuDetailsCell = app.cells["shareMenu/details"]
// guard shareMenuDetailsCell.await() else { return }
// shareMenuDetailsCell.tap()
//
// // Tap download limits.
//
// let downloadLimitCell = app.cells["downloadLimit"]
// guard downloadLimitCell.await() else { return }
// downloadLimitCell.tap()
//
// // Tap download limit switch.
//
// let downloadLimitSwitch = app.switches["downloadLimitSwitch"]
// guard downloadLimitSwitch.await() else { return }
// downloadLimitSwitch.tap()
//
// // Update allowed downloads.
//
// let allowedDownloadsTextField = app.textFields["downloadLimitTextField"]
// guard allowedDownloadsTextField.await() else { return }
// allowedDownloadsTextField.tap()
// allowedDownloadsTextField.typeText("3")
//
// // Tap navigation back button.
//
// app.navigationBars.buttons.firstMatch.tap()
//
// // Tap confirm share button.
//
// let confirmShareButton = app.buttons["confirmShare"]
// guard confirmShareButton.await() else { return }
// confirmShareButton.tap()
// confirmShareButton.awaitInexistence()
//
// // Then
// let shares = try await backend.getShares(byPath: "\(testFileName)")
// XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
//
// guard let token = shares.first?.token else {
// throw UITestError.missingValue
// }
//
// try await aMoment()
// try await backend.assertDownloadLimit(by: token, count: 0, limit: 3)
// }
//
// func testUpdatingDownloadLimitOnExistingShare() async throws {
// try await backend.createShare(byPath: testFileName)
// var shares = try await backend.getShares(byPath: testFileName)
//
// guard let token = shares.first?.token else {
// XCTFail("Failed to fetch token of share for test file!")
// return
// }
//
// try await backend.setDownloadLimit(to: 4, by: token)
// pullToRefresh()
//
// // Tap share button.
//
// let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
// guard shareButton.await() else { return }
// shareButton.tap()
//
// // Tap show share link details button.
//
// let showShareLinkDetailsButton = app.buttons["showShareLinkDetails"]
// guard showShareLinkDetailsButton.await() else { return }
// showShareLinkDetailsButton.tap()
//
// // Tap share link details button in share menu sheet.
//
// let shareMenuDetailsCell = app.cells["shareMenu/details"]
// guard shareMenuDetailsCell.await() else { return }
// shareMenuDetailsCell.tap()
//
// // Tap download limits.
//
// let downloadLimitCell = app.cells["downloadLimit"]
// guard downloadLimitCell.await() else { return }
// downloadLimitCell.tap()
//
// // Check download limit switch.
//
// let downloadLimitSwitch = app.switches["downloadLimitSwitch"].firstMatch
// guard downloadLimitSwitch.await() else { return }
//
// guard let downloadLimitSwitchValue = (downloadLimitSwitch.value as? String) else {
// XCTFail("Failed to get value of user interface control!")
// return
// }
//
// guard downloadLimitSwitchValue == "1" else {
// XCTFail("The switch is not on!")
// return
// }
//
// // Check and update allowed downloads.
//
// let allowedDownloadsTextField = app.textFields["downloadLimitTextField"]
// guard allowedDownloadsTextField.await() else { return }
//
// guard let allowedDownloadsTextFieldValue = (allowedDownloadsTextField.value as? String) else {
// XCTFail("Failed to get value of user interface control!")
// return
// }
//
// guard allowedDownloadsTextFieldValue == "4" else {
// XCTFail("The text field value is wrong!")
// return
// }
//
// allowedDownloadsTextField.tap()
// allowedDownloadsTextField.typeText("6")
//
// // Tap navigation back button.
//
// app.navigationBars.buttons.firstMatch.tap()
//
// // Tap confirm share button.
//
// let confirmShareButton = app.buttons["confirmShare"]
// guard confirmShareButton.await() else { return }
// confirmShareButton.tap()
// confirmShareButton.awaitInexistence()
//
// // Then
// shares = try await backend.getShares(byPath: "\(testFileName)")
// XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
//
// guard let token = shares.first?.token else {
// throw UITestError.missingValue
// }
//
// try await aMoment()
// try await backend.assertDownloadLimit(by: token, count: 0, limit: 6)
// }
//
// func testDiscardingDownloadLimitChangesOnExistingShare() async throws {
// try await backend.createShare(byPath: testFileName)
// var shares = try await backend.getShares(byPath: testFileName)
//
// guard let token = shares.first?.token else {
// XCTFail("Failed to fetch token of share for test file!")
// return
// }
//
// try await backend.setDownloadLimit(to: 8, by: token)
// pullToRefresh()
//
// // Tap share button.
//
// let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
// guard shareButton.await() else { return }
// shareButton.tap()
//
// // Tap show share link details button.
//
// let showShareLinkDetailsButton = app.buttons["showShareLinkDetails"]
// guard showShareLinkDetailsButton.await() else { return }
// showShareLinkDetailsButton.tap()
//
// // Tap share link details button in share menu sheet.
//
// let shareMenuDetailsCell = app.cells["shareMenu/details"]
// guard shareMenuDetailsCell.await() else { return }
// shareMenuDetailsCell.tap()
//
// // Tap download limits.
//
// let downloadLimitCell = app.cells["downloadLimit"]
// guard downloadLimitCell.await() else { return }
// downloadLimitCell.tap()
//
// // Check download limit switch.
//
// let downloadLimitSwitch = app.switches["downloadLimitSwitch"].firstMatch
// guard downloadLimitSwitch.await() else { return }
//
// guard let downloadLimitSwitchValue = (downloadLimitSwitch.value as? String) else {
// XCTFail("Failed to get value of user interface control!")
// return
// }
//
// guard downloadLimitSwitchValue == "1" else {
// XCTFail("The switch is not on!")
// return
// }
//
// // Check and update allowed downloads.
//
// let allowedDownloadsTextField = app.textFields["downloadLimitTextField"]
// guard allowedDownloadsTextField.await() else { return }
//
// guard let allowedDownloadsTextFieldValue = (allowedDownloadsTextField.value as? String) else {
// XCTFail("Failed to get value of user interface control!")
// return
// }
//
// allowedDownloadsTextField.tap()
// allowedDownloadsTextField.typeText("9")
//
// // Tap navigation back button.
//
// app.navigationBars.buttons.firstMatch.tap()
//
// // Tap confirm share button.
//
// let cancelShareButton = app.buttons["cancelShare"]
// guard cancelShareButton.await() else { return }
// cancelShareButton.tap()
//
// // Then
// shares = try await backend.getShares(byPath: "\(testFileName)")
// XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
//
// guard let token = shares.first?.token else {
// throw UITestError.missingValue
// }
//
// try await aMoment()
// try await backend.assertDownloadLimit(by: token, count: 0, limit: 8)
// }
//
// func testRemovingDownloadLimitFromExistingShare() async throws {
// try await backend.createShare(byPath: testFileName)
// var shares = try await backend.getShares(byPath: testFileName)
//
// guard let token = shares.first?.token else {
// XCTFail("Failed to fetch token of share for test file!")
// return
// }
//
// try await backend.setDownloadLimit(to: 4, by: token)
// pullToRefresh()
//
// // Tap share button.
//
// let shareButton = app.buttons["Cell/\(testFileName)/shareButton"]
// guard shareButton.await() else { return }
// shareButton.tap()
//
// // Tap show share link details button.
//
// let showShareLinkDetailsButton = app.buttons["showShareLinkDetails"]
// guard showShareLinkDetailsButton.await() else { return }
// showShareLinkDetailsButton.tap()
//
// // Tap share link details button in share menu sheet.
//
// let shareMenuDetailsCell = app.cells["shareMenu/details"]
// guard shareMenuDetailsCell.await() else { return }
// shareMenuDetailsCell.tap()
//
// // Tap download limits.
//
// let downloadLimitCell = app.cells["downloadLimit"]
// guard downloadLimitCell.await() else { return }
// downloadLimitCell.tap()
//
// // Check download limit switch.
//
// let downloadLimitSwitch = app.switches["downloadLimitSwitch"].firstMatch
// guard downloadLimitSwitch.await() else { return }
// downloadLimitSwitch.tap()
//
// // Tap navigation back button.
//
// app.navigationBars.buttons.firstMatch.tap()
//
// // Tap confirm share button.
//
// let confirmShareButton = app.buttons["confirmShare"]
// guard confirmShareButton.await() else { return }
// confirmShareButton.tap()
// confirmShareButton.awaitInexistence()
//
// // Then
// shares = try await backend.getShares(byPath: "\(testFileName)")
// XCTAssertEqual(shares.count, 1, "Only one share existing on \(testFileName)")
//
// guard let token = shares.first?.token else {
// throw UITestError.missingValue
// }
//
// try await aMoment()
// try await backend.assertDownloadLimit(by: token, count: nil, limit: nil)
// }
//}
@@ -0,0 +1,270 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Milen Pivchev
// SPDX-License-Identifier: GPL-3.0-or-later
import Testing
import UIKit
@testable import Nextcloud
@Suite("setBidiSafeTitle")
@MainActor
struct SetBidiSafeTitleTests {
@Test("Normal file splits into base and extension labels")
func normalFile() {
let navItem = UINavigationItem()
navItem.setBidiSafeTitle("document.pdf")
let stack = try! #require(navItem.titleView as? UIStackView)
#expect(stack.arrangedSubviews.count == 2)
let baseLabel = stack.arrangedSubviews[0] as? UILabel
let extLabel = stack.arrangedSubviews[1] as? UILabel
#expect(baseLabel?.text == "document")
#expect(extLabel?.text == ".pdf")
#expect(navItem.title == nil)
}
@Test("Multiple extensions splits on last dot")
func multipleExtensions() {
let navItem = UINavigationItem()
navItem.setBidiSafeTitle("archive.tar.gz")
let stack = try! #require(navItem.titleView as? UIStackView)
let baseLabel = stack.arrangedSubviews[0] as? UILabel
let extLabel = stack.arrangedSubviews[1] as? UILabel
#expect(baseLabel?.text == "archive.tar")
#expect(extLabel?.text == ".gz")
}
@Test("No extension uses plain title")
func noExtension() {
let navItem = UINavigationItem()
navItem.setBidiSafeTitle("README")
#expect(navItem.titleView == nil)
#expect(navItem.title == "README")
}
@Test("Dotfile uses plain title")
func dotfile() {
let navItem = UINavigationItem()
navItem.setBidiSafeTitle(".hidden")
#expect(navItem.titleView == nil)
#expect(navItem.title == ".hidden")
}
@Test("Empty string uses plain title")
func emptyString() {
let navItem = UINavigationItem()
navItem.setBidiSafeTitle("")
#expect(navItem.titleView == nil)
#expect(navItem.title == "")
}
@Test("RLO override isolates the real extension")
func rloOverride() {
let navItem = UINavigationItem()
// U+202E (RLO) reverses displayed text: "malware\u{202E}fdp.exe" looks like "malwareexe.pdf"
let malicious = "malware\u{202E}fdp.exe"
navItem.setBidiSafeTitle(malicious)
let stack = try! #require(navItem.titleView as? UIStackView)
let extLabel = stack.arrangedSubviews[1] as? UILabel
#expect(extLabel?.text == ".exe")
}
@Test("RLI override isolates the real extension")
func rliOverride() {
let navItem = UINavigationItem()
// U+2067 (RLI) Right-to-Left Isolate
let malicious = "invoice\u{2067}cod.exe"
navItem.setBidiSafeTitle(malicious)
let stack = try! #require(navItem.titleView as? UIStackView)
let extLabel = stack.arrangedSubviews[1] as? UILabel
#expect(extLabel?.text == ".exe")
}
@Test("LRO override isolates the real extension")
func lroOverride() {
let navItem = UINavigationItem()
// U+202D (LRO) Left-to-Right Override
let malicious = "report\u{202D}exe.pdf"
navItem.setBidiSafeTitle(malicious)
let stack = try! #require(navItem.titleView as? UIStackView)
let extLabel = stack.arrangedSubviews[1] as? UILabel
#expect(extLabel?.text == ".pdf")
}
@Test("Multiple bidi characters isolates the real extension")
func multipleBidiChars() {
let navItem = UINavigationItem()
// Stacked overrides: RLO + LRI
let malicious = "\u{202E}\u{2066}safe_document\u{2069}cod.exe"
navItem.setBidiSafeTitle(malicious)
let stack = try! #require(navItem.titleView as? UIStackView)
let extLabel = stack.arrangedSubviews[1] as? UILabel
#expect(extLabel?.text == ".exe")
}
@Test("Bidi override with PDF isolate in extension")
func bidiPDFIsolate() {
let navItem = UINavigationItem()
// U+2069 (PDI) Pop Directional Isolate used to terminate an isolate
let malicious = "image\u{2066}exe.jpg\u{2069}.png"
navItem.setBidiSafeTitle(malicious)
let stack = try! #require(navItem.titleView as? UIStackView)
let extLabel = stack.arrangedSubviews[1] as? UILabel
#expect(extLabel?.text == ".png")
}
@Test("FSI override isolates the real extension")
func fsiOverride() {
let navItem = UINavigationItem()
// U+2068 (FSI) First Strong Isolate
let malicious = "notes\u{2068}exe.bat"
navItem.setBidiSafeTitle(malicious)
let stack = try! #require(navItem.titleView as? UIStackView)
let extLabel = stack.arrangedSubviews[1] as? UILabel
#expect(extLabel?.text == ".bat")
}
}
@Suite("setBidiSafeFilename")
@MainActor
struct SetBidiSafeFilenameTests {
@Test("Normal file splits labels")
func normalFile() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
view.setBidiSafeFilename("photo.jpg", isDirectory: false, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(titleLabel.text == "photo")
#expect(extensionLabel.text == ".jpg")
#expect(extensionLabel.isHidden == false)
}
@Test("Directory shows full name and hides extension label")
func directory() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
view.setBidiSafeFilename("My Folder.backup", isDirectory: true, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(titleLabel.text == "My Folder.backup")
#expect(extensionLabel.text == "")
#expect(extensionLabel.isHidden == true)
}
@Test("No extension shows full name")
func noExtension() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
view.setBidiSafeFilename("Makefile", isDirectory: false, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(titleLabel.text == "Makefile")
#expect(extensionLabel.text == "")
#expect(extensionLabel.isHidden == true)
}
@Test("Dotfile shows full name")
func dotfile() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
view.setBidiSafeFilename(".gitignore", isDirectory: false, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(titleLabel.text == ".gitignore")
#expect(extensionLabel.text == "")
#expect(extensionLabel.isHidden == true)
}
@Test("Multiple extensions splits on last dot")
func multipleExtensions() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
view.setBidiSafeFilename("backup.tar.gz", isDirectory: false, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(titleLabel.text == "backup.tar")
#expect(extensionLabel.text == ".gz")
#expect(extensionLabel.isHidden == false)
}
@Test("RLO override isolates the real extension")
func rloOverride() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
// U+202E (RLO) reverses displayed text
let malicious = "malware\u{202E}fdp.exe"
view.setBidiSafeFilename(malicious, isDirectory: false, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(extensionLabel.text == ".exe")
#expect(extensionLabel.isHidden == false)
}
@Test("RLI override isolates the real extension")
func rliOverride() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
// U+2067 (RLI) Right-to-Left Isolate
let malicious = "invoice\u{2067}cod.exe"
view.setBidiSafeFilename(malicious, isDirectory: false, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(extensionLabel.text == ".exe")
#expect(extensionLabel.isHidden == false)
}
@Test("Multiple bidi characters isolates the real extension")
func multipleBidiChars() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
// Stacked overrides: RLO + LRI
let malicious = "\u{202E}\u{2066}safe_document\u{2069}cod.exe"
view.setBidiSafeFilename(malicious, isDirectory: false, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(extensionLabel.text == ".exe")
#expect(extensionLabel.isHidden == false)
}
@Test("Bidi override on directory still shows full name")
func bidiDirectory() {
let view = UIView()
let titleLabel = UILabel()
let extensionLabel = UILabel()
let malicious = "folder\u{202E}exe.txt"
view.setBidiSafeFilename(malicious, isDirectory: true, titleLabel: titleLabel, extensionLabel: extensionLabel)
#expect(titleLabel.text == malicious)
#expect(extensionLabel.text == "")
#expect(extensionLabel.isHidden == true)
}
@Test("Nil labels does not crash")
func nilLabels() {
let view = UIView()
view.setBidiSafeFilename("test.txt", isDirectory: false, titleLabel: nil, extensionLabel: nil)
}
}
@@ -0,0 +1,99 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import AVFoundation
import Foundation
import Testing
@testable import Nextcloud
@Suite("NCCameraRoll image format conversion")
struct NCCameraRollTests {
@Test("Animated and lossless formats retain their filenames")
func formatsPreserved() {
for fileName in ["animation.gif", "image.png", "animation.webp", "image.tiff", "image.jpg"] {
let fileExtension = (fileName as NSString).pathExtension
#expect(!NCCameraRoll.shouldConvertToJPEG(fileExtension: fileExtension, nativeFormat: false))
#expect(
NCCameraRoll.outputFileName(
for: fileName,
sourceFileExtension: fileExtension,
nativeFormat: false
) == fileName
)
}
}
@Test("Compatibility formats are converted to JPEG")
func compatibilityFormatsConverted() {
for fileName in ["image.heic", "image.heif", "image.dng"] {
let fileExtension = (fileName as NSString).pathExtension
#expect(NCCameraRoll.shouldConvertToJPEG(fileExtension: fileExtension, nativeFormat: false))
#expect(
NCCameraRoll.outputFileName(
for: fileName,
sourceFileExtension: fileExtension,
nativeFormat: false
) == "image.jpg"
)
}
}
@Test("Native format preserves HEIC, HEIF and RAW filenames")
func nativeFormatsPreserved() {
for fileName in ["image.heic", "image.heif", "image.dng"] {
let fileExtension = (fileName as NSString).pathExtension
#expect(!NCCameraRoll.shouldConvertToJPEG(fileExtension: fileExtension, nativeFormat: true))
#expect(
NCCameraRoll.outputFileName(
for: fileName,
sourceFileExtension: fileExtension,
nativeFormat: true
) == fileName
)
}
}
@Test("Generated upload names keep their base name")
func generatedNameConverted() {
#expect(
NCCameraRoll.outputFileName(
for: "2026-08-04 09-30-00.heic",
sourceFileExtension: "heic",
nativeFormat: false
) == "2026-08-04 09-30-00.jpg"
)
}
@Test("Video passthrough retains its original container")
func videoContainerPreserved() {
#expect(NCCameraRoll.videoOutputFileType(fileExtension: "mov") == .mov)
#expect(NCCameraRoll.videoOutputFileType(fileExtension: "MP4") == .mp4)
#expect(NCCameraRoll.videoOutputFileType(fileExtension: "m4v") == .m4v)
#expect(NCCameraRoll.videoOutputFileType(fileExtension: "jpg") == nil)
}
@Test("Concurrent extractions use distinct temporary paths")
func extractionTemporaryPathsAreUnique() {
let directory = FileManager.default.temporaryDirectory
let firstURL = NCCameraRoll.extractionTemporaryURL(
fileName: "26-08-04 10-51-42 7473.jpg",
ocId: "camera-roll-transfer",
directory: directory
)
let secondURL = NCCameraRoll.extractionTemporaryURL(
fileName: "26-08-04 10-51-42 7473.jpg",
ocId: "camera-roll-transfer",
directory: directory
)
#expect(firstURL != secondURL)
#expect(firstURL.deletingLastPathComponent() == directory)
#expect(firstURL.pathExtension == "uploading")
#expect(firstURL.lastPathComponent.contains("camera-roll-transfer"))
}
}
@@ -0,0 +1,110 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Foundation
import Testing
@testable import Nextcloud
@Suite("End-to-end key set archive")
struct NCEndToEndKeySetArchiveTests {
@Test("Archiving does not change the active credentials")
func preservesNormalActiveCredentials() throws {
let account = "e2ee-archive-\(UUID().uuidString)"
let preferences = NCPreferences()
defer {
preferences.clearAllKeysEndToEnd(account: account)
}
setKeySet(on: preferences, account: account)
try preferences.archiveCurrentEndToEndKeySet(account: account)
#expect(preferences.isEndToEndEnabled(account: account))
#expect(preferences.getEndToEndCertificate(account: account) == "certificate")
#expect(preferences.getEndToEndPrivateKey(account: account) == "private-key")
#expect(preferences.getEndToEndPublicKey(account: account) == "public-key")
#expect(preferences.getEndToEndPassphrase(account: account) == "passphrase")
}
@Test("Archiving preserves active credentials after they are cleared")
func preservesActiveCredentials() throws {
let account = "e2ee-archive-\(UUID().uuidString)"
let preferences = NCPreferences()
defer {
preferences.clearAllKeysEndToEnd(account: account)
}
setKeySet(on: preferences, account: account)
let archivedKeySet = try preferences.archiveCurrentEndToEndKeySet(account: account)
let snapshot = try #require(archivedKeySet)
preferences.clearCurrentKeysEndToEnd(account: account)
#expect(preferences.getEndToEndCertificate(account: account) == nil)
#expect(preferences.getEndToEndPrivateKey(account: account) == nil)
#expect(preferences.getEndToEndPublicKey(account: account) == nil)
#expect(preferences.getEndToEndPassphrase(account: account) == nil)
let archivedKeySets = try preferences.getArchivedEndToEndKeySets(account: account)
#expect(archivedKeySets == [snapshot])
#expect(snapshot.certificate == "certificate")
#expect(snapshot.privateKey == "private-key")
#expect(snapshot.publicKey == "public-key")
#expect(snapshot.passphrase == "passphrase")
}
@Test("Explicit local removal also clears stale server-key state")
func removalClearsStaleState() {
let account = "e2ee-archive-\(UUID().uuidString)"
let preferences = NCPreferences()
preferences.setEndToEndServerKeyStale(account: account, stale: true)
preferences.clearAllKeysEndToEnd(account: account)
#expect(!preferences.isEndToEndServerKeyStale(account: account))
}
@Test("Archiving the same credentials does not create duplicates")
func avoidsDuplicates() throws {
let account = "e2ee-archive-\(UUID().uuidString)"
let preferences = NCPreferences()
defer {
preferences.clearAllKeysEndToEnd(account: account)
}
setKeySet(on: preferences, account: account)
let firstArchivedKeySet = try preferences.archiveCurrentEndToEndKeySet(account: account)
let secondArchivedKeySet = try preferences.archiveCurrentEndToEndKeySet(account: account)
let firstSnapshot = try #require(firstArchivedKeySet)
let secondSnapshot = try #require(secondArchivedKeySet)
#expect(secondSnapshot.identifier == firstSnapshot.identifier)
#expect(try preferences.getArchivedEndToEndKeySets(account: account).count == 1)
}
@Test("A partial setup is archived when it contains usable key material")
func preservesPartialKeyMaterial() throws {
let account = "e2ee-archive-\(UUID().uuidString)"
let preferences = NCPreferences()
defer {
preferences.clearAllKeysEndToEnd(account: account)
}
preferences.setEndToEndPrivateKey(account: account, privateKey: "private-key")
let archivedKeySet = try preferences.archiveCurrentEndToEndKeySet(account: account)
let snapshot = try #require(archivedKeySet)
#expect(snapshot.privateKey == "private-key")
#expect(snapshot.certificate == nil)
#expect(snapshot.publicKey == nil)
#expect(snapshot.passphrase == nil)
}
private func setKeySet(on preferences: NCPreferences, account: String) {
preferences.setEndToEndCertificate(account: account, certificate: "certificate")
preferences.setEndToEndPrivateKey(account: account, privateKey: "private-key")
preferences.setEndToEndPublicKey(account: account, publicKey: "public-key")
preferences.setEndToEndPassphrase(account: account, passphrase: "passphrase")
}
}
@@ -0,0 +1,148 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Foundation
import Testing
@testable import Nextcloud
@Suite("End-to-end key set resolver")
struct NCEndToEndKeySetResolverTests {
@Test("The active key set has priority over archived key sets")
func activeKeySetHasPriority() throws {
let active = try #require(makeKeySet(identifier: "active"))
let archived = try #require(makeKeySet(identifier: "archived"))
let access = NCEndToEndKeySetResolver().select(
currentKeySet: active,
archivedKeySets: [archived],
canDecrypt: { _ in true }
)
#expect(access == .active(active))
#expect(access.canWrite)
#expect(access.writeAccessError == .success)
}
@Test("Equivalent PEM formatting identifies the same public key")
func equivalentPublicKeysMatch() {
let compact = "-----BEGIN PUBLIC KEY-----\nYWJjZA==\n-----END PUBLIC KEY-----"
let wrapped = "-----BEGIN PUBLIC KEY-----\nYWJj\nZA==\n-----END PUBLIC KEY-----\n"
let empty = "-----BEGIN PUBLIC KEY-----\n-----END PUBLIC KEY-----"
#expect(NCNetworkingE2EE().publicKeysMatch(compact, wrapped))
#expect(!NCNetworkingE2EE().publicKeysMatch(compact, "different-key"))
#expect(!NCNetworkingE2EE().publicKeysMatch(empty, empty))
}
@Test("A stale local key is excluded from active write access")
func staleKeyIsNotActive() throws {
let account = "e2ee-stale-\(UUID().uuidString)"
let preferences = NCPreferences()
defer {
preferences.clearAllKeysEndToEnd(account: account)
}
preferences.setEndToEndCertificate(account: account, certificate: "certificate")
preferences.setEndToEndPrivateKey(account: account, privateKey: "private-key")
preferences.setEndToEndPublicKey(account: account, publicKey: "public-key")
preferences.setEndToEndPassphrase(account: account, passphrase: "passphrase")
try preferences.archiveCurrentEndToEndKeySet(account: account)
preferences.setEndToEndServerKeyStale(account: account, stale: true)
let resolver = NCEndToEndKeySetResolver(preferences: preferences)
let archivedKeySets = try preferences.getArchivedEndToEndKeySets(account: account)
let archivedKeySet = try #require(archivedKeySets.last)
let access = resolver.select(
currentKeySet: resolver.currentKeySet(account: account),
archivedKeySets: archivedKeySets,
canDecrypt: { _ in true }
)
#expect(access == .archived(archivedKeySet))
#expect(!access.canWrite)
}
@Test("The most recently archived matching key set is selected")
func newestArchivedKeySetHasPriority() throws {
let oldest = try #require(makeKeySet(identifier: "oldest"))
let newest = try #require(makeKeySet(identifier: "newest"))
let access = NCEndToEndKeySetResolver().select(
currentKeySet: nil,
archivedKeySets: [oldest, newest],
canDecrypt: { _ in true }
)
#expect(access == .archived(newest))
#expect(access.isReadOnly)
#expect(access.writeAccessError.errorCode == NCGlobal.shared.errorE2EEReadOnly)
}
@Test("Access is unavailable when no key set can decrypt metadata")
func unavailableWithoutMatchingKeySet() throws {
let active = try #require(makeKeySet(identifier: "active"))
let archived = try #require(makeKeySet(identifier: "archived"))
let access = NCEndToEndKeySetResolver().select(
currentKeySet: active,
archivedKeySets: [archived],
canDecrypt: { _ in false }
)
#expect(access == .unavailable)
#expect(!access.canWrite)
#expect(!access.isReadOnly)
#expect(access.writeAccessError.errorCode == NCGlobal.shared.errorE2EENoUserFound)
}
@Test("A V2 child folder inherits its encrypted root metadata key")
func childFolderUsesRootEncryptedMetadataKey() {
let encryptedMetadataKey = NCEndToEndKeySetResolver().encryptedMetadataKey(
users: nil,
userId: "user",
rootEncryptedMetadataKey: "root-key"
)
#expect(encryptedMetadataKey == "root-key")
}
@Test("A V2 child folder with an empty users array inherits its encrypted root metadata key")
func childFolderWithEmptyUsersUsesRootEncryptedMetadataKey() {
let encryptedMetadataKey = NCEndToEndKeySetResolver().encryptedMetadataKey(
users: [],
userId: "user",
rootEncryptedMetadataKey: "root-key"
)
#expect(encryptedMetadataKey == "root-key")
}
@Test("A V2 root never falls back to a previously saved user key")
func rootWithoutCurrentUserDoesNotUseSavedKey() {
let otherUser = NCEndToEndMetadata.E2eeV2.Users(
userId: "other-user",
certificate: "certificate",
encryptedMetadataKey: "other-key"
)
let encryptedMetadataKey = NCEndToEndKeySetResolver().encryptedMetadataKey(
users: [otherUser],
userId: "user",
rootEncryptedMetadataKey: "saved-root-key"
)
#expect(encryptedMetadataKey == nil)
}
private func makeKeySet(identifier: String) -> NCEndToEndKeySet? {
NCEndToEndKeySet(
certificate: "certificate-" + identifier,
privateKey: "private-key-" + identifier,
publicKey: "public-key-" + identifier,
passphrase: "passphrase-" + identifier,
identifier: identifier,
archivedAt: Date(timeIntervalSince1970: 0)
)
}
}
@@ -0,0 +1,233 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Testing
import UIKit
@testable import Nextcloud
@Suite("Image zoom view")
@MainActor
struct NCImageZoomViewTests {
@Test("Replacing an image preserves its zoom scale and focal point")
func preservesZoomStateWhenImageChanges() throws {
let (coordinator, scrollView, imageView) = makeZoomView(
imageSize: CGSize(width: 400, height: 300)
)
scrollView.setZoomScale(3, animated: false)
scrollView.contentOffset = CGPoint(x: 220, y: 70)
let zoomState = try #require(coordinator.zoomState())
imageView.image = makeImage(
size: CGSize(width: 300, height: 400)
)
coordinator.layoutImageView(preserving: zoomState)
let restoredZoomState = try #require(coordinator.zoomState())
#expect(abs(restoredZoomState.zoomScale - zoomState.zoomScale) < 0.001)
#expect(abs(restoredZoomState.normalizedCenter.x - zoomState.normalizedCenter.x) < 0.001)
#expect(abs(restoredZoomState.normalizedCenter.y - zoomState.normalizedCenter.y) < 0.001)
}
@Test("Relayout without a saved state resets zoom")
func resetsZoomWithoutSavedState() {
let (coordinator, scrollView, imageView) = makeZoomView(
imageSize: CGSize(width: 400, height: 300)
)
scrollView.setZoomScale(3, animated: false)
imageView.image = makeImage(
size: CGSize(width: 800, height: 600)
)
coordinator.layoutImageViewResettingZoom()
#expect(scrollView.zoomScale == scrollView.minimumZoomScale)
#expect(coordinator.zoomState() == nil)
}
@Test("A full orientation round trip preserves zoom and focal point")
func preservesZoomStateAfterOrientationRoundTrip() throws {
let (coordinator, scrollView, _) = makeZoomView(
imageSize: CGSize(width: 400, height: 300)
)
scrollView.setZoomScale(3, animated: false)
scrollView.contentOffset = CGPoint(x: 0, y: 70)
coordinator.recordCurrentZoomState()
let zoomState = try #require(coordinator.zoomState())
for _ in 0..<3 {
scrollView.bounds = CGRect(
origin: scrollView.bounds.origin,
size: CGSize(width: 480, height: 320)
)
coordinator.layoutImageViewPreservingOnBoundsChange()
// UIKit can deliver automatic scrolling after a rotation finishes.
scrollView.contentOffset = .zero
coordinator.scrollViewDidScroll(scrollView)
scrollView.bounds = CGRect(
origin: scrollView.bounds.origin,
size: CGSize(width: 320, height: 480)
)
coordinator.layoutImageViewPreservingOnBoundsChange()
let restoredZoomState = try #require(coordinator.zoomState())
#expect(abs(restoredZoomState.zoomScale - zoomState.zoomScale) < 0.001)
#expect(abs(restoredZoomState.normalizedCenter.x - zoomState.normalizedCenter.x) < 0.001)
#expect(abs(restoredZoomState.normalizedCenter.y - zoomState.normalizedCenter.y) < 0.001)
}
}
@Test("Double-tap zoom survives view recreation and rotation")
func preservesDoubleTapZoomAfterViewRecreation() throws {
var persistedZoomState: NCImageZoomView.ZoomState?
let (firstCoordinator, firstScrollView, firstImageView) = makeZoomView(
imageSize: CGSize(width: 400, height: 300),
onZoomStateChanged: { persistedZoomState = $0 }
)
firstCoordinator.toggleZoom(
at: CGPoint(
x: firstImageView.bounds.midX,
y: firstImageView.bounds.midY
),
animated: false
)
let expectedZoomState = try #require(persistedZoomState)
#expect(abs(firstScrollView.zoomScale - expectedZoomState.zoomScale) < 0.001)
let (restoredCoordinator, restoredScrollView, _) = makeZoomView(
imageSize: CGSize(width: 400, height: 300),
initialZoomState: expectedZoomState
)
restoredScrollView.bounds = CGRect(
origin: restoredScrollView.bounds.origin,
size: CGSize(width: 480, height: 320)
)
restoredCoordinator.layoutImageViewPreservingOnBoundsChange()
let restoredZoomState = try #require(restoredCoordinator.zoomState())
#expect(abs(restoredZoomState.zoomScale - expectedZoomState.zoomScale) < 0.001)
#expect(abs(restoredZoomState.normalizedCenter.x - expectedZoomState.normalizedCenter.x) < 0.001)
#expect(abs(restoredZoomState.normalizedCenter.y - expectedZoomState.normalizedCenter.y) < 0.001)
}
@Test("Live Photo playback uses the still image zoom and focal point")
func livePhotoPlaybackPreservesZoomState() {
let zoomState = NCImageZoomView.ZoomState(
zoomScale: 3,
normalizedCenter: CGPoint(x: 0.6, y: 0.55)
)
let layout = NCLivePhotoPlaybackLayout(
containerSize: CGSize(width: 320, height: 480),
photoSize: CGSize(width: 400, height: 300),
zoomState: zoomState
)
#expect(abs(layout.frame.width - 960) < 0.001)
#expect(abs(layout.frame.height - 720) < 0.001)
#expect(abs(
layout.frame.origin.x + layout.frame.width * zoomState.normalizedCenter.x - 160
) < 0.001)
#expect(abs(
layout.frame.origin.y + layout.frame.height * zoomState.normalizedCenter.y - 240
) < 0.001)
}
@Test("Live Photo playback remains aspect-fit without zoom")
func livePhotoPlaybackUsesAspectFitWithoutZoom() {
let layout = NCLivePhotoPlaybackLayout(
containerSize: CGSize(width: 320, height: 480),
photoSize: CGSize(width: 400, height: 300),
zoomState: nil
)
#expect(layout.frame == CGRect(x: 0, y: 120, width: 320, height: 240))
}
@Test("Live Photo playback clamps transient elastic zoom")
func livePhotoPlaybackClampsElasticZoom() {
let layout = NCLivePhotoPlaybackLayout(
containerSize: CGSize(width: 320, height: 480),
photoSize: CGSize(width: 400, height: 300),
zoomState: NCImageZoomView.ZoomState(
zoomScale: 20,
normalizedCenter: CGPoint(x: 0.5, y: 0.5)
)
)
#expect(layout.frame == CGRect(x: -640, y: -360, width: 1_600, height: 1_200))
}
@Test("Persisted zoom state clamps transient elastic zoom")
func persistedZoomStateClampsElasticZoom() throws {
var persistedZoomState: NCImageZoomView.ZoomState?
let (coordinator, scrollView, _) = makeZoomView(
imageSize: CGSize(width: 400, height: 300),
onZoomStateChanged: { persistedZoomState = $0 }
)
// Allow the test scroll view to reproduce the temporary value that
// UIScrollView can report while bouncesZoom is active.
scrollView.maximumZoomScale = 20
scrollView.setZoomScale(20, animated: false)
coordinator.scrollViewDidEndZooming(
scrollView,
with: nil,
atScale: scrollView.zoomScale
)
let zoomState = try #require(persistedZoomState)
#expect(zoomState.zoomScale == coordinator.maximumZoomScale)
}
private func makeZoomView(
imageSize: CGSize,
initialZoomState: NCImageZoomView.ZoomState? = nil,
onZoomStateChanged: @escaping (NCImageZoomView.ZoomState?) -> Void = { _ in }
) -> (
NCImageZoomView.Coordinator,
NCImageZoomView.NCZoomScrollView,
UIImageView
) {
let coordinator = NCImageZoomView.Coordinator()
let scrollView = NCImageZoomView.NCZoomScrollView(
frame: CGRect(x: 0, y: 0, width: 320, height: 480)
)
let imageView = UIImageView(
image: makeImage(size: imageSize)
)
scrollView.minimumZoomScale = 1
scrollView.maximumZoomScale = 5
scrollView.delegate = coordinator
scrollView.addSubview(imageView)
coordinator.minimumZoomScale = 1
coordinator.maximumZoomScale = 5
coordinator.scrollView = scrollView
coordinator.imageView = imageView
coordinator.onZoomStateChanged = onZoomStateChanged
coordinator.restorePersistedZoomState(initialZoomState)
coordinator.layoutImageView(preserving: initialZoomState)
return (coordinator, scrollView, imageView)
}
private func makeImage(size: CGSize) -> UIImage {
UIGraphicsImageRenderer(size: size).image { context in
UIColor.black.setFill()
context.fill(CGRect(origin: .zero, size: size))
}
}
}
@@ -0,0 +1,77 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Testing
@testable import Nextcloud
@Suite("Media playback completion options")
@MainActor
struct NCMediaPlaybackOptionsTests {
@Test("Playback stops when no completion option is enabled")
func stopsByDefault() {
let options = NCMediaPlaybackOptions(preferences: nil)
#expect(options.completionAction == .stop)
}
@Test("Automatic advance plays the next compatible item")
func advancesAutomatically() {
let options = NCMediaPlaybackOptions(preferences: nil)
options.toggleAutoAdvance()
#expect(options.completionAction == .playNextItem)
}
@Test("Disabling repeat restores normal stop behavior")
func disablingRepeatRestoresStop() {
let options = NCMediaPlaybackOptions(preferences: nil)
options.toggleRepeat()
#expect(options.completionAction == .repeatCurrentItem)
options.toggleRepeat()
#expect(options.completionAction == .stop)
}
@Test("Repeat takes precedence over automatic advance")
func repeatTakesPrecedence() {
let options = NCMediaPlaybackOptions(preferences: nil)
options.toggleAutoAdvance()
options.toggleRepeat()
#expect(options.completionAction == .repeatCurrentItem)
options.toggleRepeat()
#expect(options.completionAction == .playNextItem)
}
@Test("Playback options restore and save their preferences")
func persistsPlaybackOptions() {
let preferences = NCPreferences()
let originalRepeat = preferences.mediaViewerRepeatCurrentItem
let originalAutoAdvance = preferences.mediaViewerAutoAdvance
defer {
preferences.mediaViewerRepeatCurrentItem = originalRepeat
preferences.mediaViewerAutoAdvance = originalAutoAdvance
}
preferences.mediaViewerRepeatCurrentItem = true
preferences.mediaViewerAutoAdvance = false
let options = NCMediaPlaybackOptions(preferences: preferences)
#expect(options.isRepeatEnabled)
#expect(!options.isAutoAdvanceEnabled)
options.toggleRepeat()
options.toggleAutoAdvance()
#expect(!preferences.mediaViewerRepeatCurrentItem)
#expect(preferences.mediaViewerAutoAdvance)
}
}
@@ -0,0 +1,66 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Testing
import UIKit
@testable import Nextcloud
@Suite("Media viewer floating title")
@MainActor
struct NCMediaViewerFloatingTitleViewTests {
@Test("Preserves the system foreground color")
func preservesSystemForegroundColor() throws {
let titleView = NCMediaViewerFloatingTitleView()
titleView.update(
primaryText: "Photo.jpg",
secondaryText: "13 Aug 2026 at 09:17"
)
let titleButton = try #require(
titleView.subviews.first as? UIButton
)
titleView.frame = CGRect(x: 0, y: 0, width: 300, height: 44)
titleView.layoutIfNeeded()
let configuration = try #require(titleButton.configuration)
let transformer = try #require(
configuration.titleTextAttributesTransformer
)
var incoming = AttributeContainer()
incoming.uiKit.foregroundColor = .white
let outgoing = transformer(incoming)
#expect(configuration.baseForegroundColor == nil)
#expect(titleButton.isEnabled)
#expect(titleButton.isUserInteractionEnabled)
#expect(titleButton.state == .normal)
#expect(titleButton.tintAdjustmentMode == .normal)
#expect(
titleView.hitTest(
CGPoint(x: titleView.bounds.midX, y: titleView.bounds.midY),
with: nil
) == nil
)
#expect(titleButton.titleLabel?.text == "Photo.jpg")
#expect(titleButton.subtitleLabel?.text == "13 Aug 2026 at 09:17")
#expect(outgoing.uiKit.foregroundColor == .white)
#expect(
outgoing.uiKit.font == UIFont.systemFont(
ofSize: 13,
weight: .semibold
)
)
let normalTextColor = titleButton.titleLabel?.textColor
titleView.tintAdjustmentMode = .dimmed
titleView.layoutIfNeeded()
#expect(titleButton.isEnabled)
#expect(titleButton.state == .normal)
#expect(titleButton.tintAdjustmentMode == .normal)
#expect(titleButton.titleLabel?.text == "Photo.jpg")
#expect(titleButton.titleLabel?.textColor == normalTextColor)
}
}
@@ -0,0 +1,209 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Testing
import NextcloudKit
@testable import Nextcloud
@Suite("Media viewer model")
@MainActor
struct NCMediaViewerModelTests {
@Test("Duplicate media identifiers produce a single viewer page")
func removesDuplicateIdentifiers() {
let metadata = tableMetadata()
metadata.ocId = "current"
let model = NCMediaViewerInitialModel(
currentMetadata: metadata,
ocIds: ["first", "current", "current", "last", "first"]
)
#expect(model.normalizedOcIds == ["first", "current", "last"])
#expect(model.currentSelectedIndex == 1)
}
@Test("Missing current media is inserted before the supplied identifiers")
func insertsMissingCurrentIdentifier() {
let metadata = tableMetadata()
metadata.ocId = "current"
let model = NCMediaViewerInitialModel(
currentMetadata: metadata,
ocIds: ["next", "next"]
)
#expect(model.normalizedOcIds == ["current", "next"])
#expect(model.currentSelectedIndex == 0)
}
@Test("Programmatic paging deactivates media until the target settles")
func programmaticPagingActivatesOnlySettledTarget() {
let model = makeViewerModel()
#expect(model.activePageIndex == 0)
model.beginPageTransition(
to: 1,
shouldAutoPlay: true
)
#expect(model.pageTransition == .programmatic(targetIndex: 1))
#expect(model.selectedIndex == 0)
#expect(model.activePageIndex == nil)
#expect(model.autoPlayTargetIndex == 1)
model.finishPageTransition(at: 1)
#expect(model.pageTransition == .idle)
#expect(model.selectedIndex == 1)
#expect(model.activePageIndex == 1)
#expect(model.autoPlayTargetIndex == 1)
}
@Test("Interactive paging keeps intermediate pages inactive")
func interactivePagingKeepsIntermediatePagesInactive() {
let model = makeViewerModel()
model.beginPageTransition(
to: nil,
shouldAutoPlay: false
)
model.updateSelectedIndexDuringTransition(1)
#expect(model.pageTransition == .interactive)
#expect(model.selectedIndex == 1)
#expect(model.activePageIndex == nil)
model.finishPageTransition(at: 1)
#expect(model.pageTransition == .idle)
#expect(model.activePageIndex == 1)
}
@Test("Settling on an unexpected page cancels pending autoplay")
func unexpectedSettledPageCancelsAutoPlay() {
let model = makeViewerModel()
model.beginPageTransition(
to: 2,
shouldAutoPlay: true
)
model.finishPageTransition(at: 1)
#expect(model.pageTransition == .idle)
#expect(model.activePageIndex == 1)
#expect(model.autoPlayTargetIndex == nil)
}
@Test("Selection updates are ignored outside an interactive transition")
func ignoresTransitionUpdatesWhileIdle() {
let model = makeViewerModel()
model.updateSelectedIndexDuringTransition(1)
#expect(model.selectedIndex == 0)
#expect(model.activePageIndex == 0)
}
@Test("Loading a page does not implicitly change the selection")
func loadingDoesNotSelectPage() async {
let model = makeViewerModel()
await model.displayPage(at: 1)
#expect(model.selectedIndex == 0)
#expect(model.activePageIndex == 0)
}
@Test("Regular image previews do not require the original file")
func regularImagePreviewDoesNotRequireOriginal() {
let metadata = imageMetadata(fileName: "photo.HEIC")
let policy = NCMediaViewerLoadingPolicy.standard
#expect(!policy.shouldDownloadOriginalImage(
for: metadata,
hasUsablePreview: true
))
}
@Test("GIF and SVG images always require the original file")
func specialImageFormatsRequireOriginal() {
let policy = NCMediaViewerLoadingPolicy.standard
#expect(policy.shouldDownloadOriginalImage(
for: imageMetadata(fileName: "animation.GIF"),
hasUsablePreview: true
))
#expect(policy.shouldDownloadOriginalImage(
for: imageMetadata(fileName: "drawing.svg"),
hasUsablePreview: true
))
}
@Test("A missing preview falls back to the original file")
func missingPreviewRequiresOriginal() {
let metadata = imageMetadata(fileName: "photo.jpg")
let policy = NCMediaViewerLoadingPolicy.standard
#expect(policy.shouldDownloadOriginalImage(
for: metadata,
hasUsablePreview: false
))
}
@Test("The internal switch restores automatic original downloads")
func internalSwitchEnablesOriginalDownloads() {
let metadata = imageMetadata(fileName: "photo.jpg")
let policy = NCMediaViewerLoadingPolicy(
automaticallyDownloadsOriginalImages: true,
automaticallyDownloadsLivePhotoResources: false
)
#expect(policy.shouldDownloadOriginalImage(
for: metadata,
hasUsablePreview: true
))
}
@Test("Live Photo resources remain on demand unless their switch is enabled")
func livePhotoResourcesRespectInternalSwitch() {
let metadata = imageMetadata(fileName: "live-photo.heic")
metadata.livePhotoFile = "live-photo.mov"
#expect(!NCMediaViewerLoadingPolicy.standard.shouldDownloadLivePhotoResources(
for: metadata
))
let automaticPolicy = NCMediaViewerLoadingPolicy(
automaticallyDownloadsOriginalImages: false,
automaticallyDownloadsLivePhotoResources: true
)
#expect(automaticPolicy.shouldDownloadLivePhotoResources(for: metadata))
#expect(automaticPolicy.shouldDownloadOriginalImage(
for: metadata,
hasUsablePreview: true
))
}
private func makeViewerModel() -> NCMediaViewerModel {
let metadata = tableMetadata()
metadata.ocId = "first"
return NCMediaViewerModel(
currentMetadata: metadata,
ocIds: ["first", "second", "third"],
session: NCSession().getSession(account: ""),
loader: NCMediaViewerLoader()
)
}
private func imageMetadata(fileName: String) -> tableMetadata {
let metadata = tableMetadata()
metadata.classFile = NKTypeClassFile.image.rawValue
metadata.fileName = fileName
metadata.fileNameView = fileName
return metadata
}
}
@@ -0,0 +1,110 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2026 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import Testing
@testable import Nextcloud
@Suite("Video playback presentation context")
struct NCVideoPlaybackPresentationContextTests {
@Test("User-initiated playback starts with visible controls")
func userInitiatedPlaybackShowsControls() {
var context = NCVideoPlaybackPresentationContext(
startReason: .userInitiated
)
context.prepareForPlaybackStart()
#expect(context.shouldShowControlsOnStart)
#expect(context.playbackTransition == .idle)
#expect(!context.shouldSuppressAutomaticControlsPresentation)
}
@Test("Automatic advancement starts without presenting controls")
func automaticAdvanceSuppressesControls() {
var context = NCVideoPlaybackPresentationContext(
startReason: .automaticAdvance
)
context.prepareForPlaybackStart()
#expect(!context.shouldShowControlsOnStart)
#expect(context.playbackTransition == .automaticStart)
#expect(context.shouldSuppressAutomaticControlsPresentation)
context.finishPlaybackTransition()
#expect(context.playbackTransition == .idle)
#expect(!context.shouldSuppressAutomaticControlsPresentation)
#expect(context.shouldShowControlsOnStart)
}
@Test("Repeat restart suppresses automatic control presentation")
func repeatRestartSuppressesControls() {
var context = NCVideoPlaybackPresentationContext(
startReason: .userInitiated
)
context.beginRepeatRestart()
#expect(context.playbackTransition == .repeatRestart)
#expect(context.shouldSuppressAutomaticControlsPresentation)
context.finishPlaybackTransition()
#expect(context.playbackTransition == .idle)
#expect(!context.shouldSuppressAutomaticControlsPresentation)
}
@Test("Seeking is represented by the shared transition state")
func seekingUsesSharedTransition() {
var context = NCVideoPlaybackPresentationContext(
startReason: .userInitiated
)
context.beginSeeking()
#expect(context.interaction == .seeking)
#expect(context.isSeeking)
#expect(context.shouldSuppressAutomaticControlsPresentation)
context.finishSeeking()
#expect(!context.isSeeking)
}
@Test("Playback callbacks preserve seeking and complete automatic start")
func playbackCallbackPreservesSeekingAndCompletesAutomaticStart() {
var context = NCVideoPlaybackPresentationContext(
startReason: .automaticAdvance
)
context.prepareForPlaybackStart()
context.beginSeeking()
context.finishPlaybackTransition()
#expect(context.isSeeking)
#expect(context.playbackTransition == .idle)
#expect(context.shouldShowControlsOnStart)
#expect(context.shouldSuppressAutomaticControlsPresentation)
context.finishSeeking()
#expect(!context.shouldSuppressAutomaticControlsPresentation)
}
@Test("Reset clears playback and interaction transitions")
func resetClearsAllTransitions() {
var context = NCVideoPlaybackPresentationContext(
startReason: .automaticAdvance
)
context.prepareForPlaybackStart()
context.beginSeeking()
context.reset()
#expect(context.playbackTransition == .idle)
#expect(context.interaction == .idle)
#expect(!context.shouldSuppressAutomaticControlsPresentation)
}
}
@@ -1,7 +0,0 @@
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2025 Iva Horn
// SPDX-License-Identifier: GPL-3.0-or-later
// There are no unit tests yet.
// This is an empty placeholder file.
// The compiler requires at least an empty file for every target.
+106 -163
View File
@@ -1,32 +1,12 @@
//
// DashboardData.swift
// Widget
//
// Created by Marino Faggiana on 20/08/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import UIKit
import WidgetKit
import Intents
import NextcloudKit
import RealmSwift
import SVGKit
struct DashboardDataEntry: TimelineEntry {
let date: Date
@@ -48,22 +28,22 @@ struct DashboardData: Identifiable, Hashable {
let subTitle: String
let link: URL
let icon: UIImage
let template: Bool
let avatar: Bool
let circle: Bool
let imageSystem: Bool
let imageColor: UIColor?
}
let dashboardDatasTest: [DashboardData] = [
.init(id: 0, title: "title0", subTitle: "subTitle-description0", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 1, title: "title1", subTitle: "subTitle-description1", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 2, title: "title2", subTitle: "subTitle-description2", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 3, title: "title3", subTitle: "subTitle-description3", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 4, title: "title4", subTitle: "subTitle-description4", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 5, title: "title5", subTitle: "subTitle-description5", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 6, title: "title6", subTitle: "subTitle-description6", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 7, title: "title7", subTitle: "subTitle-description7", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 8, title: "title8", subTitle: "subTitle-description8", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil),
.init(id: 9, title: "title9", subTitle: "subTitle-description9", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(named: "widget")!, template: true, avatar: false, imageColor: nil)
.init(id: 0, title: "title0", subTitle: "subTitle-description0", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "document")!, circle: false, imageSystem: true, imageColor: nil),
.init(id: 1, title: "title1", subTitle: "subTitle-description1", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "document")!, circle: false, imageSystem: true, imageColor: nil),
.init(id: 2, title: "title2", subTitle: "subTitle-description2", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "document")!, circle: true, imageSystem: false, imageColor: nil),
.init(id: 3, title: "title3", subTitle: "subTitle-description3", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "document")!, circle: false, imageSystem: false, imageColor: nil),
.init(id: 4, title: "title4", subTitle: "subTitle-description4", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "circle.fill")!, circle: false, imageSystem: false, imageColor: nil),
.init(id: 5, title: "title5", subTitle: "subTitle-description5", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "circle.fill")!, circle: false, imageSystem: false, imageColor: nil),
.init(id: 6, title: "title6", subTitle: "subTitle-description6", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "circle.fill")!, circle: false, imageSystem: false, imageColor: nil),
.init(id: 7, title: "title7", subTitle: "subTitle-description7", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "circle.fill")!, circle: false, imageSystem: false, imageColor: nil),
.init(id: 8, title: "title8", subTitle: "subTitle-description8", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "circle.fill")!, circle: false, imageSystem: false, imageColor: nil),
.init(id: 9, title: "title9", subTitle: "subTitle-description9", link: URL(string: "https://nextcloud.com/")!, icon: UIImage(systemName: "circle.fill")!, circle: false, imageSystem: false, imageColor: nil)
]
func getDashboardItems(displaySize: CGSize, withButton: Bool) -> Int {
@@ -76,31 +56,7 @@ func getDashboardItems(displaySize: CGSize, withButton: Bool) -> Int {
}
}
func convertDataToImage(data: Data?, size: CGSize, fileNameToWrite: String?) -> UIImage? {
guard let data = data else {
return nil
}
var imageData: UIImage?
let utilityFileSystem = NCUtilityFileSystem()
if let image = UIImage(data: data), let image = image.resizeImage(size: size) {
imageData = image
} else if let image = SVGKImage(data: data) {
image.size = size
imageData = image.uiImage
} else {
print("error")
}
if let fileName = fileNameToWrite, let image = imageData {
do {
let fileNamePath: String = utilityFileSystem.createServerUrl(serverUrl: utilityFileSystem.directoryUserData, fileName: fileName + ".png")
try image.pngData()?.write(to: URL(fileURLWithPath: fileNamePath), options: .atomic)
} catch { }
}
return imageData
}
func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, displaySize: CGSize, completion: @escaping (_ entry: DashboardDataEntry) -> Void) {
func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, displaySize: CGSize) async -> DashboardDataEntry {
let utilityFileSystem = NCUtilityFileSystem()
let utility = NCUtility()
let dashboardItems = getDashboardItems(displaySize: displaySize, withButton: false)
@@ -108,14 +64,15 @@ func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, dis
var activeTableAccount: tableAccount?
let versionApp = NCUtility().getVersionMaintenance()
if let groupDefaults = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroup),
guard let groupDefaults = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroup),
let lastVersion = groupDefaults.string(forKey: NCGlobal.shared.udLastVersion),
lastVersion != versionApp {
return completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: UIImage(named: "widget")!, title: "Dashboard", footerImage: "checkmark.icloud", footerText: NSLocalizedString("_version_mismatch_error_", comment: ""), account: ""))
lastVersion == versionApp else {
return (DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: UIImage(systemName: "circle.fill") ?? UIImage(), title: "Dashboard", footerImage: "checkmark.icloud", footerText: NSLocalizedString("_version_mismatch_error_", comment: ""), account: ""))
}
if isPreview {
return completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: UIImage(named: "widget")!, title: "Dashboard", footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " dashboard", account: ""))
if isPreview,
let image = UIImage(systemName: "circle.fill") {
return (DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: image, title: "Dashboard", footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " dashboard", account: ""))
}
let accountIdentifier: String = configuration?.accounts?.identifier ?? "active"
@@ -126,22 +83,14 @@ func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, dis
}
guard let activeTableAccount else {
return completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: UIImage(named: "widget")!, title: "Dashboard", footerImage: "xmark.icloud", footerText: NSLocalizedString("_no_active_account_", comment: ""), account: ""))
return (DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: UIImage(systemName: "circle.fill") ?? UIImage(), title: "Dashboard", footerImage: "xmark.icloud", footerText: NSLocalizedString("_no_active_account_", comment: ""), account: ""))
}
// Default widget
let result = NCManageDatabase.shared.getDashboardWidgetApplications(account: activeTableAccount.account).first
let id: String = configuration?.applications?.identifier ?? (result?.id ?? "recommendations")
// NETWORKING
let password = NCPreferences().getPassword(account: activeTableAccount.account)
NextcloudKit.shared.setup(groupIdentifier: NCBrandOptions.shared.capabilitiesGroup, delegate: NCNetworking.shared)
NextcloudKit.shared.appendSession(account: activeTableAccount.account,
urlBase: activeTableAccount.urlBase,
user: activeTableAccount.user,
userId: activeTableAccount.userId,
password: password,
password: NCPreferences().getPassword(account: activeTableAccount.account),
userAgent: userAgent,
httpMaximumConnectionsPerHost: NCBrandOptions.shared.httpMaximumConnectionsPerHost,
httpMaximumConnectionsPerHostInDownload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInDownload,
@@ -150,115 +99,109 @@ func getDashboardDataEntry(configuration: DashboardIntent?, isPreview: Bool, dis
// LOG
let versionNextcloudiOS = String(format: NCBrandOptions.shared.textCopyrightNextcloudiOS, utility.getVersionBuild())
NextcloudKit.configureLogger(logLevel: (NCBrandOptions.shared.disable_log ? .disabled : NCPreferences().log))
nkLog(debug: "Start \(NCBrandOptions.shared.brand) dashboard widget session " + versionNextcloudiOS)
let (tableDashboard, tableButton) = NCManageDatabase.shared.getDashboardWidget(account: activeTableAccount.account, id: id)
let existsButton = (tableButton?.isEmpty ?? true) ? false : true
let title = tableDashboard?.title ?? id
// Widget
let widgetApplication = NCManageDatabase.shared.getDashboardWidgetApplications(account: activeTableAccount.account).first
let widgetApplicationId: String = configuration?.applications?.identifier ?? (widgetApplication?.id ?? "recommendations")
var imagetmp = UIImage(named: "widget")!
let (tableDashboard, tableButton) = NCManageDatabase.shared.getDashboardWidget(account: activeTableAccount.account, id: widgetApplicationId)
let existsButton = (tableButton?.isEmpty ?? true) ? false : true
let title = tableDashboard?.title ?? widgetApplicationId
var titleImage: UIImage = UIImage(systemName: "circle.fill") ?? UIImage()
if let fileName = tableDashboard?.iconClass {
let fileNamePath: String = utilityFileSystem.createServerUrl(serverUrl: utilityFileSystem.directoryUserData, fileName: fileName + ".png")
if let image = UIImage(contentsOfFile: fileNamePath) {
imagetmp = image.withTintColor(NCBrandColor.shared.iconImageColor, renderingMode: .alwaysOriginal)
titleImage = image.withTintColor(NCBrandColor.shared.iconImageColor, renderingMode: .alwaysOriginal)
}
}
let titleImage = imagetmp
let options = NKRequestOptions(timeout: 90, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)
NextcloudKit.shared.getDashboardWidgetsApplication(id, account: activeTableAccount.account, options: options) { account, results, responseData, error in
Task {
var datas = [DashboardData]()
var numberItems = 0
let resultsDashboardWidget = await NextcloudKit.shared.getDashboardWidgetsApplicationAsync(widgetApplicationId, account: activeTableAccount.account, options: options)
if let results = results {
for result in results {
if let items = result.items {
numberItems = result.items?.count ?? 0
var counter: Int = 0
let dashboardItems = getDashboardItems(displaySize: displaySize, withButton: existsButton)
for item in items {
counter += 1
let title = item.title ?? ""
let subtitle = item.subtitle ?? ""
var link = URL(string: "https://")!
if let entryLink = item.link, let url = URL(string: entryLink) { link = url }
var icon = UIImage(named: "file")!
var iconFileName: String?
var datas = [DashboardData]()
var numberItems = 0
var imageTemplate: Bool = false
var imageAvatar: Bool = false
var imageColorized: Bool = false
var imageColor: UIColor?
if resultsDashboardWidget.error == .success,
let dashboardApplications = resultsDashboardWidget.dashboardApplications {
for dashboardApplication in dashboardApplications {
if let items = dashboardApplication.items {
numberItems = dashboardApplication.items?.count ?? 0
var counter: Int = 0
let dashboardItems = getDashboardItems(displaySize: displaySize, withButton: existsButton)
for item in items {
counter += 1
if let iconUrl = item.iconUrl, let url = URL(string: iconUrl) {
if let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {
let title = item.title ?? ""
let subtitle = item.subtitle ?? ""
let path = (urlComponents.path as NSString)
let pathComponents = path.components(separatedBy: "/")
let queryItems = urlComponents.queryItems
var link: URL = URL(string: "https://")!
if let entryLink = item.link,
let url = URL(string: entryLink) {
link = url
}
var iconImage = UIImage(systemName: "document") ?? UIImage()
var imageCircle: Bool = false
var imageColorized: Bool = false
var imageSystem: Bool = false
var imageColor: UIColor?
if (pathComponents.last as? NSString)?.pathExtension.lowercased() == "svg" {
imageTemplate = true
}
if let item = queryItems?.filter({ $0.name == "fileId" }).first?.value {
iconFileName = item
} else if pathComponents.contains("avatar") {
iconFileName = pathComponents[pathComponents.count - 2]
imageAvatar = true
} else if pathComponents.contains("getCalendarDotSvg") {
imageColorized = true
} else {
iconFileName = ((path.lastPathComponent) as NSString).deletingPathExtension
}
}
// Color
if imageColorized, let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {
let path = (urlComponents.path as NSString)
let colorString = ((path.lastPathComponent) as NSString).deletingPathExtension
imageColor = UIColor(hex: colorString)
icon = utility.loadImage(named: "circle.fill")
} else if let fileName = iconFileName {
let fileNamePath: String = utilityFileSystem.createServerUrl(serverUrl: utilityFileSystem.directoryUserData, fileName: fileName + ".png")
if FileManager().fileExists(atPath: fileNamePath), let image = UIImage(contentsOfFile: fileNamePath) {
icon = image
} else {
let (_, _, error) = await NextcloudKit.shared.downloadPreviewAsync(url: url, account: activeTableAccount.account)
if error == .success,
let data = responseData?.data,
let image = convertDataToImage(data: data, size: NCGlobal.shared.size256, fileNameToWrite: fileName) {
icon = image
}
}
}
if let iconUrl = item.iconUrl, let url = URL(string: iconUrl) {
if let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {
let path = (urlComponents.path as NSString)
let pathComponents = path.components(separatedBy: "/")
if pathComponents.contains("avatar") {
imageCircle = true
} else if pathComponents.contains("getCalendarDotSvg") {
imageColorized = true
}
}
// Color
if imageColorized, let urlComponents = URLComponents(url: url, resolvingAgainstBaseURL: false) {
let path = (urlComponents.path as NSString)
let colorString = ((path.lastPathComponent) as NSString).deletingPathExtension
imageColor = UIColor(hex: colorString)
iconImage = UIImage(systemName: "circle.fill") ?? UIImage()
} else {
let results = await NextcloudKit.shared.downloadPreviewAsync(url: url, account: activeTableAccount.account)
if results.error == .success,
let data = results.responseData?.data {
if let image = UIImage(data: data) {
iconImage = image
} else {
imageSystem = true
}
/* NO MEMORY
else if let image = try? await NCSVGRenderer().renderSVGToUIImage(svgData: data) {
iconImage = image
}
*/
}
let data = DashboardData(id: counter, title: title, subTitle: subtitle, link: link, icon: icon, template: imageTemplate, avatar: imageAvatar, imageColor: imageColor)
datas.append(data)
if datas.count == dashboardItems { break }
}
}
let data = DashboardData(id: counter, title: title, subTitle: subtitle, link: link, icon: iconImage, circle: imageCircle, imageSystem: imageSystem, imageColor: imageColor)
datas.append(data)
if datas.count == dashboardItems { break }
}
}
var buttons = tableButton
if numberItems == datas.count, let tableButton = tableButton, tableButton.contains(where: { $0.type == "more"}) {
buttons = tableButton.filter(({ $0.type != "more" }))
}
let alias = (activeTableAccount.alias.isEmpty) ? "" : (" (" + activeTableAccount.alias + ")")
let footerText = "Dashboard " + NSLocalizedString("_of_", comment: "") + " " + activeTableAccount.displayName + alias
if error != .success {
completion(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: tableDashboard, buttons: buttons, isPlaceholder: true, isEmpty: false, titleImage: titleImage, title: title, footerImage: "xmark.icloud", footerText: error.errorDescription, account: account))
} else {
completion(DashboardDataEntry(date: Date(), datas: datas, dashboard: tableDashboard, buttons: buttons, isPlaceholder: false, isEmpty: datas.isEmpty, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: footerText, account: account))
}
}
}
var buttons = tableButton
if numberItems == datas.count, let tableButton = tableButton, tableButton.contains(where: { $0.type == "more"}) {
buttons = tableButton.filter(({ $0.type != "more" }))
}
let alias = (activeTableAccount.alias.isEmpty) ? "" : (" (" + activeTableAccount.alias + ")")
let footerText = "Dashboard " + NSLocalizedString("_of_", comment: "") + " " + activeTableAccount.displayName + alias
if resultsDashboardWidget.error != .success {
return(DashboardDataEntry(date: Date(), datas: datasPlaceholder, dashboard: tableDashboard, buttons: buttons, isPlaceholder: true, isEmpty: false, titleImage: titleImage, title: title, footerImage: "xmark.icloud", footerText: resultsDashboardWidget.error.errorDescription, account: activeTableAccount.account))
} else {
return(DashboardDataEntry(date: Date(), datas: datas, dashboard: tableDashboard, buttons: buttons, isPlaceholder: false, isEmpty: datas.isEmpty, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: footerText, account: activeTableAccount.account))
}
}
+8 -25
View File
@@ -1,25 +1,6 @@
//
// DashboardWidgetProvider.swift
// Widget
//
// Created by Marino Faggiana on 25/08/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import UIKit
import WidgetKit
@@ -34,18 +15,20 @@ struct DashboardWidgetProvider: IntentTimelineProvider {
let dashboardItems = getDashboardItems(displaySize: context.displaySize, withButton: false)
let datasPlaceholder = Array(dashboardDatasTest[0...dashboardItems])
let title = "Dashboard"
let titleImage = UIImage(named: "widget")!
let titleImage = UIImage(systemName: "circle.fill") ?? UIImage()
return Entry(date: Date(), datas: datasPlaceholder, dashboard: nil, buttons: nil, isPlaceholder: true, isEmpty: false, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget", account: "")
}
func getSnapshot(for configuration: DashboardIntent, in context: Context, completion: @escaping (DashboardDataEntry) -> Void) {
getDashboardDataEntry(configuration: configuration, isPreview: false, displaySize: context.displaySize) { entry in
Task {
let entry = await getDashboardDataEntry(configuration: configuration, isPreview: false, displaySize: context.displaySize)
completion(entry)
}
}
func getTimeline(for configuration: DashboardIntent, in context: Context, completion: @escaping (Timeline<DashboardDataEntry>) -> Void) {
getDashboardDataEntry(configuration: configuration, isPreview: context.isPreview, displaySize: context.displaySize) { entry in
Task {
let entry = await getDashboardDataEntry(configuration: configuration, isPreview: context.isPreview, displaySize: context.displaySize)
let timeLine = Timeline(entries: [entry], policy: .atEnd)
completion(timeLine)
}
+16 -58
View File
@@ -1,25 +1,6 @@
//
// DashboardWidgetView.swift
// Widget
//
// Created by Marino Faggiana on 20/08/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
import WidgetKit
@@ -61,21 +42,13 @@ struct DashboardWidgetView: View {
}
.frame(width: geo.size.width - 20)
.padding([.top, .leading, .trailing], 10)
if !entry.isEmpty {
VStack(alignment: .leading) {
VStack(spacing: 0) {
ForEach(entry.datas, id: \.id) { element in
Link(destination: element.link) {
HStack {
let subTitleColor = Color(white: 0.5)
if entry.isPlaceholder {
Circle()
.fill(Color(.systemGray4))
@@ -84,30 +57,17 @@ struct DashboardWidgetView: View {
Image(uiImage: element.icon)
.renderingMode(.template)
.resizable()
.frame(width: 20, height: 20)
.frame(width: 35, height: 35)
.foregroundColor(Color(color))
} else if element.template {
if entry.dashboard?.itemIconsRound ?? false {
Image(uiImage: element.icon)
.renderingMode(.template)
.resizable()
.scaledToFill()
.frame(width: 20, height: 20)
.foregroundColor(.white)
.padding(8)
.background(Color(.systemGray4))
.clipShape(Circle())
} else {
Image(uiImage: element.icon)
.renderingMode(.template)
.resizable()
.scaledToFill()
.frame(width: 25, height: 25)
.clipped()
.cornerRadius(5)
}
.scaleEffect(0.8)
} else if element.imageSystem {
Image(uiImage: element.icon)
.resizable()
.scaledToFit()
.frame(width: 35, height: 35)
.scaleEffect(0.8)
} else {
if entry.dashboard?.itemIconsRound ?? false || element.avatar {
if entry.dashboard?.itemIconsRound ?? false || element.circle {
Image(uiImage: element.icon)
.resizable()
.scaledToFill()
@@ -150,7 +110,6 @@ struct DashboardWidgetView: View {
}
if let buttons = entry.buttons, !buttons.isEmpty, !entry.isPlaceholder {
HStack(spacing: 10) {
let brandColor = Color(NCBrandColor.shared.getElement(account: entry.account))
let brandTextColor = Color(NCBrandColor.shared.getText(account: entry.account))
@@ -172,7 +131,6 @@ struct DashboardWidgetView: View {
}
HStack {
Image(systemName: entry.footerImage)
.resizable()
.scaledToFit()
@@ -186,10 +144,10 @@ struct DashboardWidgetView: View {
.foregroundColor(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getElement(account: entry.account)))
}
.padding(.horizontal, 15.0)
.frame(maxWidth: geo.size.width, maxHeight: geo.size.height - 2, alignment: .bottomTrailing)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
}
}
.widgetBackground(Color(UIColor.systemBackground))
.containerBackground(.background, for: .widget)
}
}
@@ -197,8 +155,8 @@ struct DashboardWidget_Previews: PreviewProvider {
static var previews: some View {
let datas = Array(dashboardDatasTest[0...4])
let title = "Dashboard"
let titleImage = UIImage(named: "widget")!
let entry = DashboardDataEntry(date: Date(), datas: datas, dashboard: nil, buttons: nil, isPlaceholder: false, isEmpty: true, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: "Nextcloud widget", account: "")
let titleImage = UIImage(systemName: "circle.fill")!
let entry = DashboardDataEntry(date: Date(), datas: datas, dashboard: nil, buttons: nil, isPlaceholder: false, isEmpty: false, titleImage: titleImage, title: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " widget", account: "")
DashboardWidgetView(entry: entry).previewContext(WidgetPreviewContext(family: .systemLarge))
}
}
+79 -109
View File
@@ -1,25 +1,6 @@
//
// FilesData.swift
// Widget
//
// Created by Marino Faggiana on 25/08/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import UIKit
import WidgetKit
@@ -49,16 +30,16 @@ struct FilesData: Identifiable, Hashable {
}
let filesDatasTest: [FilesData] = [
.init(id: "0", image: UIImage(named: "widget")!, title: "title1", subTitle: "subTitle-description1", url: URL(string: "https://nextcloud.com/")!),
.init(id: "1", image: UIImage(named: "widget")!, title: "title2", subTitle: "subTitle-description2", url: URL(string: "https://nextcloud.com/")!),
.init(id: "2", image: UIImage(named: "widget")!, title: "title3", subTitle: "subTitle-description3", url: URL(string: "https://nextcloud.com/")!),
.init(id: "3", image: UIImage(named: "widget")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "4", image: UIImage(named: "widget")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "5", image: UIImage(named: "widget")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "6", image: UIImage(named: "widget")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "7", image: UIImage(named: "widget")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "8", image: UIImage(named: "widget")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "9", image: UIImage(named: "widget")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!)
.init(id: "0", image: UIImage(systemName: "circle.fill")!, title: "title1", subTitle: "subTitle-description1", url: URL(string: "https://nextcloud.com/")!),
.init(id: "1", image: UIImage(systemName: "circle.fill")!, title: "title2", subTitle: "subTitle-description2", url: URL(string: "https://nextcloud.com/")!),
.init(id: "2", image: UIImage(systemName: "circle.fill")!, title: "title3", subTitle: "subTitle-description3", url: URL(string: "https://nextcloud.com/")!),
.init(id: "3", image: UIImage(systemName: "circle.fill")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "4", image: UIImage(systemName: "circle.fill")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "5", image: UIImage(systemName: "circle.fill")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "6", image: UIImage(systemName: "circle.fill")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "7", image: UIImage(systemName: "circle.fill")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "8", image: UIImage(systemName: "circle.fill")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!),
.init(id: "9", image: UIImage(systemName: "circle.fill")!, title: "title4", subTitle: "subTitle-description4", url: URL(string: "https://nextcloud.com/")!)
]
func getTitleFilesWidget(tableAccount: tableAccount?) -> String {
@@ -80,27 +61,22 @@ func getTitleFilesWidget(tableAccount: tableAccount?) -> String {
}
}
func getFilesItems(displaySize: CGSize) -> Int {
let items = Int((displaySize.height - 90) / 55)
return items
}
func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySize: CGSize, completion: @escaping (_ entry: FilesDataEntry) -> Void) {
func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySize: CGSize) async -> FilesDataEntry {
let utilityFileSystem = NCUtilityFileSystem()
let utility = NCUtility()
let filesItems = getFilesItems(displaySize: displaySize)
let datasPlaceholder = Array(filesDatasTest[0...filesItems - 1])
let maxItems = 5
let datasPlaceholder = Array(filesDatasTest[0...maxItems - 1])
var activeTableAccount: tableAccount?
let versionApp = NCUtility().getVersionMaintenance()
if let groupDefaults = UserDefaults(suiteName: NCBrandOptions.shared.capabilitiesGroup),
let lastVersion = groupDefaults.string(forKey: NCGlobal.shared.udLastVersion),
lastVersion != versionApp {
return completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: "", url: "", account: "", tile: getTitleFilesWidget(tableAccount: nil), footerImage: "checkmark.icloud", footerText: NSLocalizedString("_version_mismatch_error_", comment: "")))
return (FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: "", url: "", account: "", tile: getTitleFilesWidget(tableAccount: nil), footerImage: "checkmark.icloud", footerText: NSLocalizedString("_version_mismatch_error_", comment: "")))
}
if isPreview {
return completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: "", url: "", account: "", tile: getTitleFilesWidget(tableAccount: nil), footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " files"))
return (FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: "", url: "", account: "", tile: getTitleFilesWidget(tableAccount: nil), footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " files"))
}
let accountIdentifier: String = configuration?.accounts?.identifier ?? "active"
@@ -111,18 +87,15 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
}
guard let activeTableAccount else {
return completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: "", url: "", account: "", tile: getTitleFilesWidget(tableAccount: nil), footerImage: "xmark.icloud", footerText: NSLocalizedString("_no_active_account_", value: "No account found", comment: "")))
return (FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: "", url: "", account: "", tile: getTitleFilesWidget(tableAccount: nil), footerImage: "xmark.icloud", footerText: NSLocalizedString("_no_active_account_", value: "No account found", comment: "")))
}
// NETWORKING
let password = NCPreferences().getPassword(account: activeTableAccount.account)
NextcloudKit.shared.setup(groupIdentifier: NCBrandOptions.shared.capabilitiesGroup, delegate: NCNetworking.shared)
NextcloudKit.shared.appendSession(account: activeTableAccount.account,
urlBase: activeTableAccount.urlBase,
user: activeTableAccount.user,
userId: activeTableAccount.userId,
password: password,
password: NCPreferences().getPassword(account: activeTableAccount.account),
userAgent: userAgent,
httpMaximumConnectionsPerHost: NCBrandOptions.shared.httpMaximumConnectionsPerHost,
httpMaximumConnectionsPerHostInDownload: NCBrandOptions.shared.httpMaximumConnectionsPerHostInDownload,
@@ -189,82 +162,79 @@ func getFilesDataEntry(configuration: AccountIntent?, isPreview: Bool, displaySi
// LOG
let versionNextcloudiOS = String(format: NCBrandOptions.shared.textCopyrightNextcloudiOS, utility.getVersionBuild())
NextcloudKit.configureLogger(logLevel: (NCBrandOptions.shared.disable_log ? .disabled : NCPreferences().log))
nkLog(debug: "Start \(NCBrandOptions.shared.brand) widget session " + versionNextcloudiOS)
let options = NKRequestOptions(timeout: 30, queue: NextcloudKit.shared.nkCommonInstance.backgroundQueue)
NextcloudKit.shared.searchBodyRequest(serverUrl: activeTableAccount.urlBase, requestBody: requestBody, showHiddenFiles: showHiddenFiles, account: activeTableAccount.account, options: options) { _, files, data, error in
Task {
var datas: [FilesData] = []
let title = getTitleFilesWidget(tableAccount: activeTableAccount)
let files = files?.sorted(by: { ($0.date as Date) > ($1.date as Date) }) ?? []
let results = await NextcloudKit.shared.searchBodyRequestAsync(serverUrl: activeTableAccount.urlBase, requestBody: requestBody, showHiddenFiles: showHiddenFiles, account: activeTableAccount.account, options: options)
for file in files {
var useTypeIconFile = false
var image: UIImage?
var datas: [FilesData] = []
let title = getTitleFilesWidget(tableAccount: activeTableAccount)
let files = results.files?.sorted(by: { ($0.date as Date) > ($1.date as Date) }) ?? []
if file.directory || (!file.livePhotoFile.isEmpty && file.classFile == NKTypeClassFile.video.rawValue) {
continue
}
for file in files {
var useTypeIconFile = false
var image: UIImage?
// SUBTITLE
let subTitle = utility.getRelativeDateTitle(file.date as Date) + " · " + utilityFileSystem.transformedSize(file.size)
if file.directory || (!file.livePhotoFile.isEmpty && file.classFile == NKTypeClassFile.video.rawValue) {
continue
}
// URL: nextcloud://open-file?path=Talk/IMG_0000123.jpg&user=marinofaggiana&link=https://cloud.nextcloud.com/f/123
guard var path = utilityFileSystem.getPath(path: file.path, user: file.user, fileName: file.fileName).urlEncoded else { continue }
if path.first == "/" { path = String(path.dropFirst())}
guard let user = file.user.urlEncoded else { continue }
let link = file.urlBase + "/f/" + file.fileId
let urlString = "nextcloud://open-file?path=\(path)&user=\(user)&link=\(link)"
guard let url = URL(string: urlString) else { continue }
// SUBTITLE
let subTitle = utility.getRelativeDateTitle(file.date as Date) + " · " + utilityFileSystem.transformedSize(file.size)
// IMAGE
// URL: nextcloud://open-file?path=Talk/IMG_0000123.jpg&user=marinofaggiana&link=https://cloud.nextcloud.com/f/123
guard var path = utilityFileSystem.getPath(path: file.path, user: file.user, fileName: file.fileName).urlEncoded else { continue }
if path.first == "/" { path = String(path.dropFirst())}
let link = file.urlBase + "/f/" + file.fileId
let urlString = "nextcloud://open-file?path=\(path)&user=\(file.userId)&link=\(link)&account=\(file.account)"
guard let url = URL(string: urlString) else { continue }
// IMAGE
image = utility.getImage(ocId: file.ocId,
etag: file.etag,
ext: NCGlobal.shared.previewExt512,
userId: activeTableAccount.userId,
urlBase: activeTableAccount.urlBase)
if image == nil, file.hasPreview {
let result = await NextcloudKit.shared.downloadPreviewAsync(fileId: file.fileId,
etag: file.etag,
account: activeTableAccount.account,
options: options)
if result.error == .success, let data = result.responseData?.data {
utility.createImageFileFrom(data: data,
ocId: file.ocId,
etag: file.etag,
userId: activeTableAccount.userId,
urlBase: activeTableAccount.urlBase)
image = utility.getImage(ocId: file.ocId,
etag: file.etag,
ext: NCGlobal.shared.previewExt512,
ext: NCGlobal.shared.previewExt256,
userId: activeTableAccount.userId,
urlBase: activeTableAccount.urlBase)
if image == nil, file.hasPreview {
let result = await NextcloudKit.shared.downloadPreviewAsync(fileId: file.fileId,
etag: file.etag,
account: activeTableAccount.account,
options: options)
if result.error == .success, let data = result.responseData?.data {
utility.createImageFileFrom(data: data,
ocId: file.ocId,
etag: file.etag,
userId: activeTableAccount.userId,
urlBase: activeTableAccount.urlBase)
image = utility.getImage(ocId: file.ocId,
etag: file.etag,
ext: NCGlobal.shared.previewExt256,
userId: activeTableAccount.userId,
urlBase: activeTableAccount.urlBase)
}
}
if image == nil {
image = utility.loadImage(named: file.iconName, useTypeIconFile: true, account: file.account)
useTypeIconFile = true
}
let metadata = await NCManageDatabase.shared.convertFileToMetadataAsync(file)
// DATA
let data = FilesData(id: metadata.ocId, image: image ?? UIImage(), title: metadata.fileNameView, subTitle: subTitle, url: url, useTypeIconFile: useTypeIconFile)
datas.append(data)
if datas.count == filesItems { break}
}
let alias = (activeTableAccount.alias.isEmpty) ? "" : (" (" + activeTableAccount.alias + ")")
let footerText = "Files " + NSLocalizedString("_of_", comment: "") + " " + activeTableAccount.displayName + alias
if error != .success {
completion(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: activeTableAccount.userId, url: activeTableAccount.urlBase, account: activeTableAccount.account, tile: title, footerImage: "xmark.icloud", footerText: error.errorDescription))
} else {
completion(FilesDataEntry(date: Date(), datas: datas, isPlaceholder: false, isEmpty: datas.isEmpty, userId: activeTableAccount.userId, url: activeTableAccount.urlBase, account: activeTableAccount.account, tile: title, footerImage: "checkmark.icloud", footerText: footerText))
}
}
if image == nil {
image = utility.loadImage(named: file.iconName, useTypeIconFile: true, account: file.account)
useTypeIconFile = true
}
let metadata = await NCManageDatabaseCreateMetadata().convertFileToMetadataAsync(file)
// DATA
let data = FilesData(id: metadata.ocId, image: image ?? UIImage(), title: metadata.fileNameView, subTitle: subTitle, url: url, useTypeIconFile: useTypeIconFile)
datas.append(data)
if datas.count == maxItems {
break
}
}
let alias = (activeTableAccount.alias.isEmpty) ? "" : (" (" + activeTableAccount.alias + ")")
let footerText = "Files " + NSLocalizedString("_of_", comment: "") + " " + activeTableAccount.displayName + alias
if results.error != .success {
return(FilesDataEntry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: activeTableAccount.userId, url: activeTableAccount.urlBase, account: activeTableAccount.account, tile: title, footerImage: "xmark.icloud", footerText: results.error.errorDescription))
} else {
return(FilesDataEntry(date: Date(), datas: datas, isPlaceholder: false, isEmpty: datas.isEmpty, userId: activeTableAccount.userId, url: activeTableAccount.urlBase, account: activeTableAccount.account, tile: title, footerImage: "checkmark.icloud", footerText: footerText))
}
}
+8 -26
View File
@@ -1,25 +1,6 @@
//
// FilesWidgetProvider.swift
// Widget
//
// Created by Marino Faggiana on 25/08/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import UIKit
import WidgetKit
@@ -31,20 +12,21 @@ struct FilesWidgetProvider: IntentTimelineProvider {
typealias Intent = AccountIntent
func placeholder(in context: Context) -> Entry {
let filesItems = getFilesItems(displaySize: context.displaySize)
let datasPlaceholder = Array(filesDatasTest[0...filesItems - 1])
let datasPlaceholder = Array(filesDatasTest[0...4])
let title = getTitleFilesWidget(tableAccount: nil)
return Entry(date: Date(), datas: datasPlaceholder, isPlaceholder: true, isEmpty: false, userId: "", url: "", account: "", tile: title, footerImage: "checkmark.icloud", footerText: NCBrandOptions.shared.brand + " files")
}
func getSnapshot(for configuration: AccountIntent, in context: Context, completion: @escaping (Entry) -> Void) {
getFilesDataEntry(configuration: configuration, isPreview: false, displaySize: context.displaySize) { entry in
Task {
let entry = await getFilesDataEntry(configuration: configuration, isPreview: false, displaySize: context.displaySize)
completion(entry)
}
}
func getTimeline(for configuration: AccountIntent, in context: Context, completion: @escaping (Timeline<Entry>) -> Void) {
getFilesDataEntry(configuration: configuration, isPreview: context.isPreview, displaySize: context.displaySize) { entry in
Task {
let entry = await getFilesDataEntry(configuration: configuration, isPreview: context.isPreview, displaySize: context.displaySize)
let timeLine = Timeline(entries: [entry], policy: .atEnd)
completion(timeLine)
}
+85 -73
View File
@@ -1,35 +1,13 @@
//
// FilesWidgetView.swift
// Widget
//
// Created by Marino Faggiana on 25/08/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
import WidgetKit
struct FilesWidgetView: View {
var entry: FilesDataEntry
var body: some View {
let parameterLink = "&user=\(entry.userId)&url=\(entry.url)"
let linkNoAction: URL = URL(string: NCGlobal.shared.widgetActionNoAction + parameterLink) != nil ? URL(string: NCGlobal.shared.widgetActionNoAction + parameterLink)! : URL(string: NCGlobal.shared.widgetActionNoAction)!
let linkActionUploadAsset: URL = URL(string: NCGlobal.shared.widgetActionUploadAsset + parameterLink) != nil ? URL(string: NCGlobal.shared.widgetActionUploadAsset + parameterLink)! : URL(string: NCGlobal.shared.widgetActionUploadAsset)!
@@ -55,7 +33,6 @@ struct FilesWidgetView: View {
}
ZStack(alignment: .topLeading) {
HStack {
Text(entry.tile)
.font(.system(size: 12))
@@ -72,39 +49,41 @@ struct FilesWidgetView: View {
VStack(spacing: 0) {
ForEach(entry.datas, id: \.id) { element in
Link(destination: element.url) {
HStack {
if element.useTypeIconFile {
Image(uiImage: element.image)
.resizable()
.renderingMode(.template)
.foregroundColor(Color(NCBrandColor.shared.iconImageColor2))
.scaledToFit()
.frame(width: 35, height: 35)
} else {
Image(uiImage: element.image)
.resizable()
.scaledToFill()
.frame(width: 35, height: 35)
.clipped()
.cornerRadius(5)
HStack(spacing: 10) {
Group {
if element.useTypeIconFile {
Image(uiImage: element.image)
.resizable()
.renderingMode(.template)
.foregroundColor(Color(NCBrandColor.shared.iconImageColor2))
.scaledToFit()
.frame(width: 35, height: 35)
} else {
Image(uiImage: element.image)
.resizable()
.frame(width: 35, height: 35)
.background(Color(.secondarySystemBackground))
.clipShape(RoundedRectangle(cornerRadius: 5, style: .continuous))
}
}
VStack(alignment: .leading, spacing: 2) {
Text(element.title)
.font(.system(size: 12))
.fontWeight(.regular)
FilesWidgetBidiFilename(filename: element.title)
.lineLimit(1)
Text(element.subTitle)
.font(.system(size: CGFloat(10)))
.font(.system(size: 10))
.foregroundColor(Color(NCBrandColor.shared.iconImageColor2))
.lineLimit(1)
.truncationMode(.tail)
}
Spacer()
Spacer(minLength: 0)
}
.padding(.leading, 10)
.frame(height: 50)
.padding(.horizontal, 10)
.frame(height: 44)
}
if element != entry.datas.last {
Divider()
.padding(.leading, 54)
.padding(.leading, 52)
}
}
}
@@ -113,59 +92,67 @@ struct FilesWidgetView: View {
.redacted(reason: entry.isPlaceholder ? .placeholder : [])
}
HStack(spacing: 0) {
let sizeButton: CGFloat = 40
HStack(spacing: 10) {
let buttonSize: CGFloat = 40
Link(destination: entry.isPlaceholder ? linkNoAction : linkActionUploadAsset, label: {
Link(destination: entry.isPlaceholder ? linkNoAction : linkActionUploadAsset) {
Image(systemName: "photo.badge.plus")
.resizable()
.renderingMode(.template)
.scaledToFit()
.foregroundColor(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getText(account: entry.account)))
.frame(width: 18, height: 18)
.padding(11)
.background(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getElement(account: entry.account)))
.clipShape(Circle())
.scaledToFit()
.frame(width: geo.size.width / 4, height: sizeButton)
})
.frame(width: buttonSize, height: buttonSize)
}
.frame(maxWidth: .infinity)
Link(destination: entry.isPlaceholder ? linkNoAction : linkActionScanDocument, label: {
Link(destination: entry.isPlaceholder ? linkNoAction : linkActionScanDocument) {
Image(systemName: "doc.text.viewfinder")
.resizable()
.renderingMode(.template)
.scaledToFit()
.foregroundColor(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getText(account: entry.account)))
.frame(width: 18, height: 18)
.padding(11)
.background(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getElement(account: entry.account)))
.clipShape(Circle())
.scaledToFit()
.font(Font.system(.body).weight(.light))
.frame(width: geo.size.width / 4, height: sizeButton)
})
.frame(width: buttonSize, height: buttonSize)
}
.frame(maxWidth: .infinity)
Link(destination: entry.isPlaceholder ? linkNoAction : linkActionTextDocument, label: {
Link(destination: entry.isPlaceholder ? linkNoAction : linkActionTextDocument) {
Image("note.text")
.resizable()
.renderingMode(.template)
.scaledToFit()
.foregroundColor(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getText(account: entry.account)))
.frame(width: 18, height: 18)
.padding(11)
.background(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getElement(account: entry.account)))
.clipShape(Circle())
.scaledToFit()
.frame(width: geo.size.width / 4, height: sizeButton)
})
.frame(width: buttonSize, height: buttonSize)
}
.frame(maxWidth: .infinity)
Link(destination: entry.isPlaceholder ? linkNoAction : linkActionVoiceMemo, label: {
Link(destination: entry.isPlaceholder ? linkNoAction : linkActionVoiceMemo) {
Image("microphone")
.resizable()
.renderingMode(.template)
.scaledToFit()
.foregroundColor(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getText(account: entry.account)))
.frame(width: 18, height: 18)
.padding(11)
.background(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getElement(account: entry.account)))
.clipShape(Circle())
.scaledToFit()
.frame(width: geo.size.width / 4, height: sizeButton)
})
.frame(width: buttonSize, height: buttonSize)
}
.frame(maxWidth: .infinity)
}
.frame(width: geo.size.width, height: geo.size.height - 22, alignment: .bottomTrailing)
.padding(.horizontal, 10)
.frame(maxWidth: .infinity, maxHeight: geo.size.height - 25, alignment: .bottom)
.redacted(reason: entry.isPlaceholder ? .placeholder : [])
HStack {
@@ -181,18 +168,43 @@ struct FilesWidgetView: View {
.lineLimit(1)
.foregroundColor(entry.isPlaceholder ? Color(.systemGray4) : Color(NCBrandColor.shared.getElement(account: entry.account)))
}
.padding(.horizontal, 15.0)
.frame(maxWidth: geo.size.width, maxHeight: geo.size.height - 2, alignment: .bottomTrailing)
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .bottom)
}
}
.containerBackground(.background, for: .widget)
}
}
private struct FilesWidgetBidiFilename: View {
let filename: String
var body: some View {
let nsName = filename as NSString
let ext = nsName.pathExtension
let base = nsName.deletingPathExtension
if ext.isEmpty || base.isEmpty {
Text(filename)
.font(.system(size: 12))
} else {
HStack(spacing: 0) {
Text(base)
.font(.system(size: 12))
.lineLimit(1)
.truncationMode(.middle)
Text("." + ext)
.font(.system(size: 12))
.lineLimit(1)
.fixedSize(horizontal: true, vertical: false)
}
}
.widgetBackground(Color(UIColor.systemBackground))
}
}
struct FilesWidget_Previews: PreviewProvider {
static var previews: some View {
let datas = Array(filesDatasTest[0...4])
let entry = FilesDataEntry(date: Date(), datas: datas, isPlaceholder: false, isEmpty: true, userId: "", url: "", account: "", tile: "Good afternoon, Marino Faggiana", footerImage: "checkmark.icloud", footerText: "Nextcloud files")
let entry = FilesDataEntry(date: Date(), datas: datas, isPlaceholder: false, isEmpty: false, userId: "", url: "", account: "", tile: "Good afternoon, Marino Faggiana", footerImage: "checkmark.icloud", footerText: "Nextcloud files")
FilesWidgetView(entry: entry).previewContext(WidgetPreviewContext(family: .systemLarge))
}
}
+3 -22
View File
@@ -1,25 +1,6 @@
//
// LockscreenData.swift
// Widget
//
// Created by Marino Faggiana on 13/10/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import UIKit
import WidgetKit
@@ -1,25 +1,6 @@
//
// LockscreenWidgetProvider.swift
// Widget
//
// Created by Marino Faggiana on 13/10/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import UIKit
import WidgetKit
+7 -29
View File
@@ -1,31 +1,11 @@
//
// LockscreenWidgetView.swift
// Widget
//
// Created by Marino Faggiana on 13/10/22.
// Copyright © 2022 Marino Faggiana. All rights reserved.
//
// Author Marino Faggiana <marino.faggiana@nextcloud.com>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// SPDX-FileCopyrightText: Nextcloud GmbH
// SPDX-FileCopyrightText: 2022 Marino Faggiana
// SPDX-License-Identifier: GPL-3.0-or-later
import SwiftUI
import WidgetKit
struct LockscreenWidgetView: View {
let entry: LockscreenData
@Environment(\.widgetFamily) private var family
@@ -42,7 +22,7 @@ struct LockscreenWidgetView: View {
}
)
.gaugeStyle(.accessoryCircularCapacity)
.widgetBackground(Color.clear)
.containerBackground(.clear, for: .widget)
} else {
Gauge(
value: entry.quotaRelative,
@@ -56,21 +36,19 @@ struct LockscreenWidgetView: View {
)
.gaugeStyle(.accessoryCircular)
.redacted(reason: entry.isPlaceholder ? .placeholder : [])
.widgetBackground(Color.clear)
.containerBackground(.clear, for: .widget)
}
case .accessoryRectangular:
VStack(alignment: .leading, spacing: 1) {
HStack(spacing: 1) {
Image("activity")
Image(systemName: "bolt.fill")
.renderingMode(.template)
.resizable()
.scaledToFill()
.foregroundColor(Color(NCBrandColor.shared.textColor2))
.frame(width: 11, height: 11)
Text(NSLocalizedString("_recent_activity_", comment: ""))
.font(.system(size: 11))
.fontWeight(.heavy)
.foregroundColor(Color(NCBrandColor.shared.textColor2))
}
if entry.error {
VStack(spacing: 1) {
@@ -85,7 +63,7 @@ struct LockscreenWidgetView: View {
}
.widgetURL(entry.link)
.redacted(reason: entry.isPlaceholder ? .placeholder : [])
.widgetBackground(Color.clear)
.containerBackground(.clear, for: .widget)
default:
Text("Not implemented")
}
Loaded 100 of 752 files, more files were not shown because too many files have changed in this diff. Show more