Merge branch 'develop' into 0815-fixes

This commit is contained in:
Mohamad Tarbin
2026-08-17 01:03:29 -04:00
committed by GitHub
196 changed files with 1742 additions and 847 deletions

View File

@@ -9,18 +9,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm i
- name: Build
run: npm run build
env:
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
POSTHOG_PROJECT_ID: ${{ secrets.POSTHOG_PROJECT_ID }}
POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
- run: npm run lint:ci
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Install dependencies
run: npm i
- run: npm run build
- run: npm run lint:ci

View File

@@ -12,15 +12,16 @@ Builds and (optionally) uploads signed Android and iOS release artifacts from th
Common flags on `release.sh`:
| Flag | Effect |
|---|---|
| `--android` / `--ios` | Build only one platform |
| `--bump minor\|major` | Bump type (default: `patch`) |
| `--skip-bump` | Build with the current version, don't bump |
| `--upload` | Upload after building |
| `--track TRACK` | Play Store track for `--upload` (default: `internal`) |
| Flag | Effect |
| --------------------- | ----------------------------------------------------- |
| `--android` / `--ios` | Build only one platform |
| `--bump minor\|major` | Bump type (default: `patch`) |
| `--skip-bump` | Build with the current version, don't bump |
| `--upload` | Upload after building |
| `--track TRACK` | Play Store track for `--upload` (default: `internal`) |
Outputs:
- Android: `android/app/build/outputs/bundle/release/app-release.aab`
- iOS: `build/ios/Donetick.ipa`
@@ -36,15 +37,15 @@ Outputs:
All secrets live in Vaultwarden (`https://www.bitwarden.com`) as Secure Notes, named exactly as below:
| Vault item name | Written to | Encoding |
|---|---|---|
| Donetick Google Services Android | `android/app/google-services.json` | raw |
| Donetick Android Keystore | `android/app/release/donetick.jks` | base64 |
| Donetick Keystore Password | (used inline for `android/keystore.properties`) | raw |
| Donetick Google Play Service Account | `android/play-service-account.json` | raw |
| Donetick Google Services iOS | `ios/App/App/GoogleService-Info.plist` | raw |
| Donetick App Store Connect Key | `ios/AuthKey_84F695CDQ3.p8` | base64 |
| Donetick Env Production | `.env.production` | raw |
| Vault item name | Written to | Encoding |
| ------------------------------------ | ----------------------------------------------- | -------- |
| Donetick Google Services Android | `android/app/google-services.json` | raw |
| Donetick Android Keystore | `android/app/release/donetick.jks` | base64 |
| Donetick Keystore Password | (used inline for `android/keystore.properties`) | raw |
| Donetick Google Play Service Account | `android/play-service-account.json` | raw |
| Donetick Google Services iOS | `ios/App/App/GoogleService-Info.plist` | raw |
| Donetick App Store Connect Key | `ios/AuthKey_84F695CDQ3.p8` | base64 |
| Donetick Env Production | `.env.production` | raw |
None of these files are committed to git — all covered by `.gitignore`.
@@ -57,6 +58,7 @@ The App target uses **manual signing for Release**, not Automatic. This was a de
- `fastlane/Fastfile`'s `ios release` lane passes explicit `export_options: { signingStyle: "manual", provisioningProfiles: {...} }` to `build_app` — do **not** switch this back to `-allowProvisioningUpdates`/automatic without a good reason, it re-triggers the ambiguous cert selection.
**If you ever add/change an entitlement** (new Capability in Signing & Capabilities, e.g. a new permission), the existing provisioning profile becomes stale and exports will fail with an error like `"App.app" requires a provisioning profile with the X feature`. Fix:
1. developer.apple.com → Identifiers → `com.donetick.app` → confirm the new capability is checked
2. developer.apple.com → Profiles → find `Donetick App Store(fastline)` → regenerate it → download
3. Install it locally: get its UUID (`security cms -D -i <file>.mobileprovision | plutil -extract UUID xml1 -o - -`) and copy to `~/Library/MobileDevice/Provisioning Profiles/<uuid>.mobileprovision`

View File

@@ -21,17 +21,13 @@
{
"minApi": 28,
"maxApi": 30,
"baselineProfiles": [
"baselineProfiles/1/app-release.dm"
]
"baselineProfiles": ["baselineProfiles/1/app-release.dm"]
},
{
"minApi": 31,
"maxApi": 2147483647,
"baselineProfiles": [
"baselineProfiles/0/app-release.dm"
]
"baselineProfiles": ["baselineProfiles/0/app-release.dm"]
}
],
"minSdkVersionForDexing": 28
}
}

View File

@@ -1 +1 @@
{"version":1,"sessions":{}}
{ "version": 1, "sessions": {} }

View File

@@ -1,7 +1,7 @@
# Crowdin configuration for Donetick
# See: https://support.crowdin.com/configuration-file/
project_id: "donetick"
project_id: 'donetick'
api_token_env: CROWDIN_API_TOKEN
preserve_hierarchy: true

View File

@@ -6,7 +6,9 @@ const browser = await chromium.launch()
const context = await browser.newContext({ storageState: state })
const page = await context.newPage()
page.on('console', msg => console.log('[console]', msg.type(), msg.text()))
page.on('pageerror', err => console.log('[pageerror]', err.message, '\n', err.stack))
page.on('pageerror', err =>
console.log('[pageerror]', err.message, '\n', err.stack),
)
await page.goto('http://localhost:5173/chores/create')
await page.getByTestId('chore-name-input').fill('Debug Chore ' + Date.now())

View File

@@ -1,4 +1,4 @@
import { test as base, expect } from '@playwright/test'
import { expect, test as base } from '@playwright/test'
import path from 'path'
import { fileURLToPath } from 'url'
@@ -9,7 +9,10 @@ const __dirname = path.dirname(fileURLToPath(import.meta.url))
* After successful signup the app auto-logs in and walks through the
* onboarding flow (/circle-setup, then /ready) before landing on /chores.
*/
export async function signUpViaUI(page, { username, email, password, displayName }) {
export async function signUpViaUI(
page,
{ displayName, email, password, username },
) {
await page.goto('/signup')
await page.locator('#username').fill(username)
await page.locator('#email').fill(email)
@@ -30,7 +33,7 @@ export async function signUpViaUI(page, { username, email, password, displayName
* Fill and submit the login form through the UI.
* After successful login the app redirects to /chores.
*/
export async function loginViaUI(page, { username, password }) {
export async function loginViaUI(page, { password, username }) {
await page.goto('/login')
await page.locator('#username').fill(username)
await page.locator('#password').fill(password)
@@ -43,12 +46,12 @@ export async function loginViaUI(page, { username, password }) {
* shared E2E user (via persisted storage state, no UI interaction required).
*/
export const test = base.extend({
authenticatedPage: async ({ browser }, use) => {
authenticatedPage: async ({ browser }, callback) => {
const ctx = await browser.newContext({
storageState: path.join(__dirname, '..', '.auth', 'state.json'),
})
const page = await ctx.newPage()
await use(page)
await callback(page)
await ctx.close()
},
})

View File

@@ -1,4 +1,4 @@
import { writeFile, mkdir } from 'fs/promises'
import { mkdir, writeFile } from 'fs/promises'
import path from 'path'
import { fileURLToPath } from 'url'
@@ -56,7 +56,7 @@ export default async function globalSetup() {
throw new Error(`Login failed (${loginRes.status}): ${body}`)
}
const { token, expire } = await loginRes.json()
const { expire, token } = await loginRes.json()
// Write a Playwright storage-state file containing the token in localStorage
const stateDir = path.join(__dirname, '.auth')
@@ -84,7 +84,11 @@ export default async function globalSetup() {
async function waitForServer(url, retries = 20, delayMs = 1000) {
for (let i = 0; i < retries; i++) {
try {
const res = await fetch(`${url}/api/v1/auth/login`, { method: 'POST', body: '{}', headers: { 'Content-Type': 'application/json' } })
const res = await fetch(`${url}/api/v1/auth/login`, {
method: 'POST',
body: '{}',
headers: { 'Content-Type': 'application/json' },
})
if (res.status < 500) return
} catch {
// server not up yet

View File

@@ -1,12 +1,14 @@
import { test, expect } from '@playwright/test'
import { signUpViaUI, loginViaUI } from '../fixtures/auth.js'
import { expect, test } from '@playwright/test'
import { loginViaUI, signUpViaUI } from '../fixtures/auth.js'
// Username must match /^[a-z.-]+$/ — no digits allowed.
// Generate a random lowercase-only suffix for uniqueness across runs.
function randomSuffix(len = 8) {
const chars = 'abcdefghijklmnopqrstuvwxyz'
return Array.from({ length: len }, () =>
chars[Math.floor(Math.random() * 26)],
return Array.from(
{ length: len },
() => chars[Math.floor(Math.random() * 26)],
).join('')
}
@@ -41,7 +43,9 @@ test.describe('Auth Sign Up', () => {
test.describe('Auth Login', () => {
// Re-use the shared E2E user that global-setup already created
test('logs in with valid credentials and lands on /chores', async ({ page }) => {
test('logs in with valid credentials and lands on /chores', async ({
page,
}) => {
await loginViaUI(page, {
username: 'e2e.user',
password: 'E2ePassword123!',

View File

@@ -56,6 +56,15 @@ export default [
globals: globals.node,
},
},
{
files: ['e2e/**/*.{js,mjs}'],
languageOptions: {
globals: {
...globals.node,
...globals.browser,
},
},
},
{
files: ['*.config.{mjs,ts}'],
languageOptions: {

View File

@@ -31,8 +31,7 @@ Build a signed, App Store-ready .ipa
Upload the built .ipa to TestFlight
----
---
## Android
@@ -60,7 +59,7 @@ Build a signed release .apk (for sideloading/testing)
Upload the built .aab to the Play Store (internal testing track by default)
----
---
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

View File

@@ -4,4 +4,4 @@
"capacitor": {}
},
"type": "custom"
}
}

View File

@@ -11,4 +11,4 @@
"author": "xcode",
"version": 1
}
}
}

View File

@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"info": {
"version": 1,
"author": "xcode"
}
}
}

View File

@@ -53,4 +53,4 @@
"version": 1,
"author": "xcode"
}
}
}

558
package-lock.json generated
View File

@@ -107,6 +107,7 @@
"eslint-plugin-sort-destructure-keys": "^3.0.0",
"eslint-plugin-tailwindcss": "^3.18.3",
"husky": "^8.0.3",
"lint-staged": "^16.4.0",
"patch-package": "^8.0.1",
"postcss": "^8.4.32",
"prettier": "^3.8.3",
@@ -6335,6 +6336,22 @@
"url": "https://github.com/sponsors/epoberezkin"
}
},
"node_modules/ansi-escapes": {
"version": "7.3.0",
"resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.3.0.tgz",
"integrity": "sha512-BvU8nYgGQBxcmMuEeUEmNTvrMVjJNSH7RgW24vXexN4Ven6qCvy4TntnvlnwnMLTVlcRQQdbRY8NKnaIoeWDNg==",
"dev": true,
"license": "MIT",
"dependencies": {
"environment": "^1.0.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/ansi-regex": {
"version": "5.0.1",
"license": "MIT",
@@ -7142,6 +7159,22 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cli-cursor": {
"version": "5.0.0",
"resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
"integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
"dev": true,
"license": "MIT",
"dependencies": {
"restore-cursor": "^5.0.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cli-progress": {
"version": "3.12.0",
"resolved": "https://registry.npmjs.org/cli-progress/-/cli-progress-3.12.0.tgz",
@@ -7155,6 +7188,115 @@
"node": ">=4"
}
},
"node_modules/cli-truncate": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-5.2.0.tgz",
"integrity": "sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==",
"dev": true,
"license": "MIT",
"dependencies": {
"slice-ansi": "^8.0.0",
"string-width": "^8.2.0"
},
"engines": {
"node": ">=20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cli-truncate/node_modules/ansi-regex": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/cli-truncate/node_modules/ansi-styles": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/cli-truncate/node_modules/is-fullwidth-code-point": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz",
"integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"get-east-asian-width": "^1.3.1"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cli-truncate/node_modules/slice-ansi": {
"version": "8.0.0",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-8.0.0.tgz",
"integrity": "sha512-stxByr12oeeOyY2BlviTNQlYV5xOj47GirPr4yA1hE9JCtxfQN0+tVbkxwCtYDQWhEKWFHsEK48ORg5jrouCAg==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^6.2.3",
"is-fullwidth-code-point": "^5.1.0"
},
"engines": {
"node": ">=20"
},
"funding": {
"url": "https://github.com/chalk/slice-ansi?sponsor=1"
}
},
"node_modules/cli-truncate/node_modules/string-width": {
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.2.tgz",
"integrity": "sha512-GaPUh5gfdrYzqeVNZvUfT23vYYxXzKYidUcnMtJg/3rxRV63EFZy3k6xfKlmfeJD0176lnUV/Usr3XcwSvFzpg==",
"dev": true,
"license": "MIT",
"dependencies": {
"get-east-asian-width": "^1.5.0",
"strip-ansi": "^7.1.2"
},
"engines": {
"node": ">=20"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cli-truncate/node_modules/strip-ansi": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
"integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^6.2.2"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/cliui": {
"version": "8.0.1",
"dev": true,
@@ -8167,6 +8309,19 @@
"node": ">=6"
}
},
"node_modules/environment": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/environment/-/environment-1.1.0.tgz",
"integrity": "sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/error-ex": {
"version": "1.3.2",
"license": "MIT",
@@ -9235,6 +9390,19 @@
"node": "6.* || 8.* || >= 10.*"
}
},
"node_modules/get-east-asian-width": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz",
"integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/get-intrinsic": {
"version": "1.3.0",
"license": "MIT",
@@ -10711,6 +10879,172 @@
"version": "1.2.4",
"license": "MIT"
},
"node_modules/lint-staged": {
"version": "16.4.0",
"resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-16.4.0.tgz",
"integrity": "sha512-lBWt8hujh/Cjysw5GYVmZpFHXDCgZzhrOm8vbcUdobADZNOK/bRshr2kM3DfgrrtR1DQhfupW9gnIXOfiFi+bw==",
"dev": true,
"license": "MIT",
"dependencies": {
"commander": "^14.0.3",
"listr2": "^9.0.5",
"picomatch": "^4.0.3",
"string-argv": "^0.3.2",
"tinyexec": "^1.0.4",
"yaml": "^2.8.2"
},
"bin": {
"lint-staged": "bin/lint-staged.js"
},
"engines": {
"node": ">=20.17"
},
"funding": {
"url": "https://opencollective.com/lint-staged"
}
},
"node_modules/lint-staged/node_modules/commander": {
"version": "14.0.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
"integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=20"
}
},
"node_modules/lint-staged/node_modules/picomatch": {
"version": "4.0.5",
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz",
"integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/jonschlinkert"
}
},
"node_modules/lint-staged/node_modules/yaml": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz",
"integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==",
"dev": true,
"license": "ISC",
"bin": {
"yaml": "bin.mjs"
},
"engines": {
"node": ">= 14.6"
},
"funding": {
"url": "https://github.com/sponsors/eemeli"
}
},
"node_modules/listr2": {
"version": "9.0.5",
"resolved": "https://registry.npmjs.org/listr2/-/listr2-9.0.5.tgz",
"integrity": "sha512-ME4Fb83LgEgwNw96RKNvKV4VTLuXfoKudAmm2lP8Kk87KaMK0/Xrx/aAkMWmT8mDb+3MlFDspfbCs7adjRxA2g==",
"dev": true,
"license": "MIT",
"dependencies": {
"cli-truncate": "^5.0.0",
"colorette": "^2.0.20",
"eventemitter3": "^5.0.1",
"log-update": "^6.1.0",
"rfdc": "^1.4.1",
"wrap-ansi": "^9.0.0"
},
"engines": {
"node": ">=20.0.0"
}
},
"node_modules/listr2/node_modules/ansi-regex": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/listr2/node_modules/ansi-styles": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/listr2/node_modules/emoji-regex": {
"version": "10.6.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
"integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
"dev": true,
"license": "MIT"
},
"node_modules/listr2/node_modules/string-width": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
"integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^10.3.0",
"get-east-asian-width": "^1.0.0",
"strip-ansi": "^7.1.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/listr2/node_modules/strip-ansi": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
"integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^6.2.2"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/listr2/node_modules/wrap-ansi": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",
"integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^6.2.1",
"string-width": "^7.0.0",
"strip-ansi": "^7.1.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/load-json-file": {
"version": "4.0.0",
"dev": true,
@@ -10823,6 +11157,144 @@
"version": "4.1.1",
"license": "MIT"
},
"node_modules/log-update": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz",
"integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-escapes": "^7.0.0",
"cli-cursor": "^5.0.0",
"slice-ansi": "^7.1.0",
"strip-ansi": "^7.1.0",
"wrap-ansi": "^9.0.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/log-update/node_modules/ansi-regex": {
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-regex?sponsor=1"
}
},
"node_modules/log-update/node_modules/ansi-styles": {
"version": "6.2.3",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz",
"integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/ansi-styles?sponsor=1"
}
},
"node_modules/log-update/node_modules/emoji-regex": {
"version": "10.6.0",
"resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.6.0.tgz",
"integrity": "sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==",
"dev": true,
"license": "MIT"
},
"node_modules/log-update/node_modules/is-fullwidth-code-point": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.1.0.tgz",
"integrity": "sha512-5XHYaSyiqADb4RnZ1Bdad6cPp8Toise4TzEjcOYDHZkTCbKgiUl7WTUCpNWHuxmDt91wnsZBc9xinNzopv3JMQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"get-east-asian-width": "^1.3.1"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/log-update/node_modules/slice-ansi": {
"version": "7.1.2",
"resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.2.tgz",
"integrity": "sha512-iOBWFgUX7caIZiuutICxVgX1SdxwAVFFKwt1EvMYYec/NWO5meOJ6K5uQxhrYBdQJne4KxiqZc+KptFOWFSI9w==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^6.2.1",
"is-fullwidth-code-point": "^5.0.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/chalk/slice-ansi?sponsor=1"
}
},
"node_modules/log-update/node_modules/string-width": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
"integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^10.3.0",
"get-east-asian-width": "^1.0.0",
"strip-ansi": "^7.1.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/log-update/node_modules/strip-ansi": {
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
"integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^6.2.2"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/chalk/strip-ansi?sponsor=1"
}
},
"node_modules/log-update/node_modules/wrap-ansi": {
"version": "9.0.2",
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.2.tgz",
"integrity": "sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^6.2.1",
"string-width": "^7.0.0",
"strip-ansi": "^7.1.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/loose-envify": {
"version": "1.4.0",
"license": "MIT",
@@ -11080,6 +11552,19 @@
"node": ">=8"
}
},
"node_modules/mimic-function": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
"integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/mimic-response": {
"version": "3.1.0",
"devOptional": true,
@@ -11594,6 +12079,22 @@
"wrappy": "1"
}
},
"node_modules/onetime": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
"integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"mimic-function": "^5.0.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/open": {
"version": "8.4.2",
"dev": true,
@@ -13442,6 +13943,36 @@
"node": ">=4"
}
},
"node_modules/restore-cursor": {
"version": "5.1.0",
"resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
"integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
"dev": true,
"license": "MIT",
"dependencies": {
"onetime": "^7.0.0",
"signal-exit": "^4.1.0"
},
"engines": {
"node": ">=18"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/restore-cursor/node_modules/signal-exit": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
"dev": true,
"license": "ISC",
"engines": {
"node": ">=14"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
},
"node_modules/reusify": {
"version": "1.1.0",
"license": "MIT",
@@ -13450,6 +13981,13 @@
"node": ">=0.10.0"
}
},
"node_modules/rfdc": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz",
"integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==",
"dev": true,
"license": "MIT"
},
"node_modules/rimraf": {
"version": "6.0.1",
"dev": true,
@@ -14051,6 +14589,16 @@
"safe-buffer": "~5.1.0"
}
},
"node_modules/string-argv": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz",
"integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.6.19"
}
},
"node_modules/string-width": {
"version": "4.2.3",
"license": "MIT",
@@ -14798,6 +15346,16 @@
"version": "1.3.3",
"license": "MIT"
},
"node_modules/tinyexec": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz",
"integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=18"
}
},
"node_modules/tinyglobby": {
"version": "0.2.16",
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz",

View File

@@ -21,7 +21,7 @@
"build-selfhosted": "rm -rf package-lock.json && npm install && npm install --force @rollup/rollup-linux-x64-gnu@4.34.9 @swc/core-linux-x64-gnu && vite build --mode selfhosted",
"build-win": "del package-lock.json && npm install && npm install --force @rollup/rollup-win32-x64-msvc @swc/core-win32-x64-msvc && vite build --mode selfhosted",
"lint": "eslint && prettier -c .",
"lint:ci": "true # TODO: eslint -f gha && prettier -c .",
"lint:ci": "eslint -f gha && prettier -c .",
"lint:fix": "eslint --fix && prettier -w .",
"preview": "vite preview",
"setup-m1": "rm -rf node_modules package-lock.json && npm install && npm install --force @rollup/rollup-darwin-arm64 @swc/core-darwin-arm64",
@@ -139,6 +139,7 @@
"eslint-plugin-sort-destructure-keys": "^3.0.0",
"eslint-plugin-tailwindcss": "^3.18.3",
"husky": "^8.0.3",
"lint-staged": "^16.4.0",
"patch-package": "^8.0.1",
"postcss": "^8.4.32",
"prettier": "^3.8.3",

View File

@@ -8,4 +8,4 @@
}
]
}
}
}

View File

@@ -492,4 +492,3 @@
}
}
}

View File

@@ -72,4 +72,4 @@
"delete": "删除会话"
}
}
}
}

View File

@@ -14,6 +14,7 @@ import Select from '@mui/joy/Select'
import Typography from '@mui/joy/Typography'
import { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { NOTIFICATION_TYPE, TASK_COLOR } from '../utils/Colors'
import { TIME_UNITS } from '../utils/DurationUtils'
@@ -26,7 +27,7 @@ const timingOptions = [
]
function getRelativeLabel(notification, t) {
const { value, unit } = notification
const { unit, value } = notification
const numericValue = Number(value)
if (numericValue === 0) {
return t('notifTemplate.onDueDate')
@@ -71,8 +72,8 @@ const NotificationTemplate = ({
// Consumers that own an empty state themselves pass 0.
minNotifications = 1,
onChange,
value,
showTimeline = true,
value,
}) => {
const { t } = useTranslation('chores')
const [notifications, setNotifications] = useState(

View File

@@ -1,13 +1,14 @@
import { Circle, SignalWifi4Bar, SignalWifiOff } from '@mui/icons-material'
import { Box, Chip, Tooltip, Typography } from '@mui/joy'
import { useSSEContext } from '../hooks/useSSEContext'
const SSEConnectionStatus = ({
variant = 'minimal',
showError = false,
sx = {},
variant = 'minimal',
}) => {
const { isConnected, isConnecting, error, getConnectionStatus } =
const { error, getConnectionStatus, isConnected, isConnecting } =
useSSEContext()
const getStatusColor = () => {

View File

@@ -9,22 +9,23 @@ import {
Switch,
Typography,
} from '@mui/joy'
import { useTranslation } from 'react-i18next'
import { useSSEContext } from '../hooks/useSSEContext'
import { useUserProfile } from '../queries/UserQueries'
import { isPlusAccount } from '../utils/Helpers'
import SSEConnectionStatus from './SSEConnectionStatus'
import { useTranslation } from 'react-i18next'
const SSESettings = () => {
const { t } = useTranslation('settings')
const { data: userProfile } = useUserProfile()
const {
isConnected,
isConnecting,
error,
getConnectionStatus,
toggleSSEEnabled,
isConnected,
isConnecting,
isSSEEnabled,
toggleSSEEnabled,
} = useSSEContext()
const handleToggle = () => {

View File

@@ -1,13 +1,14 @@
import { Check, Star } from '@mui/icons-material'
import { Box, Card, Chip, Divider, Radio, Typography } from '@mui/joy'
import { useState } from 'react'
import AppModal from './common/AppModal'
import ModalActions from './common/ModalActions'
import { useNotification } from '../service/NotificationProvider'
import { GetSubscriptionSession } from '../utils/Fetcher'
import { useTranslation } from 'react-i18next'
const SubscriptionModal = ({ open, onClose }) => {
import { useNotification } from '../service/NotificationProvider'
import { GetSubscriptionSession } from '../utils/Fetcher'
import AppModal from './common/AppModal'
import ModalActions from './common/ModalActions'
const SubscriptionModal = ({ onClose, open }) => {
const { t } = useTranslation('settings')
const [selectedPlan, setSelectedPlan] = useState('yearly')
const [isLoading, setIsLoading] = useState(false)
@@ -81,7 +82,11 @@ const SubscriptionModal = ({ open, onClose }) => {
footer={
<ModalActions
stackOnMobile
secondary={{ label: t('accountSettings.cancel'), onClick: onClose, disabled: isLoading }}
secondary={{
label: t('accountSettings.cancel'),
onClick: onClose,
disabled: isLoading,
}}
primary={{
label: t('subscription.subscribe'),
onClick: handleSubscribe,

View File

@@ -27,7 +27,9 @@ import {
import { useMediaQuery } from '@mui/material'
import moment from 'moment'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useNavigate } from 'react-router-dom'
import { useImpersonateUser } from '../contexts/ImpersonateUserContext'
import useStickyState from '../hooks/useStickyState'
import { useCircleMembers, useUserProfile } from '../queries/UserQueries'
@@ -35,7 +37,6 @@ import { apiClient } from '../utils/ApiClient'
import { isPlusAccount, resolvePhotoURL } from '../utils/Helpers'
import UserModal from '../views/Modals/Inputs/UserModal'
import SubscriptionModal from './SubscriptionModal'
import { useTranslation } from 'react-i18next'
const UserProfileAvatar = () => {
const { t } = useTranslation('common')
@@ -43,11 +44,11 @@ const UserProfileAvatar = () => {
const { mode, setMode } = useColorScheme()
const { data: userProfile } = useUserProfile()
const {
canImpersonate,
getEffectiveUser,
isImpersonating,
startImpersonation,
stopImpersonation,
canImpersonate,
getEffectiveUser,
} = useImpersonateUser()
const { data: circleMembersData } = useCircleMembers()
const [isModalOpen, setIsModalOpen] = useState(false)
@@ -129,7 +130,9 @@ const UserProfileAvatar = () => {
}}
/>
<Avatar
src={resolvePhotoURL(userProfile?.image || userProfile?.avatar)}
src={resolvePhotoURL(
userProfile?.image || userProfile?.avatar,
)}
alt={userProfile?.displayName || userProfile?.name}
size='sm'
sx={{

View File

@@ -1,40 +1,43 @@
import React from 'react'
import { Box } from '@mui/joy'
import { CSSTransition, TransitionGroup } from 'react-transition-group'
import { useStaggeredAnimation, useReducedMotion } from '../../hooks/useAnimations'
import './PageTransition.css'
const AnimatedList = ({
children,
staggerDelay = 50,
animationType = 'stagger', // 'stagger', 'fade', 'slide'
direction = 'up', // 'up', 'down', 'left', 'right'
renderItem,
import { Box } from '@mui/joy'
import React from 'react'
import { CSSTransition, TransitionGroup } from 'react-transition-group'
import {
useReducedMotion,
useStaggeredAnimation,
} from '../../hooks/useAnimations'
const AnimatedList = ({
animationType = 'stagger',
children,
direction = 'up', // 'stagger', 'fade', 'slide'
items, // 'up', 'down', 'left', 'right'
keyExtractor,
items,
...boxProps
renderItem,
staggerDelay = 50,
...boxProps
}) => {
// Handle both children and items patterns
let childrenArray
if (items && renderItem) {
childrenArray = items.map((item, index) =>
React.cloneElement(renderItem(item, index), {
key: keyExtractor ? keyExtractor(item, index) : index
})
childrenArray = items.map((item, index) =>
React.cloneElement(renderItem(item, index), {
key: keyExtractor ? keyExtractor(item, index) : index,
}),
)
} else {
childrenArray = React.Children.toArray(children)
}
const visibleItems = useStaggeredAnimation(childrenArray.length, staggerDelay)
const prefersReducedMotion = useReducedMotion()
// If user prefers reduced motion, render without animations
if (prefersReducedMotion) {
return (
<Box {...boxProps}>
{items && renderItem ? childrenArray : children}
</Box>
<Box {...boxProps}>{items && renderItem ? childrenArray : children}</Box>
)
}
@@ -55,7 +58,7 @@ const AnimatedList = ({
<TransitionGroup component={null}>
{childrenArray.map((child, index) => {
const isVisible = visibleItems.has(index)
return (
<CSSTransition
key={child.key || index}

View File

@@ -65,11 +65,7 @@ const LogoContainer = styled(Box)({
import { useTranslation } from 'react-i18next'
const LoadingScreen = ({
message = null,
showLogo = true,
size = 'lg',
}) => {
const LoadingScreen = ({ message = null, showLogo = true, size = 'lg' }) => {
const { t } = useTranslation('common')
return (
<LoadingContainer>
@@ -90,7 +86,7 @@ const LoadingScreen = ({
</Typography>
</LogoContainer>
)}
<CircularProgress
size={size}
sx={{
@@ -98,7 +94,7 @@ const LoadingScreen = ({
mb: 2,
}}
/>
<PulsingText level='body-md'>{message ?? t('loading')}</PulsingText>
</LoadingContent>
</LoadingContainer>

View File

@@ -1,7 +1,8 @@
import './PageTransition.css'
import { useLayoutEffect, useRef, useState } from 'react'
import { flushSync } from 'react-dom'
import { useLocation } from 'react-router-dom'
import './PageTransition.css'
// Route hierarchy for determining navigation direction
const routeHierarchy = {

View File

@@ -1,11 +1,11 @@
import { Box, Skeleton } from '@mui/joy'
const SkeletonLoader = ({
type = 'card',
count = 1,
height = 100,
width = '100%',
type = 'card',
variant = 'rectangular',
width = '100%',
...props
}) => {
const renderSkeleton = () => {

View File

@@ -1,23 +1,23 @@
import React from 'react'
import { Card } from '@mui/joy'
import { styled } from '@mui/joy/styles'
import React from 'react'
const AnimatedCard = styled(Card)(({ theme }) => ({
transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
transform: 'translateZ(0)', // Enable GPU acceleration
cursor: 'pointer',
position: 'relative',
'&:hover': {
transform: 'translateY(-4px) translateZ(0)',
boxShadow: theme.shadow.lg,
},
'&:active': {
transform: 'translateY(-2px) translateZ(0)',
transition: 'all 0.1s cubic-bezier(0.4, 0, 0.2, 1)',
},
// Subtle background animation on hover
'&::before': {
content: '""',
@@ -26,49 +26,50 @@ const AnimatedCard = styled(Card)(({ theme }) => ({
left: 0,
right: 0,
bottom: 0,
background: 'linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent)',
background:
'linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent)',
opacity: 0,
transition: 'opacity 0.3s ease',
pointerEvents: 'none',
borderRadius: 'inherit',
},
'&:hover::before': {
opacity: 1,
},
// Focus states for accessibility
'&:focus-visible': {
outline: '2px solid',
outlineColor: theme.palette.primary[500],
outlineOffset: '2px',
},
// Reduced motion support
'@media (prefers-reduced-motion: reduce)': {
transition: 'none',
transform: 'none !important',
'&:hover': {
transform: 'none',
boxShadow: theme.shadow.md, // Still provide visual feedback
},
'&:active': {
transform: 'none',
},
'&::before': {
display: 'none',
},
},
}))
const SmoothCard = ({
children,
onClick,
const SmoothCard = ({
animationDisabled = false,
...props
children,
onClick,
...props
}) => {
if (animationDisabled) {
return (

View File

@@ -1,13 +1,14 @@
import './PageTransition.css'
import { Box } from '@mui/joy'
import React, { useEffect, useState } from 'react'
import { CSSTransition, TransitionGroup } from 'react-transition-group'
import './PageTransition.css'
const StaggeredList = ({
children,
staggerDelay = 50,
initialDelay = 0,
animate = true,
children,
initialDelay = 0,
staggerDelay = 50,
}) => {
const [isVisible, setIsVisible] = useState(!animate)

View File

@@ -17,27 +17,27 @@ const WIDTH_BY_SIZE = {
const AppModal = forwardRef(
(
{
open,
onClose,
backdropBlur = true,
children,
title,
closeOnBackdrop = true,
closeOnEscape = true,
contentSx,
description,
footer,
size = 'md',
footerSx,
fullWidth = true,
isMobile: isMobileProp,
keepMounted = false,
maxHeight = '90dvh',
mobilePresentation = 'sheet',
onClose,
open,
role = 'dialog',
showCloseButton = true,
showHandle = false,
closeOnBackdrop = true,
closeOnEscape = true,
backdropBlur = true,
maxHeight = '90dvh',
contentSx,
footerSx,
size = 'md',
sx,
title,
unmountDelay = 180,
...modalProps
},

View File

@@ -1,6 +1,7 @@
import { Add, Remove } from '@mui/icons-material'
import { Box, IconButton, Input, Option, Select } from '@mui/joy'
import { useEffect, useState } from 'react'
import {
secondsToValueAndUnit,
TIME_UNITS,
@@ -16,7 +17,7 @@ import {
* size Joy UI size ('sm' | 'md')
* minValue minimum numeric value (default 1)
*/
const DurationInput = ({ value, onChange, size = 'md', minValue = 1 }) => {
const DurationInput = ({ minValue = 1, onChange, size = 'md', value }) => {
const derived =
value != null && value >= 0
? secondsToValueAndUnit(value)
@@ -26,7 +27,7 @@ const DurationInput = ({ value, onChange, size = 'md', minValue = 1 }) => {
useEffect(() => {
if (value != null && value >= 0) {
const { value: v, unit: u } = secondsToValueAndUnit(value)
const { unit: u, value: v } = secondsToValueAndUnit(value)
setDisplayValue(v)
setUnit(u)
}

View File

@@ -55,7 +55,7 @@ const SIZES = {
}
const ActionButton = ({ action, ...buttonProps }) => {
const { label, to, onClick, ...rest } = action
const { label, onClick, to, ...rest } = action
return (
<Button
{...buttonProps}
@@ -73,15 +73,15 @@ ActionButton.propTypes = {
}
const EmptyState = ({
variant = 'empty',
icon,
title,
description,
fullHeight = false,
icon,
primaryAction,
secondaryAction,
size = 'md',
fullHeight = false,
sx,
title,
variant = 'empty',
...rest
}) => {
const tone = TONES[variant] || TONES.empty

View File

@@ -10,9 +10,10 @@ import {
Typography,
} from '@mui/joy'
import { useState } from 'react'
import AppModal from './AppModal'
import ModalActions from './ModalActions'
import ActiveFilterChips from './filter/ActiveFilterChips'
import ModalActions from './ModalActions'
/**
* Reusable filter bar component.
@@ -141,17 +142,17 @@ const fmtDisplayDate = iso => {
// ── Component ────────────────────────────────────────────────────────────────
const FilterBar = ({
filterDefs,
activeFilters,
onSetFilter,
filterDefs,
onClearAll,
resultCount,
totalCount,
onOpenChange,
onSetFilter,
open,
// When the host renders its own trigger (e.g. an icon button in a toolbar
// row), it drives the sheet through `open`/`onOpenChange` and hides ours.
open,
onOpenChange,
resultCount,
showTrigger = true,
totalCount,
}) => {
const [internalOpen, setInternalOpen] = useState(false)
const isControlled = open !== undefined

View File

@@ -9,10 +9,10 @@ import PropTypes from 'prop-types'
function KeyboardShortcutHint({
shortcut,
show = true,
withCmd = true,
withCtrl, // Legacy prop for backward compatibility
withShift = false,
sx = {},
withCmd = true, // Legacy prop for backward compatibility
withCtrl,
withShift = false,
...props
}) {
if (!show) return null

View File

@@ -16,12 +16,12 @@ const ActionButton = ({ action, defaults, sx }) => {
* primary action is always the final, highest-emphasis control.
*/
const ModalActions = ({
children,
primary,
secondary,
tertiary,
children,
stackOnMobile = false,
sx,
tertiary,
}) => {
const responsiveButtonStyles = stackOnMobile
? { '& > button': { width: { xs: '100%', sm: 'auto' } } }

View File

@@ -1,6 +1,5 @@
import { Add, Close } from '@mui/icons-material'
import { Box, Button, Chip, ChipDelete, Typography } from '@mui/joy'
import { useTranslation } from 'react-i18next'
const ActiveFilterChips = ({

View File

@@ -1,5 +1,6 @@
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { useEffect, useState } from 'react'
import { initWidgetSync } from '../service/WidgetService'
const QueryContext = ({ children }) => {

View File

@@ -1,4 +1,5 @@
import { createContext, useContext } from 'react'
import { useSSE } from '../hooks/useSSE'
export const SSEContext = createContext({

View File

@@ -1,4 +1,5 @@
import { Network } from '@capacitor/network'
import { isOfflineFeatureEnabled } from '../utils/OfflineFeatureToggle'
class NetworkManager {

View File

@@ -36,4 +36,4 @@ const useAcknowledgmentModal = () => {
}
}
export default useAcknowledgmentModal
export default useAcknowledgmentModal

View File

@@ -8,7 +8,7 @@ export const useReducedMotion = () => {
const mediaQuery = window.matchMedia('(prefers-reduced-motion: reduce)')
setPrefersReducedMotion(mediaQuery.matches)
const handleChange = (event) => {
const handleChange = event => {
setPrefersReducedMotion(event.matches)
}
@@ -32,13 +32,13 @@ export const useStaggeredAnimation = (itemCount, delay = 50) => {
}
const timeouts = []
// Stagger the appearance of items
for (let i = 0; i < itemCount; i++) {
const timeout = setTimeout(() => {
setVisibleItems(prev => new Set([...prev, i]))
}, i * delay)
timeouts.push(timeout)
}
@@ -62,7 +62,7 @@ export const useInViewAnimation = (threshold = 0.1) => {
([entry]) => {
setIsInView(entry.isIntersecting)
},
{ threshold }
{ threshold },
)
observer.observe(element)

View File

@@ -1,5 +1,6 @@
import { createContext, useContext, useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { apiClient } from '../utils/ApiClient'
import { offlineDB } from '../utils/OfflineDB'
import { clearAllTokens, saveTokens } from '../utils/TokenStorage'

View File

@@ -40,4 +40,4 @@ const useConfirmationModal = () => {
}
}
export default useConfirmationModal
export default useConfirmationModal

View File

@@ -1,4 +1,5 @@
import { useEffect, useState } from 'react'
import { patchDescriptionHtml } from '../utils/ImageCache'
// Returns description HTML safe to render: embedded images with an expired

View File

@@ -10,8 +10,14 @@ import { Capacitor } from '@capacitor/core'
function normalizeScannedImage(raw) {
if (!raw) return null
if (raw.startsWith('data:')) return raw
if (raw.startsWith('http://') || raw.startsWith('https://') || raw.startsWith('content://')) return raw
if (raw.startsWith('/') || raw.startsWith('file://')) return Capacitor.convertFileSrc(raw)
if (
raw.startsWith('http://') ||
raw.startsWith('https://') ||
raw.startsWith('content://')
)
return raw
if (raw.startsWith('/') || raw.startsWith('file://'))
return Capacitor.convertFileSrc(raw)
// iOS base64 without prefix
return `data:image/jpeg;base64,${raw}`
}
@@ -25,11 +31,16 @@ function normalizeScannedImage(raw) {
export function useDocumentScanner() {
const isNativeScanner = Capacitor.isNativePlatform()
const scanDocument = async ({ maxDocuments = 1, quality = 90, letUserAdjustCrop = false } = {}) => {
const scanDocument = async ({
letUserAdjustCrop = false,
maxDocuments = 1,
quality = 90,
} = {}) => {
if (!isNativeScanner) return { image: null, cancelled: false }
try {
const { DocumentScanner } = await import('@capgo/capacitor-document-scanner')
const { DocumentScanner } =
await import('@capgo/capacitor-document-scanner')
const { scannedImages } = await DocumentScanner.scanDocument({
croppedImageQuality: quality,
maxNumDocuments: maxDocuments,

View File

@@ -1,11 +1,11 @@
import imageCompression from 'browser-image-compression'
import { useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { useUserProfile } from '../queries/UserQueries'
import { useNotification } from '../service/NotificationProvider'
import { apiClient } from '../utils/ApiClient'
import { isPlusAccount, resolvePhotoURL } from '../utils/Helpers'
import { useTranslation } from 'react-i18next'
export const useFileUpload = ({
draftId,

View File

@@ -1,4 +1,5 @@
import { useQuery } from '@tanstack/react-query'
import { commandQueue } from '../utils/CommandQueue'
// Hook to get pending commands for a specific chore (for showing pending badges/undo)

View File

@@ -1,5 +1,6 @@
import useMediaQuery from '@mui/material/useMediaQuery'
import { createElement } from 'react'
import AppModal from '../components/common/AppModal'
const MobileAppModal = props =>

View File

@@ -2,12 +2,13 @@ import { Capacitor } from '@capacitor/core'
import { useQueryClient } from '@tanstack/react-query'
import { EventSourcePolyfill } from 'event-source-polyfill'
import { useCallback, useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useUserProfile } from '../queries/UserQueries'
import { useAlerts } from '../service/AlertsProvider'
import { useNotification } from '../service/NotificationProvider'
import { apiClient } from '../utils/ApiClient'
import { useAuth } from './useAuth.jsx'
import { useTranslation } from 'react-i18next'
const SSE_STATES = {
CONNECTING: 0,

View File

@@ -1,4 +1,5 @@
import { useContext } from 'react'
import { SSEContext } from '../contexts/SSEContext'
export const useSSEContext = () => {

View File

@@ -28,7 +28,7 @@ import { useTranslation } from 'react-i18next'
function MyComponent() {
const { t } = useTranslation('settings') // or 'common', 'chores'
return <h1>{t('title')}</h1>
}
```
@@ -40,9 +40,9 @@ import { useLocalization } from '@/contexts/LocalizationContext'
function MyComponent() {
const { formatDate, formatDateTime, formatRelative } = useLocalization()
const date = new Date()
return (
<div>
<p>Date: {formatDate(date)}</p>
@@ -59,19 +59,10 @@ function MyComponent() {
import { useLocalization } from '@/contexts/LocalizationContext'
function MyComponent() {
const {
language,
setLanguage,
dateFormat,
setDateFormat,
isRTL
} = useLocalization()
return (
<div dir={isRTL ? 'rtl' : 'ltr'}>
Current language: {language}
</div>
)
const { language, setLanguage, dateFormat, setDateFormat, isRTL } =
useLocalization()
return <div dir={isRTL ? 'rtl' : 'ltr'}>Current language: {language}</div>
}
```
@@ -90,6 +81,7 @@ function MyComponent() {
## RTL Support
Languages in the `RTL_LANGUAGES` array automatically get:
- `dir="rtl"` on the document
- RTL-specific CSS styles
- Proper text alignment
@@ -99,6 +91,7 @@ Currently supported RTL languages: Arabic (ar), Hebrew (he), Persian (fa), Urdu
## Date Format Preferences
Users can choose from:
- MM/DD/YYYY (US)
- DD/MM/YYYY (Europe)
- YYYY-MM-DD (ISO)
@@ -113,5 +106,6 @@ Users can choose from:
## First Day of Week
Users can choose:
- Sunday
- Monday

View File

@@ -30,8 +30,6 @@ html {
border-radius: 4px;
}
/* Prevent iOS Safari from auto-zooming on input focus (triggered when font-size < 16px) */
@supports (-webkit-touch-callout: none) {
input,

View File

@@ -1,4 +1,5 @@
import { useMutation, useQueryClient } from '@tanstack/react-query'
import { networkManager } from '../hooks/NetworkManager'
import { CompleteSubTask, SaveChore } from '../utils/Fetcher'

View File

@@ -1,4 +1,5 @@
import { useInfiniteQuery } from '@tanstack/react-query'
import { GetThingHistory } from '../utils/Fetcher'
export const useThingHistory = (thingId, limit = 10) => {

View File

@@ -1,4 +1,5 @@
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'
import {
ClearChoreTimer,
DeleteTimeSession,
@@ -56,7 +57,7 @@ export const useUpdateTimeSession = () => {
const queryClient = useQueryClient()
return useMutation({
mutationFn: ({ choreId, sessionId, sessionData }) =>
mutationFn: ({ choreId, sessionData, sessionId }) =>
UpdateTimeSession(choreId, sessionId, sessionData),
onSuccess: (_, { choreId }) => {
queryClient.invalidateQueries(['choreTimer', choreId])

View File

@@ -22,7 +22,9 @@ export function isCacheEnabled() {
export function setCacheEnabled(enabled) {
try {
localStorage.setItem(ENABLED_KEY, String(enabled))
} catch { /* ignore */ }
} catch {
/* ignore */
}
}
export function hashContent(content) {
@@ -56,7 +58,9 @@ export function setCached(hash, value) {
index.push(hash)
localStorage.setItem(INDEX_KEY, JSON.stringify(index))
}
} catch { /* storage full, ignore */ }
} catch {
/* storage full, ignore */
}
}
export function getCacheStats() {
@@ -66,7 +70,15 @@ export function getCacheStats() {
export function clearCache() {
const index = getIndex()
index.forEach(h => {
try { localStorage.removeItem(ENTRY_PREFIX + h) } catch { /* ignore */ }
try {
localStorage.removeItem(ENTRY_PREFIX + h)
} catch {
/* ignore */
}
})
try { localStorage.removeItem(INDEX_KEY) } catch { /* ignore */ }
try {
localStorage.removeItem(INDEX_KEY)
} catch {
/* ignore */
}
}

View File

@@ -1,4 +1,5 @@
import { Capacitor } from '@capacitor/core'
import { getCached, hashContent, setCached } from './AIPromptCache'
// Native-only local AI service using @capacitor/local-llm.
@@ -74,14 +75,19 @@ class LocalAIService {
await this.warmup()
try {
const { LocalLLM } = await import('@capacitor/local-llm')
const { text: out } = await LocalLLM.prompt({ prompt: text, sessionId: this._sessionId })
const { text: out } = await LocalLLM.prompt({
prompt: text,
sessionId: this._sessionId,
})
return out?.trim() || null
} finally {
try {
const { LocalLLM } = await import('@capacitor/local-llm')
await LocalLLM.endSession({ sessionId: this._sessionId })
this._warmedUp = false
} catch { /* ignore */ }
} catch {
/* ignore */
}
}
}
@@ -99,7 +105,9 @@ class LocalAIService {
try {
const systemMsg = messages.find(m => m.role === 'system')?.content || ''
const userMsg = messages.find(m => m.role === 'user')?.content || ''
const result = await this._nativePrompt(`${systemMsg}\n\nUser: ${userMsg}\nAssistant:`)
const result = await this._nativePrompt(
`${systemMsg}\n\nUser: ${userMsg}\nAssistant:`,
)
if (result) setCached(cacheHash, result)
return result
} catch (e) {
@@ -122,7 +130,10 @@ class LocalAIService {
try {
await this.warmup()
const { LocalLLM } = await import('@capacitor/local-llm')
const { text } = await LocalLLM.prompt({ prompt, sessionId: this._sessionId })
const { text } = await LocalLLM.prompt({
prompt,
sessionId: this._sessionId,
})
const result = text?.trim() || null
if (result) setCached(cacheHash, result)
return result
@@ -133,7 +144,9 @@ class LocalAIService {
const { LocalLLM } = await import('@capacitor/local-llm')
await LocalLLM.endSession({ sessionId: this._sessionId })
this._warmedUp = false
} catch { /* ignore */ }
} catch {
/* ignore */
}
}
}
}

View File

@@ -42,7 +42,10 @@ export const decodeNdefUrl = record => {
// Starts a native NFC write session. Calls onWaiting once scanning is active,
// then onSuccess or onError when the write completes. Returns a cancel function.
export const startNativeNFCWrite = async (url, { onWaiting, onSuccess, onError }) => {
export const startNativeNFCWrite = async (
url,
{ onError, onSuccess, onWaiting },
) => {
let listener = null
let done = false
@@ -86,7 +89,7 @@ export const startNativeNFCWrite = async (url, { onWaiting, onSuccess, onError }
// Starts a native NFC scan session for reading. Calls onTag(url) when a URL
// NDEF record is found, or onError on failure. Returns a cancel function.
export const startNativeScan = async ({ onTag, onError }) => {
export const startNativeScan = async ({ onError, onTag }) => {
let listener = null
let done = false

View File

@@ -113,9 +113,8 @@ class VoiceInputService {
async isSupported() {
if (this.isNative) {
try {
const { SpeechRecognition } = await import(
'@capacitor-community/speech-recognition'
)
const { SpeechRecognition } =
await import('@capacitor-community/speech-recognition')
const { available } = await SpeechRecognition.available()
return !!available
} catch {
@@ -134,9 +133,8 @@ class VoiceInputService {
return 'granted'
}
try {
const { SpeechRecognition } = await import(
'@capacitor-community/speech-recognition'
)
const { SpeechRecognition } =
await import('@capacitor-community/speech-recognition')
const current = await SpeechRecognition.checkPermissions()
if (current.speechRecognition === 'granted') return 'granted'
const res = await SpeechRecognition.requestPermissions()
@@ -189,9 +187,8 @@ class VoiceInputService {
if (this.isNative) {
let SpeechRecognition
try {
;({ SpeechRecognition } = await import(
'@capacitor-community/speech-recognition'
))
;({ SpeechRecognition } =
await import('@capacitor-community/speech-recognition'))
await withTimeout(SpeechRecognition.stop(), NATIVE_CALL_TIMEOUT_MS)
} catch {
// recognizer may already be stopped
@@ -282,9 +279,8 @@ class VoiceInputService {
}
async _startNative() {
const { SpeechRecognition } = await import(
'@capacitor-community/speech-recognition'
)
const { SpeechRecognition } =
await import('@capacitor-community/speech-recognition')
await SpeechRecognition.removeAllListeners()
await SpeechRecognition.addListener('partialResults', ({ matches }) => {
@@ -342,9 +338,8 @@ class VoiceInputService {
}
async _doRestartNative() {
const { SpeechRecognition } = await import(
'@capacitor-community/speech-recognition'
)
const { SpeechRecognition } =
await import('@capacitor-community/speech-recognition')
try {
await withTimeout(SpeechRecognition.stop(), NATIVE_CALL_TIMEOUT_MS)
} catch {

View File

@@ -1,4 +1,5 @@
import { Capacitor, registerPlugin } from '@capacitor/core'
import { apiClient } from '../utils/ApiClient'
// Native bridge implemented in ios/App/App/WidgetBridgePlugin.swift and

View File

@@ -82,11 +82,15 @@
/* Height utilities that account for safe areas */
.min-h-screen-safe {
min-height: calc(100vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom));
min-height: calc(
100vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom)
);
}
.h-screen-safe {
height: calc(100vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom));
height: calc(
100vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom)
);
}
/* Top positioning that accounts for safe area */

View File

@@ -19,7 +19,11 @@ const allMonths = [
* @param {Object} chore - The chore object (needed for nextDueDate null check)
* @returns {string} The formatted due date text
*/
export const getDueDateChipText = (nextDueDate, chore, timeFormat = 'h:mm A') => {
export const getDueDateChipText = (
nextDueDate,
chore,
timeFormat = 'h:mm A',
) => {
if (chore?.nextDueDate === null || nextDueDate === null) return 'No Due Date'
const dueDate = moment(nextDueDate)
@@ -34,16 +38,22 @@ export const getDueDateChipText = (nextDueDate, chore, timeFormat = 'h:mm A') =>
sameElse: `MMM D ${timeFormat}`,
}
// if time is 23:59:59, treat as end-of-day (date only, no specific time)
if (dueDate.hours() === 23 && dueDate.minutes() === 59 && dueDate.seconds() === 59) {
if (
dueDate.hours() === 23 &&
dueDate.minutes() === 59 &&
dueDate.seconds() === 59
) {
if (diff < 0) {
// For overdue dates, show calendar format for recent dates
const absDiff = Math.abs(diff)
if (absDiff <= 48) {
return (
'Overdue ' +
moment(nextDueDate).calendar(null, calendarFormat).split(' ')[0].toLowerCase()
moment(nextDueDate)
.calendar(null, calendarFormat)
.split(' ')[0]
.toLowerCase()
)
}
return 'Overdue ' + dueDate.fromNow()

View File

@@ -1,4 +1,5 @@
import moment from 'moment'
import { TASK_COLOR } from './Colors.jsx'
const priorityOrder = [1, 2, 3, 4, 0]
@@ -213,7 +214,7 @@ export const ChoresGrouper = (groupBy, chores, filter) => {
}
case 'due_date': {
var { dateGroups: dueDateGroups, anytime: dueAnytime } =
var { anytime: dueAnytime, dateGroups: dueDateGroups } =
buildActualDateGroups(chores)
groups = [...dueDateGroups]
if (dueAnytime.length > 0) {

View File

@@ -1,10 +1,6 @@
import moment from 'moment'
export const createDateFormatter = (
dateFormat,
timeFormat,
firstDayOfWeek,
) => {
export const createDateFormatter = (dateFormat, timeFormat, firstDayOfWeek) => {
moment.updateLocale('en', {
week: {
dow: firstDayOfWeek,

View File

@@ -740,7 +740,7 @@ const DeleteUser = (password, confirmation, transferOptions = []) => {
const UploadChoreAttachment = (
file,
entityType,
{ entityId, draftId } = {},
{ draftId, entityId } = {},
) => {
const formData = new FormData()
formData.append('file', file)
@@ -986,11 +986,6 @@ const TrackFilterUsage = id => {
export {
AcceptCircleMemberRequest,
DeleteChoreAttachment,
DeleteDraftAttachment,
GetChoreAttachments,
SignAssetURL,
UploadChoreAttachment,
ApproveChore,
ArchiveChore,
CancelSubscription,
@@ -1010,8 +1005,10 @@ export {
CreateThing,
DeleteChildUser,
DeleteChore,
DeleteChoreAttachment,
DeleteChoreHistory,
DeleteCircleMember,
DeleteDraftAttachment,
DeleteFilter,
DeleteLabel,
DeleteLongLiveToken,
@@ -1024,6 +1021,7 @@ export {
GetAllUsers,
GetArchivedChores,
GetChildUsers,
GetChoreAttachments,
GetChoreByID,
GetChoreDetailById,
GetChoreHistory,
@@ -1069,6 +1067,7 @@ export {
SaveChore,
SaveThing,
SetupMFA,
SignAssetURL,
signUp,
SkipChore,
StartChore,
@@ -1091,5 +1090,6 @@ export {
UpdateThingState,
UpdateTimeSession,
UpdateUserDetails,
UploadChoreAttachment,
VerifyMFA,
}

View File

@@ -13,7 +13,7 @@
* @returns {boolean} - Whether the chore matches the condition
*/
export const evaluateCondition = (chore, condition, context = {}) => {
const { type, operator, value } = condition
const { operator, type, value } = condition
switch (type) {
case 'assignee':
@@ -343,7 +343,7 @@ export const getFilterOverdueCount = (chores, filter, context = {}) => {
* @returns {Object} - { isValid: boolean, issues: Array }
*/
export const validateFilter = (filter, context = {}) => {
const { members = [], labels = [], projects = [] } = context
const { labels = [], members = [], projects = [] } = context
const issues = []
if (!filter.conditions || filter.conditions.length === 0) {

View File

@@ -273,7 +273,7 @@ const patchDescriptionHtml = async (html, meta = {}) => {
const images = extractDescriptionImages(html)
if (images.length === 0) return html
let patched = html
for (const { path, src, rawSrc } of images) {
for (const { path, rawSrc, src } of images) {
try {
const nextSrc = await getImageSrc(path, src, {
kind: 'description',

View File

@@ -1,5 +1,6 @@
import { CapacitorSQLite } from '@capacitor-community/sqlite'
import { Capacitor } from '@capacitor/core'
import { CapacitorSQLite } from '@capacitor-community/sqlite'
import { isOfflineFeatureEnabled } from './OfflineFeatureToggle'
const DB_NAME = 'donetick_offline'
@@ -630,7 +631,7 @@ class IndexedDBBackend {
async saveChores(chores) {
if (!chores.length) return
const { tx, store } = await this._tx('cached_chores', 'readwrite')
const { store, tx } = await this._tx('cached_chores', 'readwrite')
for (const chore of chores) {
store.put({
@@ -670,7 +671,7 @@ class IndexedDBBackend {
async deleteChores(ids) {
if (!ids.length) return
const { tx, store } = await this._tx('cached_chores', 'readwrite')
const { store, tx } = await this._tx('cached_chores', 'readwrite')
for (const id of ids) {
store.delete(id)
}
@@ -693,7 +694,7 @@ class IndexedDBBackend {
const choreIds = [...new Set(entries.map(e => Number(e.choreId)))]
await this._deletePendingHistoryByChoreIds(choreIds)
// Upsert real entries
const { tx, store } = await this._tx('cached_history', 'readwrite')
const { store, tx } = await this._tx('cached_history', 'readwrite')
for (const entry of entries) {
store.put({
id: entry.id,
@@ -736,7 +737,7 @@ class IndexedDBBackend {
.map(row => row.id)
if (!toDelete.length) return
// Tx 2: delete them
const { tx, store: writeStore } = await this._tx(
const { store: writeStore, tx } = await this._tx(
'cached_history',
'readwrite',
)
@@ -772,7 +773,7 @@ class IndexedDBBackend {
async deleteHistory(ids) {
if (!ids.length) return
const { tx, store } = await this._tx('cached_history', 'readwrite')
const { store, tx } = await this._tx('cached_history', 'readwrite')
for (const id of ids) {
store.delete(id)
}

View File

@@ -194,7 +194,7 @@ class SyncEngine {
break
case CommandType.COMPLETE_CHORE: {
const { id, body, completedDate, performer } = cmd.payload
const { body, completedDate, id, performer } = cmd.payload
response = await MarkChoreComplete(
id,
body || {},
@@ -221,7 +221,7 @@ class SyncEngine {
break
case CommandType.UPDATE_CHORE_HISTORY: {
const { choreId, historyId, historyData } = cmd.payload
const { choreId, historyData, historyId } = cmd.payload
response = await UpdateChoreHistory(choreId, historyId, historyData)
break
}
@@ -233,7 +233,7 @@ class SyncEngine {
}
case CommandType.RESCHEDULE_CHORE: {
const { id, dueDate } = cmd.payload
const { dueDate, id } = cmd.payload
response = await UpdateDueDate(id, dueDate)
break
}

View File

@@ -5,48 +5,52 @@ export const USER_TYPES = {
CHILD: 1,
}
export const isParentUser = (user) => {
export const isParentUser = user => {
if (!user) return false
return user.userType === USER_TYPES.PARENT && !user.parentUserId
}
export const isChildUser = (user) => {
export const isChildUser = user => {
if (!user) return false
return user.userType === USER_TYPES.CHILD && user.parentUserId !== null
}
export const canManageChildUsers = (user) => {
export const canManageChildUsers = user => {
return isParentUser(user)
}
export const canCreateChores = (user) => {
export const canCreateChores = user => {
// Both parent and child users can create chores
return user && (isParentUser(user) || isChildUser(user))
}
export const canManageCircle = (user) => {
export const canManageCircle = user => {
// Only parent users can manage circle settings
return isParentUser(user)
}
export const canAccessAdminSettings = (user) => {
export const canAccessAdminSettings = user => {
// Only parent users can access admin settings like API tokens, MFA, etc.
return isParentUser(user)
}
export const getUserDisplayInfo = (user) => {
export const getUserDisplayInfo = user => {
if (!user) return { displayName: '', username: '', userType: 'unknown' }
return {
displayName: user.displayName || user.username,
username: user.username,
userType: isParentUser(user) ? 'parent' : isChildUser(user) ? 'child' : 'unknown',
userType: isParentUser(user)
? 'parent'
: isChildUser(user)
? 'child'
: 'unknown',
parentUserId: user.parentUserId,
circleID: user.circleID,
}
}
export const getChildUsernameFromCombined = (combinedUsername) => {
export const getChildUsernameFromCombined = combinedUsername => {
// Extract child name from format: parent_child
const parts = combinedUsername.split('_')
if (parts.length >= 2) {
@@ -55,7 +59,7 @@ export const getChildUsernameFromCombined = (combinedUsername) => {
return combinedUsername
}
export const getParentUsernameFromCombined = (combinedUsername) => {
export const getParentUsernameFromCombined = combinedUsername => {
// Extract parent name from format: parent_child
const parts = combinedUsername.split('_')
return parts[0] || combinedUsername
@@ -63,4 +67,4 @@ export const getParentUsernameFromCombined = (combinedUsername) => {
export const buildChildUsername = (parentUsername, childName) => {
return `${parentUsername}_${childName}`
}
}

View File

@@ -13,11 +13,12 @@ import {
} from '@mui/joy'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { authButtonSx, authInputSx } from './authStyles'
const labelSx = { fontSize: '0.875rem', fontWeight: 600, mb: 0.75 }
export const AuthField = ({ label, error, helper, children, ...formProps }) => (
export const AuthField = ({ children, error, helper, label, ...formProps }) => (
<FormControl error={Boolean(error)} {...formProps}>
<FormLabel sx={labelSx}>{label}</FormLabel>
{children}
@@ -34,16 +35,16 @@ export const AuthField = ({ label, error, helper, children, ...formProps }) => (
</FormControl>
)
export const AuthTextField = ({ label, error, helper, sx, ...inputProps }) => (
export const AuthTextField = ({ error, helper, label, sx, ...inputProps }) => (
<AuthField label={label} error={error} helper={helper} id={inputProps.id}>
<Input size='lg' sx={{ ...authInputSx, ...sx }} {...inputProps} />
</AuthField>
)
export const AuthPasswordField = ({
label,
error,
helper,
label,
sx,
...inputProps
}) => {
@@ -92,7 +93,7 @@ export const AuthSubmitButton = ({ children, sx, ...props }) => (
</Button>
)
export const SocialButton = ({ icon, children, sx, ...props }) => (
export const SocialButton = ({ children, icon, sx, ...props }) => (
<Button
type='button'
size='lg'

View File

@@ -1,5 +1,6 @@
import { Capacitor } from '@capacitor/core'
import { Box, Sheet, Typography } from '@mui/joy'
import Logo from '../../Logo'
/**
@@ -8,18 +9,18 @@ import Logo from '../../Logo'
* its own safe-area padding (the top inset is already reserved by NavBar).
*/
const AuthShell = ({
title,
subtitle,
action,
children,
footer,
logoSize = 48,
showLogo = !Capacitor.isNativePlatform(),
subtitle,
// In the app the user already came through the app icon and the Get Started
// mark, so repeating it here is noise. On the web these routes are the first
// thing a visitor sees — often on a self-hosted domain, and with no navbar —
// so the mark is the only thing identifying the app. Views reached from an
// emailed link override this to always show it.
showLogo = !Capacitor.isNativePlatform(),
title,
}) => {
return (
<Box

View File

@@ -1,16 +1,16 @@
import { Box, Button, LinearProgress } from '@mui/joy'
import { useEffect, useState } from 'react'
import { Capacitor } from '@capacitor/core'
import { Box, Button, LinearProgress } from '@mui/joy'
import Cookies from 'js-cookie'
import { useEffect, useState } from 'react'
import { useRef } from 'react'
import { useTranslation } from 'react-i18next'
import { Link, useNavigate, useParams } from 'react-router-dom'
import { useUserProfile } from '../../queries/UserQueries'
import { apiClient } from '../../utils/ApiClient'
import { endOAuthExchange } from '../../utils/OAuthExchangeState'
import { GetUserProfile } from '../../utils/Fetcher'
import { endOAuthExchange } from '../../utils/OAuthExchangeState'
import { saveTokens } from '../../utils/TokenStorage'
import { useTranslation } from 'react-i18next'
import AuthShell from './AuthShell'
import { authButtonSx } from './authStyles'
import MFAVerificationModal from './MFAVerificationModal'

View File

@@ -3,6 +3,7 @@ import { Box, Button, Link, Typography } from '@mui/joy'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useNavigate } from 'react-router-dom'
import { useNotification } from '../../service/NotificationProvider'
import { ResetPassword } from '../../utils/Fetcher'
import { AuthSubmitButton, AuthTextField, LegalLinks } from './AuthFields'

View File

@@ -4,7 +4,9 @@ import ErrorOutlineIcon from '@mui/icons-material/ErrorOutline'
import WifiIcon from '@mui/icons-material/Wifi'
import { Alert, Box, Button, CircularProgress, Typography } from '@mui/joy'
import React from 'react'
import { useTranslation } from 'react-i18next'
import { useNavigate } from 'react-router-dom'
import { API_URL } from '../../Config'
import { useResource } from '../../queries/ResourceQueries'
import { apiClient } from '../../utils/ApiClient'
@@ -12,7 +14,6 @@ import { offlineDB } from '../../utils/OfflineDB'
import { AuthSubmitButton, AuthTextField } from './AuthFields'
import AuthShell from './AuthShell'
import { authButtonSx } from './authStyles'
import { useTranslation } from 'react-i18next'
const CONNECTION_TIMEOUT_MS = 8000
@@ -106,8 +107,7 @@ const LoginSettings = () => {
) {
return {
ok: false,
message:
t('server.dnsFailed'),
message: t('server.dnsFailed'),
}
}
return {
@@ -119,16 +119,14 @@ const LoginSettings = () => {
// no-cors also timed out → server/host truly unreachable
return {
ok: false,
message:
t('server.unreachable'),
message: t('server.unreachable'),
}
}
// Fallback (should rarely hit)
return {
ok: false,
message:
t('server.unreachable'),
message: t('server.unreachable'),
}
}
}
@@ -145,9 +143,7 @@ const LoginSettings = () => {
if (!isValidURL(trimmedURL)) {
setStatus('error')
setErrorMessage(
t('server.invalidUrl'),
)
setErrorMessage(t('server.invalidUrl'))
return
}

View File

@@ -35,7 +35,7 @@ import AuthShell from './AuthShell'
import { authButtonSx } from './authStyles'
import MFAVerificationModal from './MFAVerificationModal'
const SegmentedControl = ({ value, onChange, options }) => (
const SegmentedControl = ({ onChange, options, value }) => (
<Box
role='tablist'
sx={{
@@ -582,7 +582,7 @@ const LoginView = () => {
discoveryDocs='claims_supported'
access_type='online'
isOnlyGetToken={true}
onResolve={({ provider, data }) => {
onResolve={({ data, provider }) => {
loggedWithProvider(provider, data)
}}
onReject={() => {

View File

@@ -1,18 +1,18 @@
import { Alert, Box, Input, Link, Stack, Typography } from '@mui/joy'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import ModalActions from '../../components/common/ModalActions'
import { useResponsiveModal } from '../../hooks/useResponsiveModal'
import { VerifyMFA } from '../../utils/Fetcher'
import { authInputSx } from './authStyles'
import { useTranslation } from 'react-i18next'
const MFAVerificationModal = ({
open,
onClose,
sessionToken,
onSuccess,
onError,
onSuccess,
open,
sessionToken,
}) => {
const { t } = useTranslation('auth')
const [verificationCode, setVerificationCode] = useState('')
@@ -38,8 +38,7 @@ const MFAVerificationModal = ({
onSuccess(data)
} else {
const errorData = await response.json()
const message =
errorData.message || t('mfaModal.invalidCode')
const message = errorData.message || t('mfaModal.invalidCode')
setError(message)
onError?.(message)
}
@@ -77,9 +76,7 @@ const MFAVerificationModal = ({
size='md'
title={t('mfaModal.title')}
description={
isBackupCode
? t('mfaModal.backupHint')
: t('mfaModal.codeHint')
isBackupCode ? t('mfaModal.backupHint') : t('mfaModal.codeHint')
}
closeOnBackdrop={!loading}
closeOnEscape={!loading}
@@ -112,7 +109,9 @@ const MFAVerificationModal = ({
<Input
id='mfa-code'
size='lg'
placeholder={isBackupCode ? t('mfaModal.backupPlaceholder') : '000000'}
placeholder={
isBackupCode ? t('mfaModal.backupPlaceholder') : '000000'
}
value={verificationCode}
onChange={e => setVerificationCode(e.target.value)}
onKeyDown={handleKeyDown}

View File

@@ -39,8 +39,7 @@ const SignupView = () => {
if (!result.success) {
showError({
title: 'Almost there',
message:
t('signupSignInFailed'),
message: t('signupSignInFailed'),
})
Navigate('/login')
return

View File

@@ -41,6 +41,7 @@ import { useNavigate, useParams, useSearchParams } from 'react-router-dom'
import { useImpersonateUser } from '../../contexts/ImpersonateUserContext.jsx'
import { useLocalization } from '../../contexts/LocalizationContext'
import { useDescriptionHtml } from '../../hooks/useDescriptionHtml'
import { usePendingCommands } from '../../hooks/usePendingCommands'
import {
useChoreDetails,
@@ -80,12 +81,6 @@ import {
} from '../../utils/Fetcher'
import { offlineDB } from '../../utils/OfflineDB'
import { getSafeBottomPadding } from '../../utils/SafeAreaUtils.js'
import AttachmentBrowserModal from '../Modals/Inputs/AttachmentBrowserModal'
import ConfirmationModal from '../Modals/Inputs/ConfirmationModal'
import NoteViewerModal from '../Modals/Inputs/NoteViewerModal'
import NudgeModal from '../Modals/Inputs/NudgeModal'
import SelectModal from '../Modals/Inputs/SelectModal'
import WriteNFCModal from '../Modals/Inputs/WriteNFCModal'
import ChoreActionMenu from '../components/ChoreActionMenu'
import DueDatePickerModal, {
combineDueDate,
@@ -95,9 +90,14 @@ import LoadingComponent from '../components/Loading.jsx'
import PendingBadge from '../components/PendingBadge'
import RichTextEditor from '../components/RichTextEditor.jsx'
import SubTasks from '../components/SubTask.jsx'
import AttachmentBrowserModal from '../Modals/Inputs/AttachmentBrowserModal'
import ConfirmationModal from '../Modals/Inputs/ConfirmationModal'
import NoteViewerModal from '../Modals/Inputs/NoteViewerModal'
import NudgeModal from '../Modals/Inputs/NudgeModal'
import SelectModal from '../Modals/Inputs/SelectModal'
import WriteNFCModal from '../Modals/Inputs/WriteNFCModal'
import TimePassedCard from './TimePassedCard.jsx'
import TimerSplitButton from './TimerSplitButton.jsx'
import { useDescriptionHtml } from '../../hooks/useDescriptionHtml'
const isNetworkError = err =>
err instanceof TypeError && err.message === 'Failed to fetch'
@@ -130,7 +130,7 @@ const ChoreView = () => {
const { choreId } = useParams()
const [note, setNote] = useState(null)
const queryClient = useQueryClient()
const { showSuccess, showError, showUndo } = useNotification()
const { showError, showSuccess, showUndo } = useNotification()
const [searchParams] = useSearchParams()

View File

@@ -13,8 +13,8 @@ import {
Typography,
} from '@mui/joy'
import { useEffect, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { useTranslation } from 'react-i18next'
import { useNavigate } from 'react-router-dom'
const isValidTrigger = (thing, condition, triggerState) => {
const newErrors = {}
if (!thing || !triggerState) {
@@ -49,11 +49,11 @@ const isValidTrigger = (thing, condition, triggerState) => {
}
const ThingTriggerSection = ({
things,
isAttepmtingToSave,
onTriggerUpdate,
onValidate,
selected,
isAttepmtingToSave,
things,
}) => {
const { t } = useTranslation('chores')
const [selectedThing, setSelectedThing] = useState(null)
@@ -86,9 +86,7 @@ const ThingTriggerSection = ({
return (
<Card sx={{ mt: 1 }}>
<Typography level='h5'>
{t('thing.triggerHint')}
</Typography>
<Typography level='h5'>{t('thing.triggerHint')}</Typography>
{things?.length === 0 && (
<Typography level='body-sm'>
it's look like you don't have any things yet, create a thing to

View File

@@ -8,6 +8,7 @@ import {
import { Box, Card, Chip, Typography } from '@mui/joy'
import { useEffect, useRef, useState } from 'react'
import { useNavigate } from 'react-router-dom'
import { useLocalization } from '../../contexts/LocalizationContext'
const TimePassedCard = ({ chore, handleAction, onShowDetails }) => {

View File

@@ -10,12 +10,12 @@ import { useEffect, useRef, useState } from 'react'
const TimerSplitButton = ({
chore,
onAction,
onShowDetails,
onResetTimer,
onClearAllTime,
disabled = false,
fullWidth = false,
onAction,
onClearAllTime,
onResetTimer,
onShowDetails,
}) => {
const [anchorEl, setAnchorEl] = useState(null)
const isMenuOpen = Boolean(anchorEl)

View File

@@ -27,11 +27,12 @@ import {
} from '@mui/joy'
import moment from 'moment'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useChores, useChoresHistory } from '../../queries/ChoreQueries'
import { useCircleMembers } from '../../queries/UserQueries'
import { resolvePhotoURL } from '../../utils/Helpers'
import NoteViewerModal from '../Modals/Inputs/NoteViewerModal'
import { useTranslation } from 'react-i18next'
const ActivityItem = ({ activity, members, onViewNote }) => {
const { t } = useTranslation('chores')

View File

@@ -1053,7 +1053,10 @@ const ArchivedTasks = () => {
}
primaryAction={
searchTerm
? { label: t('archived.clearSearch'), onClick: handleSearchClose }
? {
label: t('archived.clearSearch'),
onClick: handleSearchClose,
}
: { label: t('archived.clearFilters'), onClick: clearAll }
}
secondaryAction={

View File

@@ -1,11 +1,12 @@
import '@meauxt/react-swipeable-list/dist/styles.css'
import {
Type as ListType,
SwipeableList,
SwipeableListItem,
SwipeAction,
TrailingActions,
Type as ListType,
} from '@meauxt/react-swipeable-list'
import '@meauxt/react-swipeable-list/dist/styles.css'
import {
Check,
Delete,
@@ -19,6 +20,7 @@ import {
import { Box, Typography } from '@mui/joy'
import { useTranslation } from 'react-i18next'
import { useNavigate } from 'react-router-dom'
import { useLongPress } from '../../hooks/useLongPress'
import ChoreCard from './ChoreCard'
import CompactChoreCard from './CompactChoreCard'
@@ -28,16 +30,16 @@ import CompactChoreCard from './CompactChoreCard'
* can't live in the render loop because it needs a hook.
*/
const ChoreSwipeableItem = ({
trailingActions,
children,
longPressEnabled,
onClick,
onLongPress,
longPressEnabled,
children,
trailingActions,
// SwipeableList clones its children to inject list-level config
// (listType, fullSwipe, thresholds…), so it has to be passed through.
...listProps
}) => {
const { handlers: longPressHandlers, cancel: cancelLongPress } = useLongPress(
const { cancel: cancelLongPress, handlers: longPressHandlers } = useLongPress(
onLongPress,
{ enabled: longPressEnabled },
)
@@ -75,19 +77,19 @@ const ChoreSwipeableItem = ({
const ChoreListView = ({
chores,
viewMode,
membersData,
userLabels,
handleLabelFiltering,
handleChoreAction,
handleLabelFiltering,
isMultiSelectMode,
selectedChores,
toggleChoreSelection,
userProfile,
isOfficialInstance,
toggleMultiSelectMode,
membersData,
onLongPressChore,
selectedChores,
showActions = true,
toggleChoreSelection,
toggleMultiSelectMode,
userLabels,
userProfile,
viewMode,
}) => {
const navigate = useNavigate()
const { t } = useTranslation('chores')
@@ -204,7 +206,9 @@ const ChoreListView = ({
<Check sx={{ fontSize: 20 }} />
)}
<Typography level='body-xs' sx={{ mt: 0.5 }}>
{chore.status !== 1 ? t('choreView.start') : t('list.complete')}
{chore.status !== 1
? t('choreView.start')
: t('list.complete')}
</Typography>
</Box>
</SwipeAction>

View File

@@ -11,6 +11,7 @@ import {
import { Box, Checkbox, Chip, IconButton, Typography } from '@mui/joy'
import { useTranslation } from 'react-i18next'
import { useNavigate } from 'react-router-dom'
import { useImpersonateUser } from '../../contexts/ImpersonateUserContext.jsx'
import { useLocalization } from '../../contexts/LocalizationContext'
import { usePendingCommands } from '../../hooks/usePendingCommands'
@@ -30,17 +31,17 @@ import PendingBadge from '../components/PendingBadge'
const CompactChoreCard = ({
chore,
performers,
sx,
viewOnly,
showActions = true,
onChipClick,
onAction,
// Multi-select props
isMultiSelectMode = false,
isSelected = false,
onAction,
onChipClick,
onSelectionToggle,
onlyClickable = false,
// Multi-select props
performers,
showActions = true,
sx,
viewOnly,
}) => {
const navigate = useNavigate()
const { t } = useTranslation('chores')

View File

@@ -1,20 +1,21 @@
import { Button, Chip, Menu, MenuItem, Typography } from '@mui/joy'
import { useTranslation } from 'react-i18next'
import IconButton from '@mui/joy/IconButton'
import { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { getTextColorFromBackgroundColor } from '../../utils/Colors.jsx'
const IconButtonWithMenu = ({
label,
k,
icon,
options,
isActive,
k,
label,
onItemSelect,
options,
selectedItem,
setSelectedItem,
isActive,
useChips,
title,
useChips,
}) => {
const { t } = useTranslation('chores')
const [anchorEl, setAnchorEl] = useState(null)

View File

@@ -78,7 +78,7 @@ const scheduleNotificationFromTemplate = (
const now = new Date()
const time = getTimeFromTemplate(template, dueDate)
const notificationId = getIdFromTemplate(chore.id, template)
const { title, body } = getNotificationText(
const { body, title } = getNotificationText(
chore.name,
template,
dueDate,

View File

@@ -1,9 +1,10 @@
import { HelpOutline } from '@mui/icons-material'
import { Box, Card, IconButton, Typography } from '@mui/joy'
import { useState } from 'react'
import { useTranslation } from 'react-i18next'
import ModalActions from '../../components/common/ModalActions'
import { useResponsiveModal } from '../../hooks/useResponsiveModal'
import { useTranslation } from 'react-i18next'
const MultiSelectHelp = ({ isVisible = true }) => {
const { t } = useTranslation('chores')
@@ -102,7 +103,7 @@ const MultiSelectHelp = ({ isVisible = true }) => {
)
}
const ShortcutItem = ({ keys, description }) => (
const ShortcutItem = ({ description, keys }) => (
<Box
sx={{
display: 'flex',

View File

@@ -23,6 +23,7 @@ import {
import { useMediaQuery } from '@mui/material'
import { useQueryClient } from '@tanstack/react-query'
import { useEffect, useMemo, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useNavigate, useSearchParams } from 'react-router-dom'
import EmptyState from '../../components/common/EmptyState'
@@ -73,7 +74,6 @@ import {
import NotificationAccessSnackbar from './NotificationAccessSnackbar'
import Sidepanel from './Sidepanel'
import { INSIGHT_FILTER_DEFS } from './SmartInsightsCard'
import { useTranslation } from 'react-i18next'
// Mirrors the assignee options in the toolbar, phrased to drop into a
// sentence ("none of them are assigned to you").
@@ -1667,7 +1667,9 @@ const MyChores = () => {
saveFilter(filter)
showSuccess({
title: t('list.advancedFilterCreated'),
message: t('list.advancedFilterCreatedMsg', { name: filter.name }),
message: t('list.advancedFilterCreatedMsg', {
name: filter.name,
}),
})
}
setShowAdvancedFilterBuilder(false)

View File

@@ -4,6 +4,7 @@ import { Preferences } from '@capacitor/preferences'
import { Button, Snackbar, Stack, Typography } from '@mui/joy'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { registerPushNotifications } from '../../CapacitorListener'
const NotificationAccessSnackbar = () => {

View File

@@ -1,6 +1,7 @@
import { Box, Sheet } from '@mui/joy'
import { useMediaQuery } from '@mui/material'
import { useEffect, useState } from 'react'
import { useChoresHistory } from '../../queries/ChoreQueries'
import { ChoresGrouper } from '../../utils/Chores'
import { getSidepanelConfig } from '../../utils/SidepanelConfig'
@@ -11,9 +12,9 @@ import TasksByAssigneeCard from './TasksByAssigneeCard'
import UserSwitcher from './UserSwitcher'
const Sidepanel = ({
chores,
allChores,
applyTempFilter,
chores,
clearTempFilter,
tempFilter,
}) => {
@@ -22,8 +23,8 @@ const Sidepanel = ({
const [sidepanelConfig, setSidepanelConfig] = useState([])
const {
data: choresHistory,
isChoresHistoryLoading,
handleLimitChange: refetchHistory,
isChoresHistoryLoading,
} = useChoresHistory(7, true)
useEffect(() => {

View File

@@ -8,9 +8,10 @@ import {
} from '@mui/icons-material'
import { Box, Button, Chip, Sheet, Typography } from '@mui/joy'
import { useMemo } from 'react'
import { TASK_COLOR } from '../../utils/Colors'
import { useTranslation } from 'react-i18next'
import { TASK_COLOR } from '../../utils/Colors'
// Static insight filter definitions used for URL restoration
export const INSIGHT_FILTER_DEFS = {
overdue: {
@@ -58,8 +59,8 @@ export const INSIGHT_FILTER_DEFS = {
}
const SmartInsightsCard = ({
chores,
applyTempFilter,
chores,
clearTempFilter,
tempFilter,
}) => {

View File

@@ -13,21 +13,22 @@ import {
import IconButton from '@mui/joy/IconButton'
import { useEffect, useRef, useState } from 'react'
import { useTranslation } from 'react-i18next'
import KeyboardShortcutHint from '../../components/common/KeyboardShortcutHint'
const SortAndGrouping = ({
label,
k,
icon,
onItemSelect,
selectedItem,
setSelectedItem,
selectedFilter,
setFilter,
isActive,
useChips,
title,
k,
label,
onCreateNewFilter,
onItemSelect,
selectedFilter,
selectedItem,
setFilter,
setSelectedItem,
title,
useChips,
}) => {
const { t } = useTranslation('chores')
const [anchorEl, setAnchorEl] = useState(null)

View File

@@ -1,11 +1,12 @@
import { BarChart, Person } from '@mui/icons-material'
import { Avatar, Box, Sheet, Typography } from '@mui/joy'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import EmptyState from '../../components/common/EmptyState'
import { useCircleMembers } from '../../queries/UserQueries'
import { TASK_COLOR } from '../../utils/Colors'
import { resolvePhotoURL } from '../../utils/Helpers'
import { useTranslation } from 'react-i18next'
const TasksByAssigneeCard = ({ chores = [] }) => {
const { t } = useTranslation('chores')

View File

@@ -1,19 +1,19 @@
import { SupervisorAccount } from '@mui/icons-material'
import { Avatar, Box, Button, Sheet, Typography } from '@mui/joy'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import { useImpersonateUser } from '../../contexts/ImpersonateUserContext'
import { useCircleMembers, useUserProfile } from '../../queries/UserQueries'
import UserModal from '../Modals/Inputs/UserModal'
const UserSwitcher = () => {
const { t } = useTranslation('chores')
const {
impersonatedUser,
canImpersonate,
impersonatedUser,
isImpersonating,
startImpersonation,
startImpersonation,
stopImpersonation,
canImpersonate
} = useImpersonateUser()
const { data: userProfile } = useUserProfile()
const [isModalOpen, setIsModalOpen] = useState(false)
@@ -54,7 +54,9 @@ const UserSwitcher = () => {
}}
>
<SupervisorAccount color='' />
<Typography level='title-md'>{t('impersonate.viewAs')}</Typography>
<Typography level='title-md'>
{t('impersonate.viewAs')}
</Typography>
</Box>
</Box>
<Box sx={{ mb: 2 }}>

View File

@@ -1,10 +1,11 @@
import { Capacitor } from '@capacitor/core'
import { useTranslation } from 'react-i18next'
import DateModal from '../../Modals/Inputs/DateModal'
import DueDatePickerModal, {
combineDueDate,
splitDueDate,
} from '../../components/DueDatePickerModal'
import DateModal from '../../Modals/Inputs/DateModal'
import NudgeModal from '../../Modals/Inputs/NudgeModal'
import SelectModal from '../../Modals/Inputs/SelectModal'
import TextModal from '../../Modals/Inputs/TextModal'
@@ -17,14 +18,14 @@ const getNFCUrl = choreId =>
const ChoreModals = ({
activeModal,
modalChore,
membersData,
onChangeDueDate,
onCompleteWithPastDate,
modalChore,
onAssigneeChange,
onCompleteWithNote,
onNudge,
onChangeDueDate,
onClose,
onCompleteWithNote,
onCompleteWithPastDate,
onNudge,
}) => {
const { t } = useTranslation('chores')
return (

View File

@@ -47,27 +47,28 @@ import {
Typography,
} from '@mui/joy'
import { useEffect, useState } from 'react'
import { useTranslation } from 'react-i18next'
import AppModal from '../../../components/common/AppModal'
import ActiveFilterChips from '../../../components/common/filter/ActiveFilterChips'
import KeyboardShortcutHint from '../../../components/common/KeyboardShortcutHint'
import { FILTER_COLORS } from '../../../utils/Colors'
import Priorities from '../../../utils/Priorities'
import ProjectSelector from '../../components/ProjectSelector'
import CustomFilterChips from './CustomFilterChips'
import FilterBuilderContent, {
CHORE_STATUSES,
DUE_DATE_OPTIONS,
POINTS_OPERATORS,
conditionsToSelections,
defaultSelections,
DUE_DATE_OPTIONS,
POINTS_OPERATORS,
selectionsToConditions,
} from './FilterBuilderContent'
import SearchBar from './SearchBar'
import ProjectSelector from '../../components/ProjectSelector'
import CustomFilterChips from './CustomFilterChips'
import { useTranslation } from 'react-i18next'
// ─── sub-components for the Display sheet ────────────────────────────────────
const SectionHeader = ({ icon, label, badge }) => (
const SectionHeader = ({ badge, icon, label }) => (
<Box sx={{ display: 'flex', alignItems: 'center', gap: 1, mb: 1.5 }}>
{icon && (
<Box
@@ -97,7 +98,7 @@ const SectionHeader = ({ icon, label, badge }) => (
</Box>
)
const OptionChips = ({ options, selected, multi, onToggle }) => (
const OptionChips = ({ multi, onToggle, options, selected }) => (
<Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}>
{options.map(opt => {
const isSelected = multi
@@ -183,48 +184,48 @@ const OptionChips = ({ options, selected, multi, onToggle }) => (
*/
const ChoreToolbar = ({
// advanced filter
members = [],
labels = [],
projects = [],
tempFilter,
tempFilterMeta,
activeFilterId,
applyTempFilter,
clearTempFilter,
saveFilter,
updateFilter,
onFilterSaved,
// result counts
resultCount,
totalCount,
// clear all
onClearAllFilters,
// project (for Display sheet)
selectedProject,
onProjectSelect,
// assignee (for Display sheet)
selectedAssigneeFilter = 'anyone',
onAssigneeFilterChange,
// saved / custom
savedFilters = [],
activeFilterId,
onSavedFilterClick,
onSavedFilterEdit,
onSavedFilterDelete,
onSavedFilterPin,
// grouping
selectedGroupBy = 'default',
onGroupBySelect,
// view + multiselect
viewMode = 'default',
onToggleViewMode,
isMultiSelectMode,
onToggleMultiSelect,
// search
searchTerm,
labels = [],
members = [],
onAssigneeFilterChange,
onClearAllFilters,
onFilterSaved,
onGroupBySelect,
// result counts
onProjectSelect,
onSavedFilterClick,
// clear all
onSavedFilterDelete,
// project (for Display sheet)
onSavedFilterEdit,
onSavedFilterPin,
// assignee (for Display sheet)
onSearchChange,
onSearchClose,
// saved / custom
onToggleMultiSelect,
onToggleViewMode,
projects = [],
resultCount,
saveFilter,
savedFilters = [],
// grouping
searchInputRef,
searchTerm,
// view + multiselect
selectedAssigneeFilter = 'anyone',
selectedGroupBy = 'default',
selectedProject,
showKeyboardShortcuts,
// search
tempFilter,
tempFilterMeta,
totalCount,
updateFilter,
viewMode = 'default',
}) => {
const { t } = useTranslation('chores')
const [filterSheetOpen, setFilterSheetOpen] = useState(false)

Some files were not shown because too many files have changed in this diff Show More