()
| 1850 | } |
| 1851 | |
| 1852 | private func audioHistoryControls() -> some View { |
| 1853 | VStack(spacing: 12) { |
| 1854 | HStack(alignment: .center, spacing: 12) { |
| 1855 | VStack(alignment: .leading, spacing: 5) { |
| 1856 | Text("Audio Storage") |
| 1857 | .font(self.theme.typography.bodyStrong) |
| 1858 | .foregroundStyle(self.settingsTitleText) |
| 1859 | Text("Audio history: \(DictationAudioHistoryStore.formattedGigabytes(self.audioHistoryUsageBytes)) / \(Self.audioBudgetText(for: SettingsStore.shared.audioHistoryBudgetGB)) GB Budget") |
| 1860 | .font(self.theme.typography.bodySmall) |
| 1861 | .foregroundStyle(self.settingsSecondaryText) |
| 1862 | |
| 1863 | ProgressView(value: self.audioHistoryUsageFraction()) |
| 1864 | .progressViewStyle(.linear) |
| 1865 | .frame(maxWidth: 220) |
| 1866 | } |
| 1867 | |
| 1868 | Spacer(minLength: 16) |
| 1869 | |
| 1870 | HStack(spacing: 8) { |
| 1871 | Text("Budget") |
| 1872 | .font(.caption) |
| 1873 | .foregroundStyle(self.settingsSecondaryText) |
| 1874 | |
| 1875 | TextField("4", text: self.$audioHistoryBudgetText) |
| 1876 | .textFieldStyle(.roundedBorder) |
| 1877 | .frame(width: 58) |
| 1878 | |
| 1879 | Text("GB") |
| 1880 | .font(.caption) |
| 1881 | .foregroundStyle(self.settingsSecondaryText) |
| 1882 | |
| 1883 | Button("Apply") { |
| 1884 | self.applyAudioHistoryBudget() |
| 1885 | } |
| 1886 | .controlSize(.small) |
| 1887 | } |
| 1888 | } |
| 1889 | |
| 1890 | Divider().opacity(0.2) |
| 1891 | |
| 1892 | HStack(alignment: .center, spacing: 12) { |
| 1893 | VStack(alignment: .leading, spacing: 2) { |
| 1894 | Text("Export Audio") |
| 1895 | .font(self.theme.typography.bodyStrong) |
| 1896 | .foregroundStyle(self.settingsTitleText) |
| 1897 | Text("ZIP with manifest.jsonl and WAV audio.") |
| 1898 | .font(self.theme.typography.bodySmall) |
| 1899 | .foregroundStyle(self.settingsSecondaryText) |
| 1900 | } |
| 1901 | |
| 1902 | Spacer(minLength: 16) |
| 1903 | |
| 1904 | Button { |
| 1905 | self.exportAudioZip() |
| 1906 | } label: { |
| 1907 | Label("Export ZIP", systemImage: "square.and.arrow.up") |
| 1908 | } |
| 1909 | .controlSize(.small) |
no test coverage detected