Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

fix(client): work through the findings from the coverage pass

Maurice72a82b3c447f
diff --git a/.gitignore b/.gitignore
index a83917a19..fa3baa3aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -51,6 +51,7 @@ yarn-error.log*
# Coverage
coverage
+coverage-*/
*.lcov
.nyc_output
diff --git a/client/coverage-agentF/coverage-final.json b/client/coverage-agentF/coverage-final.json
deleted file mode 100644
index 62f7efc82..000000000
--- a/client/coverage-agentF/coverage-final.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{"C:\\Users\\Hospi\\.local\\bin\\trek-coverage\\client\\src\\services\\photoService.ts": {"path":"C:\\Users\\Hospi\\.local\\bin\\trek-coverage\\client\\src\\services\\photoService.ts","statementMap":{"0":{"start":{"line":9,"column":14},"end":{"line":9,"column":null}},"1":{"start":{"line":10,"column":17},"end":{"line":10,"column":null}},"2":{"start":{"line":11,"column":18},"end":{"line":11,"column":null}},"3":{"start":{"line":13,"column":23},"end":{"line":13,"column":null}},"4":{"start":{"line":17,"column":23},"end":{"line":17,"column":null}},"5":{"start":{"line":18,"column":21},"end":{"line":18,"column":null}},"6":{"start":{"line":19,"column":40},"end":{"line":19,"column":null}},"7":{"start":{"line":22,"column":2},"end":{"line":25,"column":null}},"8":{"start":{"line":23,"column":4},"end":{"line":23,"column":null}},"9":{"start":{"line":24,"column":4},"end":{"line":24,"column":null}},"10":{"start":{"line":26,"column":2},"end":{"line":26,"column":null}},"11":{"start":{"line":26,"column":32},"end":{"line":26,"column":58}},"12":{"start":{"line":30,"column":15},"end":{"line":30,"column":null}},"13":{"start":{"line":31,"column":2},"end":{"line":35,"column":null}},"14":{"start":{"line":32,"column":4},"end":{"line":32,"column":null}},"15":{"start":{"line":34,"column":4},"end":{"line":34,"column":null}},"16":{"start":{"line":39,"column":2},"end":{"line":39,"column":null}},"17":{"start":{"line":39,"column":36},"end":{"line":39,"column":45}},"18":{"start":{"line":40,"column":2},"end":{"line":40,"column":null}},"19":{"start":{"line":44,"column":2},"end":{"line":44,"column":null}},"20":{"start":{"line":44,"column":41},"end":{"line":44,"column":50}},"21":{"start":{"line":45,"column":2},"end":{"line":45,"column":null}},"22":{"start":{"line":49,"column":2},"end":{"line":49,"column":null}},"23":{"start":{"line":49,"column":27},"end":{"line":49,"column":null}},"24":{"start":{"line":50,"column":2},"end":{"line":50,"column":null}},"25":{"start":{"line":51,"column":2},"end":{"line":51,"column":null}},"26":{"start":{"line":51,"column":17},"end":{"line":51,"column":48}},"27":{"start":{"line":56,"column":2},"end":{"line":56,"column":null}},"28":{"start":{"line":56,"column":32},"end":{"line":56,"column":null}},"29":{"start":{"line":57,"column":2},"end":{"line":57,"column":null}},"30":{"start":{"line":58,"column":2},"end":{"line":58,"column":null}},"31":{"start":{"line":58,"column":17},"end":{"line":58,"column":53}},"32":{"start":{"line":62,"column":2},"end":{"line":62,"column":null}},"33":{"start":{"line":66,"column":2},"end":{"line":66,"column":null}},"34":{"start":{"line":71,"column":2},"end":{"line":92,"column":null}},"35":{"start":{"line":72,"column":16},"end":{"line":72,"column":null}},"36":{"start":{"line":73,"column":4},"end":{"line":73,"column":null}},"37":{"start":{"line":74,"column":4},"end":{"line":89,"column":null}},"38":{"start":{"line":75,"column":6},"end":{"line":88,"column":null}},"39":{"start":{"line":76,"column":23},"end":{"line":76,"column":null}},"40":{"start":{"line":77,"column":8},"end":{"line":77,"column":null}},"41":{"start":{"line":78,"column":8},"end":{"line":78,"column":null}},"42":{"start":{"line":79,"column":20},"end":{"line":79,"column":null}},"43":{"start":{"line":80,"column":18},"end":{"line":80,"column":null}},"44":{"start":{"line":81,"column":14},"end":{"line":81,"column":null}},"45":{"start":{"line":82,"column":14},"end":{"line":82,"column":null}},"46":{"start":{"line":83,"column":8},"end":{"line":83,"column":null}},"47":{"start":{"line":84,"column":8},"end":{"line":84,"column":null}},"48":{"start":{"line":85,"column":8},"end":{"line":85,"column":null}},"49":{"start":{"line":86,"column":8},"end":{"line":86,"column":null}},"50":{"start":{"line":87,"column":8},"end":{"line":87,"column":null}},"51":{"start":{"line":88,"column":16},"end":{"line":88,"column":30}},"52":{"start":{"line":90,"column":4},"end":{"line":90,"column":null}},"53":{"start":{"line":90,"column":24},"end":{"line":90,"column":null}},"54":{"start":{"line":91,"column":4},"end":{"line":91,"column":null}},"55":{"start":{"line":103,"column":17},"end":{"line":103,"column":null}},"56":{"start":{"line":104,"column":2},"end":{"line":104,"column":null}},"57":{"start":{"line":104,"column":16},"end":{"line":104,"column":36}},"58":{"start":{"line":104,"column":36},"end":{"line":104,"column":43}},"59":{"start":{"line":106,"column":2},"end":{"line":109,"column":null}},"60":{"start":{"line":107,"column":4},"end":{"line":107,"column":null}},"61":{"start":{"line":107,"column":18},"end":{"line":107,"column":null}},"62":{"start":{"line":108,"column":4},"end":{"line":108,"column":null}},"63":{"start":{"line":112,"column":2},"end":{"line":122,"column":null}},"64":{"start":{"line":113,"column":30},"end":{"line":113,"column":null}},"65":{"start":{"line":114,"column":4},"end":{"line":114,"column":null}},"66":{"start":{"line":115,"column":4},"end":{"line":115,"column":null}},"67":{"start":{"line":116,"column":4},"end":{"line":116,"column":null}},"68":{"start":{"line":118,"column":4},"end":{"line":120,"column":null}},"69":{"start":{"line":119,"column":6},"end":{"line":119,"column":null}},"70":{"start":{"line":119,"column":19},"end":{"line":119,"column":47}},"71":{"start":{"line":119,"column":47},"end":{"line":119,"column":76}},"72":{"start":{"line":121,"column":4},"end":{"line":121,"column":null}},"73":{"start":{"line":124,"column":2},"end":{"line":124,"column":null}},"74":{"start":{"line":125,"column":2},"end":{"line":157,"column":null}},"75":{"start":{"line":126,"column":4},"end":{"line":156,"column":null}},"76":{"start":{"line":128,"column":25},"end":{"line":128,"column":null}},"77":{"start":{"line":129,"column":8},"end":{"line":135,"column":null}},"78":{"start":{"line":130,"column":36},"end":{"line":130,"column":null}},"79":{"start":{"line":131,"column":10},"end":{"line":131,"column":null}},"80":{"start":{"line":132,"column":10},"end":{"line":132,"column":null}},"81":{"start":{"line":133,"column":10},"end":{"line":133,"column":null}},"82":{"start":{"line":134,"column":10},"end":{"line":134,"column":null}},"83":{"start":{"line":138,"column":34},"end":{"line":138,"column":null}},"84":{"start":{"line":139,"column":8},"end":{"line":139,"column":null}},"85":{"start":{"line":140,"column":8},"end":{"line":140,"column":null}},"86":{"start":{"line":141,"column":8},"end":{"line":141,"column":null}},"87":{"start":{"line":144,"column":22},"end":{"line":144,"column":null}},"88":{"start":{"line":145,"column":8},"end":{"line":148,"column":null}},"89":{"start":{"line":146,"column":10},"end":{"line":146,"column":null}},"90":{"start":{"line":147,"column":10},"end":{"line":147,"column":null}},"91":{"start":{"line":151,"column":34},"end":{"line":151,"column":null}},"92":{"start":{"line":152,"column":8},"end":{"line":152,"column":null}},"93":{"start":{"line":153,"column":8},"end":{"line":153,"column":null}},"94":{"start":{"line":154,"column":8},"end":{"line":154,"column":null}},"95":{"start":{"line":156,"column":23},"end":{"line":156,"column":50}},"96":{"start":{"line":156,"column":50},"end":{"line":156,"column":71}},"97":{"start":{"line":161,"column":36},"end":{"line":161,"column":null}},"98":{"start":{"line":162,"column":2},"end":{"line":164,"column":null}},"99":{"start":{"line":163,"column":4},"end":{"line":163,"column":null}},"100":{"start":{"line":163,"column":24},"end":{"line":163,"column":null}},"101":{"start":{"line":165,"column":2},"end":{"line":165,"column":null}}},"fnMap":{"0":{"name":"acquireRequestSlot","decl":{"start":{"line":21,"column":9},"end":{"line":21,"column":45}},"loc":{"start":{"line":21,"column":45},"end":{"line":27,"column":null}},"line":21},"1":{"name":"(anonymous_1)","decl":{"start":{"line":26,"column":13},"end":{"line":26,"column":21}},"loc":{"start":{"line":26,"column":32},"end":{"line":26,"column":58}},"line":26},"2":{"name":"releaseRequestSlot","decl":{"start":{"line":29,"column":9},"end":{"line":29,"column":36}},"loc":{"start":{"line":29,"column":36},"end":{"line":36,"column":null}},"line":29},"3":{"name":"notify","decl":{"start":{"line":38,"column":9},"end":{"line":38,"column":16}},"loc":{"start":{"line":38,"column":48},"end":{"line":41,"column":null}},"line":38},"4":{"name":"(anonymous_4)","decl":{"start":{"line":39,"column":22},"end":{"line":39,"column":30}},"loc":{"start":{"line":39,"column":36},"end":{"line":39,"column":45}},"line":39},"5":{"name":"notifyThumb","decl":{"start":{"line":43,"column":9},"end":{"line":43,"column":21}},"loc":{"start":{"line":43,"column":49},"end":{"line":46,"column":null}},"line":43},"6":{"name":"(anonymous_6)","decl":{"start":{"line":44,"column":27},"end":{"line":44,"column":35}},"loc":{"start":{"line":44,"column":41},"end":{"line":44,"column":50}},"line":44},"7":{"name":"onPhotoLoaded","decl":{"start":{"line":48,"column":16},"end":{"line":48,"column":30}},"loc":{"start":{"line":48,"column":88},"end":{"line":52,"column":null}},"line":48},"8":{"name":"(anonymous_8)","decl":{"start":{"line":51,"column":2},"end":{"line":51,"column":15}},"loc":{"start":{"line":51,"column":15},"end":{"line":51,"column":null}},"line":51},"9":{"name":"onThumbReady","decl":{"start":{"line":55,"column":16},"end":{"line":55,"column":29}},"loc":{"start":{"line":55,"column":83},"end":{"line":59,"column":null}},"line":55},"10":{"name":"(anonymous_10)","decl":{"start":{"line":58,"column":2},"end":{"line":58,"column":15}},"loc":{"start":{"line":58,"column":15},"end":{"line":58,"column":null}},"line":58},"11":{"name":"getCached","decl":{"start":{"line":61,"column":16},"end":{"line":61,"column":26}},"loc":{"start":{"line":61,"column":63},"end":{"line":63,"column":null}},"line":61},"12":{"name":"isLoading","decl":{"start":{"line":65,"column":16},"end":{"line":65,"column":26}},"loc":{"start":{"line":65,"column":48},"end":{"line":67,"column":null}},"line":65},"13":{"name":"urlToBase64","decl":{"start":{"line":70,"column":16},"end":{"line":70,"column":28}},"loc":{"start":{"line":70,"column":84},"end":{"line":93,"column":null}},"line":70},"14":{"name":"(anonymous_14)","decl":{"start":{"line":71,"column":13},"end":{"line":71,"column":21}},"loc":{"start":{"line":71,"column":32},"end":{"line":92,"column":3}},"line":71},"15":{"name":"(anonymous_15)","decl":{"start":{"line":74,"column":8},"end":{"line":74,"column":23}},"loc":{"start":{"line":74,"column":23},"end":{"line":89,"column":null}},"line":74},"16":{"name":"(anonymous_16)","decl":{"start":{"line":90,"column":8},"end":{"line":90,"column":24}},"loc":{"start":{"line":90,"column":24},"end":{"line":90,"column":null}},"line":90},"17":{"name":"fetchPhoto","decl":{"start":{"line":95,"column":16},"end":{"line":95,"column":null}},"loc":{"start":{"line":102,"column":2},"end":{"line":158,"column":null}},"line":102},"18":{"name":"(anonymous_18)","decl":{"start":{"line":118,"column":25},"end":{"line":118,"column":30}},"loc":{"start":{"line":118,"column":39},"end":{"line":120,"column":5}},"line":118},"19":{"name":"(anonymous_19)","decl":{"start":{"line":125,"column":23},"end":{"line":125,"column":null}},"loc":{"start":{"line":126,"column":4},"end":{"line":156,"column":null}},"line":126},"20":{"name":"(anonymous_20)","decl":{"start":{"line":127,"column":12},"end":{"line":127,"column":19}},"loc":{"start":{"line":127,"column":51},"end":{"line":149,"column":7}},"line":127},"21":{"name":"(anonymous_21)","decl":{"start":{"line":150,"column":7},"end":{"line":150,"column":19}},"loc":{"start":{"line":150,"column":19},"end":{"line":155,"column":7}},"line":150},"22":{"name":"(anonymous_22)","decl":{"start":{"line":156,"column":7},"end":{"line":156,"column":21}},"loc":{"start":{"line":156,"column":21},"end":{"line":156,"column":72}},"line":156},"23":{"name":"getAllThumbs","decl":{"start":{"line":160,"column":16},"end":{"line":160,"column":55}},"loc":{"start":{"line":160,"column":55},"end":{"line":166,"column":null}},"line":160}},"branchMap":{"0":{"loc":{"start":{"line":22,"column":2},"end":{"line":25,"column":null}},"type":"if","locations":[{"start":{"line":22,"column":2},"end":{"line":25,"column":null}},{"start":{},"end":{}}],"line":22},"1":{"loc":{"start":{"line":31,"column":2},"end":{"line":35,"column":null}},"type":"if","locations":[{"start":{"line":31,"column":2},"end":{"line":35,"column":null}},{"start":{"line":33,"column":9},"end":{"line":35,"column":null}}],"line":31},"2":{"loc":{"start":{"line":49,"column":2},"end":{"line":49,"column":null}},"type":"if","locations":[{"start":{"line":49,"column":2},"end":{"line":49,"column":null}},{"start":{},"end":{}}],"line":49},"3":{"loc":{"start":{"line":56,"column":2},"end":{"line":56,"column":null}},"type":"if","locations":[{"start":{"line":56,"column":2},"end":{"line":56,"column":null}},{"start":{},"end":{}}],"line":56},"4":{"loc":{"start":{"line":70,"column":41},"end":{"line":70,"column":84}},"type":"default-arg","locations":[{"start":{"line":70,"column":56},"end":{"line":70,"column":84}}],"line":70},"5":{"loc":{"start":{"line":104,"column":2},"end":{"line":104,"column":null}},"type":"if","locations":[{"start":{"line":104,"column":2},"end":{"line":104,"column":null}},{"start":{},"end":{}}],"line":104},"6":{"loc":{"start":{"line":106,"column":2},"end":{"line":109,"column":null}},"type":"if","locations":[{"start":{"line":106,"column":2},"end":{"line":109,"column":null}},{"start":{},"end":{}}],"line":106},"7":{"loc":{"start":{"line":107,"column":4},"end":{"line":107,"column":null}},"type":"if","locations":[{"start":{"line":107,"column":4},"end":{"line":107,"column":null}},{"start":{},"end":{}}],"line":107},"8":{"loc":{"start":{"line":112,"column":2},"end":{"line":122,"column":null}},"type":"if","locations":[{"start":{"line":112,"column":2},"end":{"line":122,"column":null}},{"start":{},"end":{}}],"line":112},"9":{"loc":{"start":{"line":112,"column":6},"end":{"line":112,"column":63}},"type":"binary-expr","locations":[{"start":{"line":112,"column":6},"end":{"line":112,"column":17}},{"start":{"line":112,"column":17},"end":{"line":112,"column":63}}],"line":112},"10":{"loc":{"start":{"line":119,"column":6},"end":{"line":119,"column":null}},"type":"if","locations":[{"start":{"line":119,"column":6},"end":{"line":119,"column":null}},{"start":{},"end":{}}],"line":119},"11":{"loc":{"start":{"line":128,"column":25},"end":{"line":128,"column":null}},"type":"binary-expr","locations":[{"start":{"line":128,"column":25},"end":{"line":128,"column":42}},{"start":{"line":128,"column":42},"end":{"line":128,"column":null}}],"line":128},"12":{"loc":{"start":{"line":129,"column":8},"end":{"line":135,"column":null}},"type":"if","locations":[{"start":{"line":129,"column":8},"end":{"line":135,"column":null}},{"start":{},"end":{}}],"line":129},"13":{"loc":{"start":{"line":145,"column":8},"end":{"line":148,"column":null}},"type":"if","locations":[{"start":{"line":145,"column":8},"end":{"line":148,"column":null}},{"start":{},"end":{}}],"line":145},"14":{"loc":{"start":{"line":163,"column":4},"end":{"line":163,"column":null}},"type":"if","locations":[{"start":{"line":163,"column":4},"end":{"line":163,"column":null}},{"start":{},"end":{}}],"line":163}},"s":{"0":25,"1":25,"2":25,"3":25,"4":25,"5":25,"6":25,"7":23,"8":22,"9":22,"10":1,"11":1,"12":18,"13":18,"14":1,"15":17,"16":20,"17":5,"18":20,"19":15,"20":4,"21":15,"22":6,"23":5,"24":6,"25":6,"26":1,"27":7,"28":6,"29":7,"30":7,"31":1,"32":9,"33":3,"34":21,"35":21,"36":21,"37":21,"38":18,"39":18,"40":18,"41":18,"42":18,"43":18,"44":18,"45":18,"46":18,"47":18,"48":18,"49":18,"50":18,"51":1,"52":21,"53":3,"54":21,"55":29,"56":29,"57":1,"58":1,"59":28,"60":3,"61":2,"62":3,"63":25,"64":2,"65":2,"66":2,"67":2,"68":2,"69":2,"70":1,"71":1,"72":2,"73":23,"74":23,"75":23,"76":17,"77":17,"78":2,"79":2,"80":2,"81":2,"82":2,"83":15,"84":15,"85":15,"86":17,"87":17,"88":15,"89":14,"90":14,"91":1,"92":1,"93":1,"94":1,"95":18,"96":18,"97":1,"98":1,"99":2,"100":1,"101":1},"f":{"0":23,"1":1,"2":18,"3":20,"4":5,"5":15,"6":4,"7":6,"8":1,"9":7,"10":1,"11":9,"12":3,"13":21,"14":21,"15":18,"16":3,"17":29,"18":2,"19":23,"20":17,"21":1,"22":18,"23":1},"b":{"0":[22,1],"1":[1,17],"2":[5,1],"3":[6,1],"4":[21],"5":[1,28],"6":[3,25],"7":[2,1],"8":[2,23],"9":[25,25],"10":[1,1],"11":[17,2],"12":[2,15],"13":[14,1],"14":[1,1]},"meta":{"lastBranch":15,"lastFunction":24,"lastStatement":102,"seen":{"s:9:14:9:Infinity":0,"s:10:17:10:Infinity":1,"s:11:18:11:Infinity":2,"s:13:23:13:Infinity":3,"s:17:23:17:Infinity":4,"s:18:21:18:Infinity":5,"s:19:40:19:Infinity":6,"f:21:9:21:45":0,"b:22:2:25:Infinity:undefined:undefined:undefined:undefined":0,"s:22:2:25:Infinity":7,"s:23:4:23:Infinity":8,"s:24:4:24:Infinity":9,"s:26:2:26:Infinity":10,"f:26:13:26:21":1,"s:26:32:26:58":11,"f:29:9:29:36":2,"s:30:15:30:Infinity":12,"b:31:2:35:Infinity:33:9:35:Infinity":1,"s:31:2:35:Infinity":13,"s:32:4:32:Infinity":14,"s:34:4:34:Infinity":15,"f:38:9:38:16":3,"s:39:2:39:Infinity":16,"f:39:22:39:30":4,"s:39:36:39:45":17,"s:40:2:40:Infinity":18,"f:43:9:43:21":5,"s:44:2:44:Infinity":19,"f:44:27:44:35":6,"s:44:41:44:50":20,"s:45:2:45:Infinity":21,"f:48:16:48:30":7,"b:49:2:49:Infinity:undefined:undefined:undefined:undefined":2,"s:49:2:49:Infinity":22,"s:49:27:49:Infinity":23,"s:50:2:50:Infinity":24,"s:51:2:51:Infinity":25,"f:51:2:51:15":8,"s:51:17:51:48":26,"f:55:16:55:29":9,"b:56:2:56:Infinity:undefined:undefined:undefined:undefined":3,"s:56:2:56:Infinity":27,"s:56:32:56:Infinity":28,"s:57:2:57:Infinity":29,"s:58:2:58:Infinity":30,"f:58:2:58:15":10,"s:58:17:58:53":31,"f:61:16:61:26":11,"s:62:2:62:Infinity":32,"f:65:16:65:26":12,"s:66:2:66:Infinity":33,"f:70:16:70:28":13,"b:70:56:70:84":4,"s:71:2:92:Infinity":34,"f:71:13:71:21":14,"s:72:16:72:Infinity":35,"s:73:4:73:Infinity":36,"s:74:4:89:Infinity":37,"f:74:8:74:23":15,"s:75:6:88:Infinity":38,"s:76:23:76:Infinity":39,"s:77:8:77:Infinity":40,"s:78:8:78:Infinity":41,"s:79:20:79:Infinity":42,"s:80:18:80:Infinity":43,"s:81:14:81:Infinity":44,"s:82:14:82:Infinity":45,"s:83:8:83:Infinity":46,"s:84:8:84:Infinity":47,"s:85:8:85:Infinity":48,"s:86:8:86:Infinity":49,"s:87:8:87:Infinity":50,"s:88:16:88:30":51,"s:90:4:90:Infinity":52,"f:90:8:90:24":16,"s:90:24:90:Infinity":53,"s:91:4:91:Infinity":54,"f:95:16:95:Infinity":17,"s:103:17:103:Infinity":55,"b:104:2:104:Infinity:undefined:undefined:undefined:undefined":5,"s:104:2:104:Infinity":56,"s:104:16:104:36":57,"s:104:36:104:43":58,"b:106:2:109:Infinity:undefined:undefined:undefined:undefined":6,"s:106:2:109:Infinity":59,"b:107:4:107:Infinity:undefined:undefined:undefined:undefined":7,"s:107:4:107:Infinity":60,"s:107:18:107:Infinity":61,"s:108:4:108:Infinity":62,"b:112:2:122:Infinity:undefined:undefined:undefined:undefined":8,"s:112:2:122:Infinity":63,"b:112:6:112:17:112:17:112:63":9,"s:113:30:113:Infinity":64,"s:114:4:114:Infinity":65,"s:115:4:115:Infinity":66,"s:116:4:116:Infinity":67,"s:118:4:120:Infinity":68,"f:118:25:118:30":18,"b:119:6:119:Infinity:undefined:undefined:undefined:undefined":10,"s:119:6:119:Infinity":69,"s:119:19:119:47":70,"s:119:47:119:76":71,"s:121:4:121:Infinity":72,"s:124:2:124:Infinity":73,"s:125:2:157:Infinity":74,"f:125:23:125:Infinity":19,"s:126:4:156:Infinity":75,"f:127:12:127:19":20,"s:128:25:128:Infinity":76,"b:128:25:128:42:128:42:128:Infinity":11,"b:129:8:135:Infinity:undefined:undefined:undefined:undefined":12,"s:129:8:135:Infinity":77,"s:130:36:130:Infinity":78,"s:131:10:131:Infinity":79,"s:132:10:132:Infinity":80,"s:133:10:133:Infinity":81,"s:134:10:134:Infinity":82,"s:138:34:138:Infinity":83,"s:139:8:139:Infinity":84,"s:140:8:140:Infinity":85,"s:141:8:141:Infinity":86,"s:144:22:144:Infinity":87,"b:145:8:148:Infinity:undefined:undefined:undefined:undefined":13,"s:145:8:148:Infinity":88,"s:146:10:146:Infinity":89,"s:147:10:147:Infinity":90,"f:150:7:150:19":21,"s:151:34:151:Infinity":91,"s:152:8:152:Infinity":92,"s:153:8:153:Infinity":93,"s:154:8:154:Infinity":94,"f:156:7:156:21":22,"s:156:23:156:50":95,"s:156:50:156:71":96,"f:160:16:160:55":23,"s:161:36:161:Infinity":97,"s:162:2:164:Infinity":98,"b:163:4:163:Infinity:undefined:undefined:undefined:undefined":14,"s:163:4:163:Infinity":99,"s:163:24:163:Infinity":100,"s:165:2:165:Infinity":101},"fnNames":{}}}
-,"C:\\Users\\Hospi\\.local\\bin\\trek-coverage\\client\\src\\store\\authStore.ts": {"path":"C:\\Users\\Hospi\\.local\\bin\\trek-coverage\\client\\src\\store\\authStore.ts","statementMap":{"0":{"start":{"line":75,"column":19},"end":{"line":75,"column":null}},"1":{"start":{"line":82,"column":2},"end":{"line":82,"column":null}},"2":{"start":{"line":83,"column":2},"end":{"line":87,"column":null}},"3":{"start":{"line":84,"column":4},"end":{"line":84,"column":null}},"4":{"start":{"line":86,"column":4},"end":{"line":86,"column":null}},"5":{"start":{"line":90,"column":13},"end":{"line":369,"column":null}},"6":{"start":{"line":92,"column":17},"end":{"line":348,"column":null}},"7":{"start":{"line":111,"column":4},"end":{"line":111,"column":null}},"8":{"start":{"line":112,"column":4},"end":{"line":112,"column":null}},"9":{"start":{"line":113,"column":4},"end":{"line":136,"column":null}},"10":{"start":{"line":114,"column":19},"end":{"line":114,"column":null}},"11":{"start":{"line":115,"column":6},"end":{"line":118,"column":null}},"12":{"start":{"line":116,"column":8},"end":{"line":116,"column":null}},"13":{"start":{"line":117,"column":8},"end":{"line":117,"column":null}},"14":{"start":{"line":119,"column":6},"end":{"line":124,"column":null}},"15":{"start":{"line":125,"column":6},"end":{"line":125,"column":null}},"16":{"start":{"line":126,"column":6},"end":{"line":126,"column":null}},"17":{"start":{"line":127,"column":6},"end":{"line":127,"column":null}},"18":{"start":{"line":128,"column":6},"end":{"line":130,"column":null}},"19":{"start":{"line":129,"column":8},"end":{"line":129,"column":null}},"20":{"start":{"line":131,"column":6},"end":{"line":131,"column":null}},"21":{"start":{"line":133,"column":12},"end":{"line":133,"column":null}},"22":{"start":{"line":134,"column":6},"end":{"line":134,"column":null}},"23":{"start":{"line":135,"column":6},"end":{"line":135,"column":null}},"24":{"start":{"line":140,"column":4},"end":{"line":140,"column":null}},"25":{"start":{"line":141,"column":4},"end":{"line":141,"column":null}},"26":{"start":{"line":142,"column":4},"end":{"line":161,"column":null}},"27":{"start":{"line":143,"column":19},"end":{"line":143,"column":null}},"28":{"start":{"line":144,"column":6},"end":{"line":149,"column":null}},"29":{"start":{"line":150,"column":6},"end":{"line":150,"column":null}},"30":{"start":{"line":151,"column":6},"end":{"line":151,"column":null}},"31":{"start":{"line":152,"column":6},"end":{"line":152,"column":null}},"32":{"start":{"line":153,"column":6},"end":{"line":155,"column":null}},"33":{"start":{"line":154,"column":8},"end":{"line":154,"column":null}},"34":{"start":{"line":156,"column":6},"end":{"line":156,"column":null}},"35":{"start":{"line":158,"column":12},"end":{"line":158,"column":null}},"36":{"start":{"line":159,"column":6},"end":{"line":159,"column":null}},"37":{"start":{"line":160,"column":6},"end":{"line":160,"column":null}},"38":{"start":{"line":165,"column":4},"end":{"line":165,"column":null}},"39":{"start":{"line":166,"column":4},"end":{"line":166,"column":null}},"40":{"start":{"line":167,"column":4},"end":{"line":184,"column":null}},"41":{"start":{"line":168,"column":19},"end":{"line":168,"column":null}},"42":{"start":{"line":169,"column":6},"end":{"line":174,"column":null}},"43":{"start":{"line":175,"column":6},"end":{"line":175,"column":null}},"44":{"start":{"line":176,"column":6},"end":{"line":176,"column":null}},"45":{"start":{"line":177,"column":6},"end":{"line":177,"column":null}},"46":{"start":{"line":178,"column":6},"end":{"line":178,"column":null}},"47":{"start":{"line":179,"column":6},"end":{"line":179,"column":null}},"48":{"start":{"line":181,"column":12},"end":{"line":181,"column":null}},"49":{"start":{"line":182,"column":6},"end":{"line":182,"column":null}},"50":{"start":{"line":183,"column":6},"end":{"line":183,"column":null}},"51":{"start":{"line":189,"column":4},"end":{"line":189,"column":null}},"52":{"start":{"line":190,"column":4},"end":{"line":190,"column":null}},"53":{"start":{"line":192,"column":4},"end":{"line":192,"column":null}},"54":{"start":{"line":194,"column":4},"end":{"line":194,"column":null}},"55":{"start":{"line":195,"column":4},"end":{"line":195,"column":null}},"56":{"start":{"line":198,"column":4},"end":{"line":198,"column":null}},"57":{"start":{"line":201,"column":4},"end":{"line":201,"column":null}},"58":{"start":{"line":203,"column":4},"end":{"line":203,"column":null}},"59":{"start":{"line":205,"column":4},"end":{"line":210,"column":null}},"60":{"start":{"line":206,"column":6},"end":{"line":209,"column":null}},"61":{"start":{"line":212,"column":4},"end":{"line":212,"column":null}},"62":{"start":{"line":214,"column":4},"end":{"line":219,"column":null}},"63":{"start":{"line":223,"column":16},"end":{"line":223,"column":null}},"64":{"start":{"line":224,"column":19},"end":{"line":224,"column":null}},"65":{"start":{"line":225,"column":4},"end":{"line":225,"column":null}},"66":{"start":{"line":225,"column":17},"end":{"line":225,"column":null}},"67":{"start":{"line":226,"column":4},"end":{"line":261,"column":null}},"68":{"start":{"line":227,"column":19},"end":{"line":227,"column":null}},"69":{"start":{"line":228,"column":6},"end":{"line":228,"column":null}},"70":{"start":{"line":228,"column":32},"end":{"line":228,"column":null}},"71":{"start":{"line":229,"column":6},"end":{"line":234,"column":null}},"72":{"start":{"line":235,"column":6},"end":{"line":235,"column":null}},"73":{"start":{"line":236,"column":6},"end":{"line":236,"column":null}},"74":{"start":{"line":238,"column":6},"end":{"line":238,"column":null}},"75":{"start":{"line":238,"column":32},"end":{"line":238,"column":null}},"76":{"start":{"line":239,"column":21},"end":{"line":241,"column":null}},"77":{"start":{"line":242,"column":6},"end":{"line":260,"column":null}},"78":{"start":{"line":244,"column":8},"end":{"line":249,"column":null}},"79":{"start":{"line":250,"column":13},"end":{"line":260,"column":null}},"80":{"start":{"line":253,"column":8},"end":{"line":253,"column":null}},"81":{"start":{"line":259,"column":8},"end":{"line":259,"column":null}},"82":{"start":{"line":265,"column":4},"end":{"line":273,"column":null}},"83":{"start":{"line":266,"column":6},"end":{"line":266,"column":null}},"84":{"start":{"line":267,"column":6},"end":{"line":270,"column":null}},"85":{"start":{"line":267,"column":22},"end":{"line":270,"column":8}},"86":{"start":{"line":272,"column":6},"end":{"line":272,"column":null}},"87":{"start":{"line":277,"column":4},"end":{"line":285,"column":null}},"88":{"start":{"line":278,"column":19},"end":{"line":278,"column":null}},"89":{"start":{"line":279,"column":6},"end":{"line":279,"column":null}},"90":{"start":{"line":280,"column":6},"end":{"line":282,"column":null}},"91":{"start":{"line":281,"column":8},"end":{"line":281,"column":null}},"92":{"start":{"line":284,"column":6},"end":{"line":284,"column":null}},"93":{"start":{"line":289,"column":4},"end":{"line":294,"column":null}},"94":{"start":{"line":290,"column":19},"end":{"line":290,"column":null}},"95":{"start":{"line":291,"column":6},"end":{"line":291,"column":null}},"96":{"start":{"line":293,"column":6},"end":{"line":293,"column":null}},"97":{"start":{"line":298,"column":21},"end":{"line":298,"column":null}},"98":{"start":{"line":299,"column":4},"end":{"line":299,"column":null}},"99":{"start":{"line":300,"column":17},"end":{"line":300,"column":null}},"100":{"start":{"line":301,"column":4},"end":{"line":301,"column":null}},"101":{"start":{"line":301,"column":20},"end":{"line":301,"column":97}},"102":{"start":{"line":302,"column":4},"end":{"line":302,"column":null}},"103":{"start":{"line":306,"column":4},"end":{"line":306,"column":null}},"104":{"start":{"line":307,"column":4},"end":{"line":307,"column":null}},"105":{"start":{"line":307,"column":20},"end":{"line":307,"column":86}},"106":{"start":{"line":311,"column":4},"end":{"line":312,"column":null}},"107":{"start":{"line":311,"column":13},"end":{"line":311,"column":null}},"108":{"start":{"line":312,"column":9},"end":{"line":312,"column":null}},"109":{"start":{"line":313,"column":4},"end":{"line":313,"column":null}},"110":{"start":{"line":316,"column":32},"end":{"line":316,"column":null}},"111":{"start":{"line":317,"column":37},"end":{"line":317,"column":null}},"112":{"start":{"line":318,"column":34},"end":{"line":318,"column":null}},"113":{"start":{"line":319,"column":35},"end":{"line":319,"column":null}},"114":{"start":{"line":320,"column":37},"end":{"line":320,"column":null}},"115":{"start":{"line":321,"column":38},"end":{"line":321,"column":null}},"116":{"start":{"line":322,"column":45},"end":{"line":322,"column":null}},"117":{"start":{"line":323,"column":44},"end":{"line":323,"column":null}},"118":{"start":{"line":324,"column":50},"end":{"line":324,"column":null}},"119":{"start":{"line":325,"column":45},"end":{"line":325,"column":null}},"120":{"start":{"line":328,"column":4},"end":{"line":328,"column":null}},"121":{"start":{"line":329,"column":4},"end":{"line":329,"column":null}},"122":{"start":{"line":330,"column":4},"end":{"line":346,"column":null}},"123":{"start":{"line":331,"column":19},"end":{"line":331,"column":null}},"124":{"start":{"line":332,"column":6},"end":{"line":338,"column":null}},"125":{"start":{"line":339,"column":6},"end":{"line":339,"column":null}},"126":{"start":{"line":340,"column":6},"end":{"line":340,"column":null}},"127":{"start":{"line":341,"column":6},"end":{"line":341,"column":null}},"128":{"start":{"line":343,"column":12},"end":{"line":343,"column":null}},"129":{"start":{"line":344,"column":6},"end":{"line":344,"column":null}},"130":{"start":{"line":345,"column":6},"end":{"line":345,"column":null}},"131":{"start":{"line":356,"column":28},"end":{"line":367,"column":null}}},"fnMap":{"0":{"name":"onAuthSuccess","decl":{"start":{"line":81,"column":15},"end":{"line":81,"column":29}},"loc":{"start":{"line":81,"column":60},"end":{"line":88,"column":null}},"line":81},"1":{"name":"(anonymous_1)","decl":{"start":{"line":91,"column":2},"end":{"line":91,"column":null}},"loc":{"start":{"line":92,"column":17},"end":{"line":348,"column":null}},"line":92},"2":{"name":"(anonymous_2)","decl":{"start":{"line":110,"column":9},"end":{"line":110,"column":16}},"loc":{"start":{"line":110,"column":74},"end":{"line":137,"column":null}},"line":110},"3":{"name":"(anonymous_3)","decl":{"start":{"line":139,"column":20},"end":{"line":139,"column":27}},"loc":{"start":{"line":139,"column":84},"end":{"line":162,"column":null}},"line":139},"4":{"name":"(anonymous_4)","decl":{"start":{"line":164,"column":12},"end":{"line":164,"column":19}},"loc":{"start":{"line":164,"column":96},"end":{"line":185,"column":null}},"line":164},"5":{"name":"(anonymous_5)","decl":{"start":{"line":187,"column":10},"end":{"line":187,"column":22}},"loc":{"start":{"line":187,"column":22},"end":{"line":220,"column":null}},"line":187},"6":{"name":"(anonymous_6)","decl":{"start":{"line":203,"column":80},"end":{"line":203,"column":92}},"loc":{"start":{"line":203,"column":92},"end":{"line":203,"column":94}},"line":203},"7":{"name":"(anonymous_7)","decl":{"start":{"line":207,"column":34},"end":{"line":207,"column":46}},"loc":{"start":{"line":207,"column":46},"end":{"line":207,"column":48}},"line":207},"8":{"name":"(anonymous_8)","decl":{"start":{"line":208,"column":38},"end":{"line":208,"column":50}},"loc":{"start":{"line":208,"column":50},"end":{"line":208,"column":52}},"line":208},"9":{"name":"(anonymous_9)","decl":{"start":{"line":222,"column":12},"end":{"line":222,"column":19}},"loc":{"start":{"line":222,"column":51},"end":{"line":262,"column":null}},"line":222},"10":{"name":"(anonymous_10)","decl":{"start":{"line":264,"column":17},"end":{"line":264,"column":24}},"loc":{"start":{"line":264,"column":47},"end":{"line":274,"column":null}},"line":264},"11":{"name":"(anonymous_11)","decl":{"start":{"line":267,"column":6},"end":{"line":267,"column":11}},"loc":{"start":{"line":267,"column":22},"end":{"line":270,"column":8}},"line":267},"12":{"name":"(anonymous_12)","decl":{"start":{"line":276,"column":17},"end":{"line":276,"column":24}},"loc":{"start":{"line":276,"column":64},"end":{"line":286,"column":null}},"line":276},"13":{"name":"(anonymous_13)","decl":{"start":{"line":288,"column":17},"end":{"line":288,"column":24}},"loc":{"start":{"line":288,"column":55},"end":{"line":295,"column":null}},"line":288},"14":{"name":"(anonymous_14)","decl":{"start":{"line":297,"column":16},"end":{"line":297,"column":23}},"loc":{"start":{"line":297,"column":38},"end":{"line":303,"column":null}},"line":297},"15":{"name":"(anonymous_15)","decl":{"start":{"line":301,"column":4},"end":{"line":301,"column":9}},"loc":{"start":{"line":301,"column":20},"end":{"line":301,"column":97}},"line":301},"16":{"name":"(anonymous_16)","decl":{"start":{"line":305,"column":16},"end":{"line":305,"column":28}},"loc":{"start":{"line":305,"column":28},"end":{"line":308,"column":null}},"line":305},"17":{"name":"(anonymous_17)","decl":{"start":{"line":307,"column":4},"end":{"line":307,"column":9}},"loc":{"start":{"line":307,"column":20},"end":{"line":307,"column":86}},"line":307},"18":{"name":"(anonymous_18)","decl":{"start":{"line":310,"column":2},"end":{"line":310,"column":16}},"loc":{"start":{"line":310,"column":33},"end":{"line":314,"column":null}},"line":310},"19":{"name":"(anonymous_19)","decl":{"start":{"line":316,"column":2},"end":{"line":316,"column":15}},"loc":{"start":{"line":316,"column":32},"end":{"line":316,"column":null}},"line":316},"20":{"name":"(anonymous_20)","decl":{"start":{"line":317,"column":2},"end":{"line":317,"column":20}},"loc":{"start":{"line":317,"column":37},"end":{"line":317,"column":null}},"line":317},"21":{"name":"(anonymous_21)","decl":{"start":{"line":318,"column":2},"end":{"line":318,"column":18}},"loc":{"start":{"line":318,"column":34},"end":{"line":318,"column":null}},"line":318},"22":{"name":"(anonymous_22)","decl":{"start":{"line":319,"column":2},"end":{"line":319,"column":18}},"loc":{"start":{"line":319,"column":35},"end":{"line":319,"column":null}},"line":319},"23":{"name":"(anonymous_23)","decl":{"start":{"line":320,"column":2},"end":{"line":320,"column":22}},"loc":{"start":{"line":320,"column":37},"end":{"line":320,"column":null}},"line":320},"24":{"name":"(anonymous_24)","decl":{"start":{"line":321,"column":2},"end":{"line":321,"column":21}},"loc":{"start":{"line":321,"column":38},"end":{"line":321,"column":null}},"line":321},"25":{"name":"(anonymous_25)","decl":{"start":{"line":322,"column":2},"end":{"line":322,"column":28}},"loc":{"start":{"line":322,"column":45},"end":{"line":322,"column":null}},"line":322},"26":{"name":"(anonymous_26)","decl":{"start":{"line":323,"column":2},"end":{"line":323,"column":27}},"loc":{"start":{"line":323,"column":44},"end":{"line":323,"column":null}},"line":323},"27":{"name":"(anonymous_27)","decl":{"start":{"line":324,"column":2},"end":{"line":324,"column":33}},"loc":{"start":{"line":324,"column":50},"end":{"line":324,"column":null}},"line":324},"28":{"name":"(anonymous_28)","decl":{"start":{"line":325,"column":2},"end":{"line":325,"column":28}},"loc":{"start":{"line":325,"column":45},"end":{"line":325,"column":null}},"line":325},"29":{"name":"(anonymous_29)","decl":{"start":{"line":327,"column":13},"end":{"line":327,"column":25}},"loc":{"start":{"line":327,"column":25},"end":{"line":347,"column":null}},"line":327},"30":{"name":"(anonymous_30)","decl":{"start":{"line":356,"column":4},"end":{"line":356,"column":17}},"loc":{"start":{"line":356,"column":28},"end":{"line":367,"column":null}},"line":356}},"branchMap":{"0":{"loc":{"start":{"line":115,"column":6},"end":{"line":118,"column":null}},"type":"if","locations":[{"start":{"line":115,"column":6},"end":{"line":118,"column":null}},{"start":{},"end":{}}],"line":115},"1":{"loc":{"start":{"line":115,"column":10},"end":{"line":115,"column":47}},"type":"binary-expr","locations":[{"start":{"line":115,"column":10},"end":{"line":115,"column":31}},{"start":{"line":115,"column":31},"end":{"line":115,"column":47}}],"line":115},"2":{"loc":{"start":{"line":128,"column":6},"end":{"line":130,"column":null}},"type":"if","locations":[{"start":{"line":128,"column":6},"end":{"line":130,"column":null}},{"start":{},"end":{}}],"line":128},"3":{"loc":{"start":{"line":153,"column":6},"end":{"line":155,"column":null}},"type":"if","locations":[{"start":{"line":153,"column":6},"end":{"line":155,"column":null}},{"start":{},"end":{}}],"line":153},"4":{"loc":{"start":{"line":205,"column":4},"end":{"line":210,"column":null}},"type":"if","locations":[{"start":{"line":205,"column":4},"end":{"line":210,"column":null}},{"start":{},"end":{}}],"line":205},"5":{"loc":{"start":{"line":225,"column":4},"end":{"line":225,"column":null}},"type":"if","locations":[{"start":{"line":225,"column":4},"end":{"line":225,"column":null}},{"start":{},"end":{}}],"line":225},"6":{"loc":{"start":{"line":228,"column":6},"end":{"line":228,"column":null}},"type":"if","locations":[{"start":{"line":228,"column":6},"end":{"line":228,"column":null}},{"start":{},"end":{}}],"line":228},"7":{"loc":{"start":{"line":238,"column":6},"end":{"line":238,"column":null}},"type":"if","locations":[{"start":{"line":238,"column":6},"end":{"line":238,"column":null}},{"start":{},"end":{}}],"line":238},"8":{"loc":{"start":{"line":239,"column":21},"end":{"line":241,"column":null}},"type":"cond-expr","locations":[{"start":{"line":240,"column":11},"end":{"line":240,"column":null}},{"start":{"line":241,"column":10},"end":{"line":241,"column":null}}],"line":239},"9":{"loc":{"start":{"line":239,"column":21},"end":{"line":239,"column":null}},"type":"binary-expr","locations":[{"start":{"line":239,"column":21},"end":{"line":239,"column":28}},{"start":{"line":239,"column":28},"end":{"line":239,"column":55}},{"start":{"line":239,"column":55},"end":{"line":239,"column":null}}],"line":239},"10":{"loc":{"start":{"line":242,"column":6},"end":{"line":260,"column":null}},"type":"if","locations":[{"start":{"line":242,"column":6},"end":{"line":260,"column":null}},{"start":{"line":250,"column":13},"end":{"line":260,"column":null}}],"line":242},"11":{"loc":{"start":{"line":250,"column":13},"end":{"line":260,"column":null}},"type":"if","locations":[{"start":{"line":250,"column":13},"end":{"line":260,"column":null}},{"start":{"line":254,"column":13},"end":{"line":260,"column":null}}],"line":250},"12":{"loc":{"start":{"line":250,"column":17},"end":{"line":250,"column":96}},"type":"binary-expr","locations":[{"start":{"line":250,"column":17},"end":{"line":250,"column":41}},{"start":{"line":250,"column":41},"end":{"line":250,"column":77}},{"start":{"line":250,"column":77},"end":{"line":250,"column":96}}],"line":250},"13":{"loc":{"start":{"line":268,"column":14},"end":{"line":268,"column":null}},"type":"cond-expr","locations":[{"start":{"line":268,"column":27},"end":{"line":268,"column":74}},{"start":{"line":268,"column":74},"end":{"line":268,"column":null}}],"line":268},"14":{"loc":{"start":{"line":268,"column":58},"end":{"line":268,"column":70}},"type":"binary-expr","locations":[{"start":{"line":268,"column":58},"end":{"line":268,"column":65}},{"start":{"line":268,"column":65},"end":{"line":268,"column":70}}],"line":268},"15":{"loc":{"start":{"line":280,"column":6},"end":{"line":282,"column":null}},"type":"if","locations":[{"start":{"line":280,"column":6},"end":{"line":282,"column":null}},{"start":{},"end":{}}],"line":280},"16":{"loc":{"start":{"line":301,"column":28},"end":{"line":301,"column":95}},"type":"cond-expr","locations":[{"start":{"line":301,"column":41},"end":{"line":301,"column":90}},{"start":{"line":301,"column":90},"end":{"line":301,"column":95}}],"line":301},"17":{"loc":{"start":{"line":307,"column":28},"end":{"line":307,"column":84}},"type":"cond-expr","locations":[{"start":{"line":307,"column":41},"end":{"line":307,"column":79}},{"start":{"line":307,"column":79},"end":{"line":307,"column":84}}],"line":307},"18":{"loc":{"start":{"line":311,"column":4},"end":{"line":312,"column":null}},"type":"if","locations":[{"start":{"line":311,"column":4},"end":{"line":312,"column":null}},{"start":{"line":312,"column":9},"end":{"line":312,"column":null}}],"line":311},"19":{"loc":{"start":{"line":358,"column":12},"end":{"line":366,"column":null}},"type":"cond-expr","locations":[{"start":{"line":358,"column":25},"end":{"line":366,"column":10}},{"start":{"line":366,"column":10},"end":{"line":366,"column":null}}],"line":358}},"s":{"0":1,"1":12,"2":12,"3":12,"4":1,"5":1,"6":1,"7":8,"8":8,"9":8,"10":8,"11":7,"12":1,"13":1,"14":6,"15":6,"16":6,"17":6,"18":6,"19":5,"20":6,"21":1,"22":1,"23":1,"24":3,"25":3,"26":3,"27":3,"28":2,"29":2,"30":2,"31":2,"32":2,"33":1,"34":2,"35":1,"36":1,"37":1,"38":2,"39":2,"40":2,"41":2,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":3,"52":3,"53":3,"54":3,"55":3,"56":3,"57":3,"58":3,"59":3,"60":1,"61":3,"62":3,"63":10,"64":10,"65":10,"66":9,"67":10,"68":10,"69":3,"70":1,"71":2,"72":2,"73":2,"74":7,"75":1,"76":6,"77":7,"78":2,"79":4,"80":1,"81":3,"82":4,"83":4,"84":3,"85":3,"86":1,"87":4,"88":4,"89":3,"90":3,"91":2,"92":1,"93":2,"94":2,"95":1,"96":1,"97":2,"98":2,"99":2,"100":2,"101":2,"102":2,"103":2,"104":2,"105":2,"106":2,"107":1,"108":1,"109":2,"110":1,"111":1,"112":1,"113":1,"114":1,"115":1,"116":1,"117":1,"118":1,"119":1,"120":2,"121":2,"122":2,"123":2,"124":1,"125":1,"126":1,"127":1,"128":1,"129":1,"130":1,"131":140},"f":{"0":12,"1":1,"2":8,"3":3,"4":2,"5":3,"6":1,"7":1,"8":1,"9":10,"10":4,"11":3,"12":4,"13":2,"14":2,"15":2,"16":2,"17":2,"18":2,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":2,"30":140},"b":{"0":[1,6],"1":[7,1],"2":[5,1],"3":[1,1],"4":[1,2],"5":[9,1],"6":[1,2],"7":[1,6],"8":[4,2],"9":[6,6,6],"10":[2,4],"11":[1,3],"12":[4,2,2],"13":[2,1],"14":[2,1],"15":[2,1],"16":[1,1],"17":[1,1],"18":[1,1],"19":[50,90]},"meta":{"lastBranch":20,"lastFunction":31,"lastStatement":132,"seen":{"s:75:19:75:Infinity":0,"f:81:15:81:29":0,"s:82:2:82:Infinity":1,"s:83:2:87:Infinity":2,"s:84:4:84:Infinity":3,"s:86:4:86:Infinity":4,"s:90:13:369:Infinity":5,"f:91:2:91:Infinity":1,"s:92:17:348:Infinity":6,"f:110:9:110:16":2,"s:111:4:111:Infinity":7,"s:112:4:112:Infinity":8,"s:113:4:136:Infinity":9,"s:114:19:114:Infinity":10,"b:115:6:118:Infinity:undefined:undefined:undefined:undefined":0,"s:115:6:118:Infinity":11,"b:115:10:115:31:115:31:115:47":1,"s:116:8:116:Infinity":12,"s:117:8:117:Infinity":13,"s:119:6:124:Infinity":14,"s:125:6:125:Infinity":15,"s:126:6:126:Infinity":16,"s:127:6:127:Infinity":17,"b:128:6:130:Infinity:undefined:undefined:undefined:undefined":2,"s:128:6:130:Infinity":18,"s:129:8:129:Infinity":19,"s:131:6:131:Infinity":20,"s:133:12:133:Infinity":21,"s:134:6:134:Infinity":22,"s:135:6:135:Infinity":23,"f:139:20:139:27":3,"s:140:4:140:Infinity":24,"s:141:4:141:Infinity":25,"s:142:4:161:Infinity":26,"s:143:19:143:Infinity":27,"s:144:6:149:Infinity":28,"s:150:6:150:Infinity":29,"s:151:6:151:Infinity":30,"s:152:6:152:Infinity":31,"b:153:6:155:Infinity:undefined:undefined:undefined:undefined":3,"s:153:6:155:Infinity":32,"s:154:8:154:Infinity":33,"s:156:6:156:Infinity":34,"s:158:12:158:Infinity":35,"s:159:6:159:Infinity":36,"s:160:6:160:Infinity":37,"f:164:12:164:19":4,"s:165:4:165:Infinity":38,"s:166:4:166:Infinity":39,"s:167:4:184:Infinity":40,"s:168:19:168:Infinity":41,"s:169:6:174:Infinity":42,"s:175:6:175:Infinity":43,"s:176:6:176:Infinity":44,"s:177:6:177:Infinity":45,"s:178:6:178:Infinity":46,"s:179:6:179:Infinity":47,"s:181:12:181:Infinity":48,"s:182:6:182:Infinity":49,"s:183:6:183:Infinity":50,"f:187:10:187:22":5,"s:189:4:189:Infinity":51,"s:190:4:190:Infinity":52,"s:192:4:192:Infinity":53,"s:194:4:194:Infinity":54,"s:195:4:195:Infinity":55,"s:198:4:198:Infinity":56,"s:201:4:201:Infinity":57,"s:203:4:203:Infinity":58,"f:203:80:203:92":6,"b:205:4:210:Infinity:undefined:undefined:undefined:undefined":4,"s:205:4:210:Infinity":59,"s:206:6:209:Infinity":60,"f:207:34:207:46":7,"f:208:38:208:50":8,"s:212:4:212:Infinity":61,"s:214:4:219:Infinity":62,"f:222:12:222:19":9,"s:223:16:223:Infinity":63,"s:224:19:224:Infinity":64,"b:225:4:225:Infinity:undefined:undefined:undefined:undefined":5,"s:225:4:225:Infinity":65,"s:225:17:225:Infinity":66,"s:226:4:261:Infinity":67,"s:227:19:227:Infinity":68,"b:228:6:228:Infinity:undefined:undefined:undefined:undefined":6,"s:228:6:228:Infinity":69,"s:228:32:228:Infinity":70,"s:229:6:234:Infinity":71,"s:235:6:235:Infinity":72,"s:236:6:236:Infinity":73,"b:238:6:238:Infinity:undefined:undefined:undefined:undefined":7,"s:238:6:238:Infinity":74,"s:238:32:238:Infinity":75,"s:239:21:241:Infinity":76,"b:240:11:240:Infinity:241:10:241:Infinity":8,"b:239:21:239:28:239:28:239:55:239:55:239:Infinity":9,"b:242:6:260:Infinity:250:13:260:Infinity":10,"s:242:6:260:Infinity":77,"s:244:8:249:Infinity":78,"b:250:13:260:Infinity:254:13:260:Infinity":11,"s:250:13:260:Infinity":79,"b:250:17:250:41:250:41:250:77:250:77:250:96":12,"s:253:8:253:Infinity":80,"s:259:8:259:Infinity":81,"f:264:17:264:24":10,"s:265:4:273:Infinity":82,"s:266:6:266:Infinity":83,"s:267:6:270:Infinity":84,"f:267:6:267:11":11,"s:267:22:270:8":85,"b:268:27:268:74:268:74:268:Infinity":13,"b:268:58:268:65:268:65:268:70":14,"s:272:6:272:Infinity":86,"f:276:17:276:24":12,"s:277:4:285:Infinity":87,"s:278:19:278:Infinity":88,"s:279:6:279:Infinity":89,"b:280:6:282:Infinity:undefined:undefined:undefined:undefined":15,"s:280:6:282:Infinity":90,"s:281:8:281:Infinity":91,"s:284:6:284:Infinity":92,"f:288:17:288:24":13,"s:289:4:294:Infinity":93,"s:290:19:290:Infinity":94,"s:291:6:291:Infinity":95,"s:293:6:293:Infinity":96,"f:297:16:297:23":14,"s:298:21:298:Infinity":97,"s:299:4:299:Infinity":98,"s:300:17:300:Infinity":99,"s:301:4:301:Infinity":100,"f:301:4:301:9":15,"s:301:20:301:97":101,"b:301:41:301:90:301:90:301:95":16,"s:302:4:302:Infinity":102,"f:305:16:305:28":16,"s:306:4:306:Infinity":103,"s:307:4:307:Infinity":104,"f:307:4:307:9":17,"s:307:20:307:86":105,"b:307:41:307:79:307:79:307:84":17,"f:310:2:310:16":18,"b:311:4:312:Infinity:312:9:312:Infinity":18,"s:311:4:312:Infinity":106,"s:311:13:311:Infinity":107,"s:312:9:312:Infinity":108,"s:313:4:313:Infinity":109,"f:316:2:316:15":19,"s:316:32:316:Infinity":110,"f:317:2:317:20":20,"s:317:37:317:Infinity":111,"f:318:2:318:18":21,"s:318:34:318:Infinity":112,"f:319:2:319:18":22,"s:319:35:319:Infinity":113,"f:320:2:320:22":23,"s:320:37:320:Infinity":114,"f:321:2:321:21":24,"s:321:38:321:Infinity":115,"f:322:2:322:28":25,"s:322:45:322:Infinity":116,"f:323:2:323:27":26,"s:323:44:323:Infinity":117,"f:324:2:324:33":27,"s:324:50:324:Infinity":118,"f:325:2:325:28":28,"s:325:45:325:Infinity":119,"f:327:13:327:25":29,"s:328:4:328:Infinity":120,"s:329:4:329:Infinity":121,"s:330:4:346:Infinity":122,"s:331:19:331:Infinity":123,"s:332:6:338:Infinity":124,"s:339:6:339:Infinity":125,"s:340:6:340:Infinity":126,"s:341:6:341:Infinity":127,"s:343:12:343:Infinity":128,"s:344:6:344:Infinity":129,"s:345:6:345:Infinity":130,"f:356:4:356:17":30,"s:356:28:367:Infinity":131,"b:358:25:366:10:366:10:366:Infinity":19},"fnNames":{}}}
-}
diff --git a/client/coverage-jsheet/coverage-final.json b/client/coverage-jsheet/coverage-final.json
deleted file mode 100644
index c34c70058..000000000
--- a/client/coverage-jsheet/coverage-final.json
+++ /dev/null
@@ -1,2 +0,0 @@
-{"C:\\Users\\Hospi\\.local\\bin\\trek-coverage\\client\\src\\mobile\\screens\\journey\\MJourneyEntrySheet.tsx": {"path":"C:\\Users\\Hospi\\.local\\bin\\trek-coverage\\client\\src\\mobile\\screens\\journey\\MJourneyEntrySheet.tsx","statementMap":{"0":{"start":{"line":16,"column":18},"end":{"line":16,"column":null}},"1":{"start":{"line":17,"column":18},"end":{"line":17,"column":null}},"2":{"start":{"line":46,"column":10},"end":{"line":46,"column":null}},"3":{"start":{"line":47,"column":8},"end":{"line":47,"column":null}},"4":{"start":{"line":49,"column":16},"end":{"line":49,"column":null}},"5":{"start":{"line":50,"column":16},"end":{"line":50,"column":null}},"6":{"start":{"line":51,"column":20},"end":{"line":51,"column":null}},"7":{"start":{"line":52,"column":20},"end":{"line":52,"column":null}},"8":{"start":{"line":53,"column":23},"end":{"line":53,"column":null}},"9":{"start":{"line":54,"column":22},"end":{"line":54,"column":null}},"10":{"start":{"line":55,"column":22},"end":{"line":55,"column":null}},"11":{"start":{"line":56,"column":24},"end":{"line":56,"column":null}},"12":{"start":{"line":57,"column":26},"end":{"line":57,"column":null}},"13":{"start":{"line":58,"column":30},"end":{"line":58,"column":null}},"14":{"start":{"line":59,"column":8},"end":{"line":59,"column":null}},"15":{"start":{"line":60,"column":15},"end":{"line":60,"column":null}},"16":{"start":{"line":61,"column":18},"end":{"line":61,"column":null}},"17":{"start":{"line":62,"column":15},"end":{"line":62,"column":null}},"18":{"start":{"line":63,"column":15},"end":{"line":63,"column":null}},"19":{"start":{"line":64,"column":15},"end":{"line":64,"column":null}},"20":{"start":{"line":65,"column":19},"end":{"line":65,"column":null}},"21":{"start":{"line":66,"column":17},"end":{"line":66,"column":null}},"22":{"start":{"line":67,"column":23},"end":{"line":67,"column":null}},"23":{"start":{"line":68,"column":25},"end":{"line":68,"column":null}},"24":{"start":{"line":69,"column":26},"end":{"line":69,"column":null}},"25":{"start":{"line":70,"column":17},"end":{"line":70,"column":null}},"26":{"start":{"line":71,"column":22},"end":{"line":71,"column":null}},"27":{"start":{"line":72,"column":19},"end":{"line":72,"column":null}},"28":{"start":{"line":73,"column":24},"end":{"line":73,"column":null}},"29":{"start":{"line":74,"column":25},"end":{"line":74,"column":null}},"30":{"start":{"line":75,"column":8},"end":{"line":75,"column":null}},"31":{"start":{"line":76,"column":8},"end":{"line":76,"column":null}},"32":{"start":{"line":78,"column":2},"end":{"line":113,"column":null}},"33":{"start":{"line":79,"column":4},"end":{"line":79,"column":null}},"34":{"start":{"line":79,"column":95},"end":{"line":79,"column":null}},"35":{"start":{"line":80,"column":4},"end":{"line":83,"column":null}},"36":{"start":{"line":81,"column":6},"end":{"line":81,"column":null}},"37":{"start":{"line":82,"column":6},"end":{"line":82,"column":null}},"38":{"start":{"line":85,"column":17},"end":{"line":85,"column":null}},"39":{"start":{"line":86,"column":4},"end":{"line":86,"column":null}},"40":{"start":{"line":87,"column":4},"end":{"line":110,"column":null}},"41":{"start":{"line":88,"column":18},"end":{"line":88,"column":null}},"42":{"start":{"line":89,"column":18},"end":{"line":89,"column":null}},"43":{"start":{"line":90,"column":6},"end":{"line":90,"column":null}},"44":{"start":{"line":90,"column":19},"end":{"line":90,"column":null}},"45":{"start":{"line":91,"column":6},"end":{"line":91,"column":null}},"46":{"start":{"line":92,"column":6},"end":{"line":92,"column":null}},"47":{"start":{"line":94,"column":43},"end":{"line":97,"column":null}},"48":{"start":{"line":98,"column":6},"end":{"line":98,"column":null}},"49":{"start":{"line":98,"column":19},"end":{"line":98,"column":null}},"50":{"start":{"line":99,"column":6},"end":{"line":101,"column":null}},"51":{"start":{"line":100,"column":8},"end":{"line":100,"column":null}},"52":{"start":{"line":102,"column":6},"end":{"line":104,"column":null}},"53":{"start":{"line":103,"column":8},"end":{"line":103,"column":null}},"54":{"start":{"line":103,"column":30},"end":{"line":103,"column":122}},"55":{"start":{"line":105,"column":6},"end":{"line":105,"column":null}},"56":{"start":{"line":107,"column":6},"end":{"line":107,"column":null}},"57":{"start":{"line":107,"column":19},"end":{"line":107,"column":null}},"58":{"start":{"line":108,"column":6},"end":{"line":108,"column":null}},"59":{"start":{"line":109,"column":6},"end":{"line":109,"column":null}},"60":{"start":{"line":112,"column":4},"end":{"line":112,"column":null}},"61":{"start":{"line":112,"column":19},"end":{"line":112,"column":34}},"62":{"start":{"line":116,"column":4},"end":{"line":127,"column":null}},"63":{"start":{"line":129,"column":8},"end":{"line":132,"column":null}},"64":{"start":{"line":130,"column":4},"end":{"line":130,"column":null}},"65":{"start":{"line":130,"column":108},"end":{"line":130,"column":null}},"66":{"start":{"line":131,"column":4},"end":{"line":131,"column":null}},"67":{"start":{"line":134,"column":21},"end":{"line":179,"column":null}},"68":{"start":{"line":135,"column":4},"end":{"line":135,"column":null}},"69":{"start":{"line":136,"column":4},"end":{"line":178,"column":null}},"70":{"start":{"line":137,"column":22},"end":{"line":152,"column":null}},"71":{"start":{"line":147,"column":33},"end":{"line":147,"column":43}},"72":{"start":{"line":148,"column":44},"end":{"line":148,"column":52}},"73":{"start":{"line":148,"column":78},"end":{"line":148,"column":86}},"74":{"start":{"line":153,"column":6},"end":{"line":169,"column":null}},"75":{"start":{"line":154,"column":25},"end":{"line":154,"column":null}},"76":{"start":{"line":155,"column":8},"end":{"line":155,"column":null}},"77":{"start":{"line":156,"column":8},"end":{"line":168,"column":null}},"78":{"start":{"line":157,"column":29},"end":{"line":159,"column":null}},"79":{"start":{"line":158,"column":29},"end":{"line":158,"column":null}},"80":{"start":{"line":160,"column":10},"end":{"line":160,"column":null}},"81":{"start":{"line":161,"column":10},"end":{"line":163,"column":null}},"82":{"start":{"line":162,"column":12},"end":{"line":162,"column":null}},"83":{"start":{"line":165,"column":10},"end":{"line":165,"column":null}},"84":{"start":{"line":167,"column":10},"end":{"line":167,"column":null}},"85":{"start":{"line":170,"column":6},"end":{"line":174,"column":null}},"86":{"start":{"line":171,"column":8},"end":{"line":173,"column":null}},"87":{"start":{"line":172,"column":10},"end":{"line":172,"column":null}},"88":{"start":{"line":172,"column":16},"end":{"line":172,"column":61}},"89":{"start":{"line":175,"column":6},"end":{"line":175,"column":null}},"90":{"start":{"line":177,"column":6},"end":{"line":177,"column":null}},"91":{"start":{"line":181,"column":27},"end":{"line":186,"column":null}},"92":{"start":{"line":182,"column":18},"end":{"line":182,"column":null}},"93":{"start":{"line":183,"column":4},"end":{"line":183,"column":null}},"94":{"start":{"line":183,"column":24},"end":{"line":183,"column":null}},"95":{"start":{"line":184,"column":23},"end":{"line":184,"column":null}},"96":{"start":{"line":185,"column":4},"end":{"line":185,"column":null}},"97":{"start":{"line":185,"column":28},"end":{"line":185,"column":52}},"98":{"start":{"line":188,"column":8},"end":{"line":206,"column":null}},"99":{"start":{"line":189,"column":4},"end":{"line":189,"column":null}},"100":{"start":{"line":190,"column":4},"end":{"line":190,"column":null}},"101":{"start":{"line":191,"column":4},"end":{"line":191,"column":null}},"102":{"start":{"line":191,"column":34},"end":{"line":191,"column":null}},"103":{"start":{"line":192,"column":4},"end":{"line":195,"column":null}},"104":{"start":{"line":193,"column":6},"end":{"line":193,"column":null}},"105":{"start":{"line":194,"column":6},"end":{"line":194,"column":null}},"106":{"start":{"line":196,"column":4},"end":{"line":205,"column":null}},"107":{"start":{"line":197,"column":6},"end":{"line":204,"column":null}},"108":{"start":{"line":198,"column":20},"end":{"line":198,"column":null}},"109":{"start":{"line":199,"column":8},"end":{"line":201,"column":null}},"110":{"start":{"line":199,"column":150},"end":{"line":201,"column":10}},"111":{"start":{"line":203,"column":8},"end":{"line":203,"column":null}},"112":{"start":{"line":208,"column":8},"end":{"line":213,"column":null}},"113":{"start":{"line":209,"column":18},"end":{"line":209,"column":null}},"114":{"start":{"line":210,"column":4},"end":{"line":210,"column":null}},"115":{"start":{"line":210,"column":16},"end":{"line":210,"column":null}},"116":{"start":{"line":211,"column":4},"end":{"line":211,"column":null}},"117":{"start":{"line":211,"column":31},"end":{"line":211,"column":null}},"118":{"start":{"line":211,"column":47},"end":{"line":211,"column":63}},"119":{"start":{"line":212,"column":4},"end":{"line":212,"column":null}},"120":{"start":{"line":215,"column":33},"end":{"line":215,"column":null}},"121":{"start":{"line":215,"column":60},"end":{"line":215,"column":93}},"122":{"start":{"line":215,"column":78},"end":{"line":215,"column":92}},"123":{"start":{"line":217,"column":18},"end":{"line":217,"column":null}},"124":{"start":{"line":218,"column":21},"end":{"line":218,"column":null}},"125":{"start":{"line":220,"column":2},"end":{"line":665,"column":null}},"126":{"start":{"line":243,"column":27},"end":{"line":243,"column":null}},"127":{"start":{"line":251,"column":149},"end":{"line":251,"column":191}},"128":{"start":{"line":252,"column":134},"end":{"line":252,"column":176}},"129":{"start":{"line":256,"column":16},"end":{"line":256,"column":null}},"130":{"start":{"line":274,"column":31},"end":{"line":274,"column":null}},"131":{"start":{"line":274,"column":96},"end":{"line":274,"column":98}},"132":{"start":{"line":291,"column":20},"end":{"line":309,"column":null}},"133":{"start":{"line":297,"column":24},"end":{"line":305,"column":null}},"134":{"start":{"line":298,"column":26},"end":{"line":301,"column":null}},"135":{"start":{"line":299,"column":43},"end":{"line":299,"column":null}},"136":{"start":{"line":300,"column":28},"end":{"line":300,"column":null}},"137":{"start":{"line":300,"column":40},"end":{"line":300,"column":null}},"138":{"start":{"line":300,"column":58},"end":{"line":300,"column":75}},"139":{"start":{"line":303,"column":26},"end":{"line":303,"column":null}},"140":{"start":{"line":303,"column":52},"end":{"line":303,"column":68}},"141":{"start":{"line":304,"column":26},"end":{"line":304,"column":null}},"142":{"start":{"line":304,"column":44},"end":{"line":304,"column":57}},"143":{"start":{"line":325,"column":14},"end":{"line":361,"column":null}},"144":{"start":{"line":331,"column":22},"end":{"line":337,"column":null}},"145":{"start":{"line":332,"column":37},"end":{"line":332,"column":null}},"146":{"start":{"line":333,"column":40},"end":{"line":333,"column":null}},"147":{"start":{"line":334,"column":24},"end":{"line":334,"column":null}},"148":{"start":{"line":335,"column":24},"end":{"line":335,"column":null}},"149":{"start":{"line":335,"column":50},"end":{"line":335,"column":115}},"150":{"start":{"line":336,"column":24},"end":{"line":336,"column":null}},"151":{"start":{"line":348,"column":22},"end":{"line":348,"column":null}},"152":{"start":{"line":348,"column":40},"end":{"line":348,"column":71}},"153":{"start":{"line":348,"column":57},"end":{"line":348,"column":70}},"154":{"start":{"line":349,"column":22},"end":{"line":353,"column":null}},"155":{"start":{"line":350,"column":24},"end":{"line":350,"column":null}},"156":{"start":{"line":350,"column":30},"end":{"line":350,"column":75}},"157":{"start":{"line":352,"column":24},"end":{"line":352,"column":null}},"158":{"start":{"line":352,"column":50},"end":{"line":352,"column":80}},"159":{"start":{"line":352,"column":68},"end":{"line":352,"column":79}},"160":{"start":{"line":364,"column":14},"end":{"line":374,"column":null}},"161":{"start":{"line":368,"column":33},"end":{"line":368,"column":null}},"162":{"start":{"line":368,"column":57},"end":{"line":368,"column":87}},"163":{"start":{"line":368,"column":79},"end":{"line":368,"column":86}},"164":{"start":{"line":390,"column":29},"end":{"line":390,"column":null}},"165":{"start":{"line":407,"column":18},"end":{"line":421,"column":null}},"166":{"start":{"line":412,"column":52},"end":{"line":412,"column":63}},"167":{"start":{"line":412,"column":63},"end":{"line":412,"column":89}},"168":{"start":{"line":412,"column":89},"end":{"line":412,"column":103}},"169":{"start":{"line":417,"column":59},"end":{"line":417,"column":100}},"170":{"start":{"line":417,"column":89},"end":{"line":417,"column":96}},"171":{"start":{"line":426,"column":35},"end":{"line":426,"column":null}},"172":{"start":{"line":440,"column":18},"end":{"line":454,"column":null}},"173":{"start":{"line":445,"column":52},"end":{"line":445,"column":63}},"174":{"start":{"line":445,"column":63},"end":{"line":445,"column":89}},"175":{"start":{"line":445,"column":89},"end":{"line":445,"column":103}},"176":{"start":{"line":450,"column":59},"end":{"line":450,"column":100}},"177":{"start":{"line":450,"column":89},"end":{"line":450,"column":96}},"178":{"start":{"line":459,"column":35},"end":{"line":459,"column":null}},"179":{"start":{"line":481,"column":31},"end":{"line":481,"column":null}},"180":{"start":{"line":493,"column":31},"end":{"line":493,"column":null}},"181":{"start":{"line":507,"column":29},"end":{"line":507,"column":null}},"182":{"start":{"line":508,"column":31},"end":{"line":508,"column":92}},"183":{"start":{"line":508,"column":63},"end":{"line":508,"column":92}},"184":{"start":{"line":517,"column":16},"end":{"line":535,"column":null}},"185":{"start":{"line":521,"column":20},"end":{"line":521,"column":null}},"186":{"start":{"line":522,"column":20},"end":{"line":522,"column":null}},"187":{"start":{"line":523,"column":20},"end":{"line":523,"column":null}},"188":{"start":{"line":524,"column":20},"end":{"line":524,"column":null}},"189":{"start":{"line":525,"column":20},"end":{"line":525,"column":null}},"190":{"start":{"line":526,"column":20},"end":{"line":526,"column":null}},"191":{"start":{"line":548,"column":29},"end":{"line":548,"column":null}},"192":{"start":{"line":549,"column":14},"end":{"line":562,"column":null}},"193":{"start":{"line":554,"column":33},"end":{"line":554,"column":null}},"194":{"start":{"line":572,"column":27},"end":{"line":572,"column":null}},"195":{"start":{"line":573,"column":12},"end":{"line":587,"column":null}},"196":{"start":{"line":578,"column":31},"end":{"line":578,"column":null}},"197":{"start":{"line":598,"column":16},"end":{"line":605,"column":null}},"198":{"start":{"line":601,"column":57},"end":{"line":601,"column":103}},"199":{"start":{"line":601,"column":73},"end":{"line":601,"column":100}},"200":{"start":{"line":601,"column":90},"end":{"line":601,"column":99}},"201":{"start":{"line":610,"column":33},"end":{"line":610,"column":null}},"202":{"start":{"line":612,"column":20},"end":{"line":615,"column":null}},"203":{"start":{"line":613,"column":22},"end":{"line":613,"column":null}},"204":{"start":{"line":614,"column":22},"end":{"line":614,"column":null}},"205":{"start":{"line":641,"column":27},"end":{"line":641,"column":null}}},"fnMap":{"0":{"name":"MJourneyEntrySheet","decl":{"start":{"line":43,"column":24},"end":{"line":43,"column":43}},"loc":{"start":{"line":45,"column":28},"end":{"line":667,"column":null}},"line":45},"1":{"name":"(anonymous_1)","decl":{"start":{"line":78,"column":2},"end":{"line":78,"column":18}},"loc":{"start":{"line":78,"column":18},"end":{"line":113,"column":5}},"line":78},"2":{"name":"(anonymous_2)","decl":{"start":{"line":87,"column":45},"end":{"line":87,"column":51}},"loc":{"start":{"line":87,"column":63},"end":{"line":106,"column":7}},"line":87},"3":{"name":"(anonymous_3)","decl":{"start":{"line":103,"column":8},"end":{"line":103,"column":19}},"loc":{"start":{"line":103,"column":30},"end":{"line":103,"column":122}},"line":103},"4":{"name":"(anonymous_4)","decl":{"start":{"line":106,"column":4},"end":{"line":106,"column":7}},"loc":{"start":{"line":106,"column":16},"end":{"line":110,"column":7}},"line":106},"5":{"name":"(anonymous_5)","decl":{"start":{"line":112,"column":4},"end":{"line":112,"column":17}},"loc":{"start":{"line":112,"column":17},"end":{"line":112,"column":null}},"line":112},"6":{"name":"(anonymous_6)","decl":{"start":{"line":129,"column":8},"end":{"line":129,"column":28}},"loc":{"start":{"line":129,"column":28},"end":{"line":132,"column":null}},"line":129},"7":{"name":"(anonymous_7)","decl":{"start":{"line":134,"column":21},"end":{"line":134,"column":33}},"loc":{"start":{"line":134,"column":33},"end":{"line":179,"column":null}},"line":134},"8":{"name":"(anonymous_8)","decl":{"start":{"line":147,"column":19},"end":{"line":147,"column":26}},"loc":{"start":{"line":147,"column":33},"end":{"line":147,"column":43}},"line":147},"9":{"name":"(anonymous_9)","decl":{"start":{"line":148,"column":32},"end":{"line":148,"column":39}},"loc":{"start":{"line":148,"column":44},"end":{"line":148,"column":52}},"line":148},"10":{"name":"(anonymous_10)","decl":{"start":{"line":148,"column":66},"end":{"line":148,"column":73}},"loc":{"start":{"line":148,"column":78},"end":{"line":148,"column":86}},"line":148},"11":{"name":"(anonymous_11)","decl":{"start":{"line":158,"column":12},"end":{"line":158,"column":24}},"loc":{"start":{"line":158,"column":29},"end":{"line":158,"column":null}},"line":158},"12":{"name":"(anonymous_12)","decl":{"start":{"line":181,"column":27},"end":{"line":181,"column":34}},"loc":{"start":{"line":181,"column":77},"end":{"line":186,"column":null}},"line":181},"13":{"name":"(anonymous_13)","decl":{"start":{"line":185,"column":4},"end":{"line":185,"column":20}},"loc":{"start":{"line":185,"column":28},"end":{"line":185,"column":52}},"line":185},"14":{"name":"(anonymous_14)","decl":{"start":{"line":188,"column":8},"end":{"line":188,"column":26}},"loc":{"start":{"line":188,"column":44},"end":{"line":206,"column":null}},"line":188},"15":{"name":"(anonymous_15)","decl":{"start":{"line":196,"column":42},"end":{"line":196,"column":54}},"loc":{"start":{"line":196,"column":54},"end":{"line":205,"column":7}},"line":196},"16":{"name":"(anonymous_16)","decl":{"start":{"line":199,"column":58},"end":{"line":199,"column":63}},"loc":{"start":{"line":199,"column":150},"end":{"line":201,"column":10}},"line":199},"17":{"name":"(anonymous_17)","decl":{"start":{"line":208,"column":8},"end":{"line":208,"column":23}},"loc":{"start":{"line":208,"column":23},"end":{"line":213,"column":null}},"line":208},"18":{"name":"(anonymous_18)","decl":{"start":{"line":211,"column":31},"end":{"line":211,"column":39}},"loc":{"start":{"line":211,"column":47},"end":{"line":211,"column":63}},"line":211},"19":{"name":"(anonymous_19)","decl":{"start":{"line":215,"column":47},"end":{"line":215,"column":54}},"loc":{"start":{"line":215,"column":60},"end":{"line":215,"column":93}},"line":215},"20":{"name":"(anonymous_20)","decl":{"start":{"line":215,"column":68},"end":{"line":215,"column":73}},"loc":{"start":{"line":215,"column":78},"end":{"line":215,"column":92}},"line":215},"21":{"name":"(anonymous_21)","decl":{"start":{"line":243,"column":12},"end":{"line":243,"column":22}},"loc":{"start":{"line":243,"column":27},"end":{"line":243,"column":null}},"line":243},"22":{"name":"(anonymous_22)","decl":{"start":{"line":251,"column":133},"end":{"line":251,"column":142}},"loc":{"start":{"line":251,"column":147},"end":{"line":251,"column":195}},"line":251},"23":{"name":"(anonymous_23)","decl":{"start":{"line":252,"column":118},"end":{"line":252,"column":127}},"loc":{"start":{"line":252,"column":132},"end":{"line":252,"column":180}},"line":252},"24":{"name":"(anonymous_24)","decl":{"start":{"line":256,"column":16},"end":{"line":256,"column":32}},"loc":{"start":{"line":256,"column":16},"end":{"line":256,"column":null}},"line":256},"25":{"name":"(anonymous_25)","decl":{"start":{"line":274,"column":16},"end":{"line":274,"column":31}},"loc":{"start":{"line":274,"column":31},"end":{"line":274,"column":null}},"line":274},"26":{"name":"(anonymous_26)","decl":{"start":{"line":274,"column":72},"end":{"line":274,"column":91}},"loc":{"start":{"line":274,"column":96},"end":{"line":274,"column":98}},"line":274},"27":{"name":"(anonymous_27)","decl":{"start":{"line":290,"column":42},"end":{"line":290,"column":46}},"loc":{"start":{"line":291,"column":20},"end":{"line":309,"column":null}},"line":291},"28":{"name":"(anonymous_28)","decl":{"start":{"line":296,"column":31},"end":{"line":296,"column":43}},"loc":{"start":{"line":296,"column":43},"end":{"line":306,"column":null}},"line":296},"29":{"name":"(anonymous_29)","decl":{"start":{"line":300,"column":40},"end":{"line":300,"column":50}},"loc":{"start":{"line":300,"column":58},"end":{"line":300,"column":75}},"line":300},"30":{"name":"(anonymous_30)","decl":{"start":{"line":303,"column":26},"end":{"line":303,"column":44}},"loc":{"start":{"line":303,"column":52},"end":{"line":303,"column":68}},"line":303},"31":{"name":"(anonymous_31)","decl":{"start":{"line":304,"column":26},"end":{"line":304,"column":36}},"loc":{"start":{"line":304,"column":44},"end":{"line":304,"column":57}},"line":304},"32":{"name":"(anonymous_32)","decl":{"start":{"line":324,"column":20},"end":{"line":324,"column":25}},"loc":{"start":{"line":325,"column":14},"end":{"line":361,"column":null}},"line":325},"33":{"name":"(anonymous_33)","decl":{"start":{"line":330,"column":20},"end":{"line":330,"column":35}},"loc":{"start":{"line":330,"column":35},"end":{"line":338,"column":null}},"line":330},"34":{"name":"(anonymous_34)","decl":{"start":{"line":331,"column":22},"end":{"line":331,"column":32}},"loc":{"start":{"line":331,"column":40},"end":{"line":337,"column":23}},"line":331},"35":{"name":"(anonymous_35)","decl":{"start":{"line":335,"column":29},"end":{"line":335,"column":38}},"loc":{"start":{"line":335,"column":48},"end":{"line":335,"column":116}},"line":335},"36":{"name":"(anonymous_36)","decl":{"start":{"line":335,"column":99},"end":{"line":335,"column":111}},"loc":{"start":{"line":335,"column":111},"end":{"line":335,"column":113}},"line":335},"37":{"name":"(anonymous_37)","decl":{"start":{"line":347,"column":29},"end":{"line":347,"column":41}},"loc":{"start":{"line":347,"column":41},"end":{"line":354,"column":null}},"line":347},"38":{"name":"(anonymous_38)","decl":{"start":{"line":348,"column":22},"end":{"line":348,"column":32}},"loc":{"start":{"line":348,"column":40},"end":{"line":348,"column":71}},"line":348},"39":{"name":"(anonymous_39)","decl":{"start":{"line":348,"column":45},"end":{"line":348,"column":52}},"loc":{"start":{"line":348,"column":57},"end":{"line":348,"column":70}},"line":348},"40":{"name":"(anonymous_40)","decl":{"start":{"line":352,"column":24},"end":{"line":352,"column":42}},"loc":{"start":{"line":352,"column":50},"end":{"line":352,"column":80}},"line":352},"41":{"name":"(anonymous_41)","decl":{"start":{"line":352,"column":55},"end":{"line":352,"column":62}},"loc":{"start":{"line":352,"column":68},"end":{"line":352,"column":79}},"line":352},"42":{"name":"(anonymous_42)","decl":{"start":{"line":363,"column":26},"end":{"line":363,"column":31}},"loc":{"start":{"line":364,"column":14},"end":{"line":374,"column":null}},"line":364},"43":{"name":"(anonymous_43)","decl":{"start":{"line":368,"column":18},"end":{"line":368,"column":33}},"loc":{"start":{"line":368,"column":33},"end":{"line":368,"column":null}},"line":368},"44":{"name":"(anonymous_44)","decl":{"start":{"line":368,"column":33},"end":{"line":368,"column":49}},"loc":{"start":{"line":368,"column":57},"end":{"line":368,"column":87}},"line":368},"45":{"name":"(anonymous_45)","decl":{"start":{"line":368,"column":62},"end":{"line":368,"column":70}},"loc":{"start":{"line":368,"column":79},"end":{"line":368,"column":86}},"line":368},"46":{"name":"(anonymous_46)","decl":{"start":{"line":390,"column":14},"end":{"line":390,"column":24}},"loc":{"start":{"line":390,"column":29},"end":{"line":390,"column":null}},"line":390},"47":{"name":"(anonymous_47)","decl":{"start":{"line":406,"column":22},"end":{"line":406,"column":27}},"loc":{"start":{"line":407,"column":18},"end":{"line":421,"column":null}},"line":407},"48":{"name":"(anonymous_48)","decl":{"start":{"line":412,"column":22},"end":{"line":412,"column":32}},"loc":{"start":{"line":412,"column":37},"end":{"line":412,"column":null}},"line":412},"49":{"name":"(anonymous_49)","decl":{"start":{"line":417,"column":44},"end":{"line":417,"column":59}},"loc":{"start":{"line":417,"column":59},"end":{"line":417,"column":100}},"line":417},"50":{"name":"(anonymous_50)","decl":{"start":{"line":417,"column":72},"end":{"line":417,"column":80}},"loc":{"start":{"line":417,"column":89},"end":{"line":417,"column":96}},"line":417},"51":{"name":"(anonymous_51)","decl":{"start":{"line":426,"column":20},"end":{"line":426,"column":35}},"loc":{"start":{"line":426,"column":35},"end":{"line":426,"column":null}},"line":426},"52":{"name":"(anonymous_52)","decl":{"start":{"line":439,"column":22},"end":{"line":439,"column":27}},"loc":{"start":{"line":440,"column":18},"end":{"line":454,"column":null}},"line":440},"53":{"name":"(anonymous_53)","decl":{"start":{"line":445,"column":22},"end":{"line":445,"column":32}},"loc":{"start":{"line":445,"column":37},"end":{"line":445,"column":null}},"line":445},"54":{"name":"(anonymous_54)","decl":{"start":{"line":450,"column":44},"end":{"line":450,"column":59}},"loc":{"start":{"line":450,"column":59},"end":{"line":450,"column":100}},"line":450},"55":{"name":"(anonymous_55)","decl":{"start":{"line":450,"column":72},"end":{"line":450,"column":80}},"loc":{"start":{"line":450,"column":89},"end":{"line":450,"column":96}},"line":450},"56":{"name":"(anonymous_56)","decl":{"start":{"line":459,"column":20},"end":{"line":459,"column":35}},"loc":{"start":{"line":459,"column":35},"end":{"line":459,"column":null}},"line":459},"57":{"name":"(anonymous_57)","decl":{"start":{"line":481,"column":16},"end":{"line":481,"column":26}},"loc":{"start":{"line":481,"column":31},"end":{"line":481,"column":null}},"line":481},"58":{"name":"(anonymous_58)","decl":{"start":{"line":493,"column":16},"end":{"line":493,"column":26}},"loc":{"start":{"line":493,"column":31},"end":{"line":493,"column":null}},"line":493},"59":{"name":"(anonymous_59)","decl":{"start":{"line":507,"column":14},"end":{"line":507,"column":24}},"loc":{"start":{"line":507,"column":29},"end":{"line":507,"column":null}},"line":507},"60":{"name":"(anonymous_60)","decl":{"start":{"line":508,"column":14},"end":{"line":508,"column":29}},"loc":{"start":{"line":508,"column":29},"end":{"line":508,"column":null}},"line":508},"61":{"name":"(anonymous_61)","decl":{"start":{"line":516,"column":31},"end":{"line":516,"column":36}},"loc":{"start":{"line":517,"column":16},"end":{"line":535,"column":null}},"line":517},"62":{"name":"(anonymous_62)","decl":{"start":{"line":520,"column":18},"end":{"line":520,"column":33}},"loc":{"start":{"line":520,"column":33},"end":{"line":527,"column":null}},"line":520},"63":{"name":"(anonymous_63)","decl":{"start":{"line":547,"column":26},"end":{"line":547,"column":30}},"loc":{"start":{"line":547,"column":35},"end":{"line":564,"column":13}},"line":547},"64":{"name":"(anonymous_64)","decl":{"start":{"line":554,"column":18},"end":{"line":554,"column":33}},"loc":{"start":{"line":554,"column":33},"end":{"line":554,"column":null}},"line":554},"65":{"name":"(anonymous_65)","decl":{"start":{"line":571,"column":27},"end":{"line":571,"column":31}},"loc":{"start":{"line":571,"column":36},"end":{"line":589,"column":11}},"line":571},"66":{"name":"(anonymous_66)","decl":{"start":{"line":578,"column":16},"end":{"line":578,"column":31}},"loc":{"start":{"line":578,"column":31},"end":{"line":578,"column":null}},"line":578},"67":{"name":"(anonymous_67)","decl":{"start":{"line":597,"column":20},"end":{"line":597,"column":24}},"loc":{"start":{"line":598,"column":16},"end":{"line":605,"column":null}},"line":598},"68":{"name":"(anonymous_68)","decl":{"start":{"line":601,"column":42},"end":{"line":601,"column":57}},"loc":{"start":{"line":601,"column":57},"end":{"line":601,"column":103}},"line":601},"69":{"name":"(anonymous_69)","decl":{"start":{"line":601,"column":57},"end":{"line":601,"column":65}},"loc":{"start":{"line":601,"column":73},"end":{"line":601,"column":100}},"line":601},"70":{"name":"(anonymous_70)","decl":{"start":{"line":601,"column":78},"end":{"line":601,"column":85}},"loc":{"start":{"line":601,"column":90},"end":{"line":601,"column":99}},"line":601},"71":{"name":"(anonymous_71)","decl":{"start":{"line":610,"column":18},"end":{"line":610,"column":28}},"loc":{"start":{"line":610,"column":33},"end":{"line":610,"column":null}},"line":610},"72":{"name":"(anonymous_72)","decl":{"start":{"line":611,"column":18},"end":{"line":611,"column":29}},"loc":{"start":{"line":611,"column":34},"end":{"line":616,"column":null}},"line":611},"73":{"name":"(anonymous_73)","decl":{"start":{"line":641,"column":12},"end":{"line":641,"column":27}},"loc":{"start":{"line":641,"column":27},"end":{"line":641,"column":null}},"line":641}},"branchMap":{"0":{"loc":{"start":{"line":44,"column":24},"end":{"line":44,"column":46}},"type":"default-arg","locations":[{"start":{"line":44,"column":39},"end":{"line":44,"column":46}}],"line":44},"1":{"loc":{"start":{"line":44,"column":46},"end":{"line":44,"column":64}},"type":"default-arg","locations":[{"start":{"line":44,"column":57},"end":{"line":44,"column":64}}],"line":44},"2":{"loc":{"start":{"line":49,"column":37},"end":{"line":49,"column":54}},"type":"binary-expr","locations":[{"start":{"line":49,"column":37},"end":{"line":49,"column":52}},{"start":{"line":49,"column":52},"end":{"line":49,"column":54}}],"line":49},"3":{"loc":{"start":{"line":50,"column":37},"end":{"line":50,"column":54}},"type":"binary-expr","locations":[{"start":{"line":50,"column":37},"end":{"line":50,"column":52}},{"start":{"line":50,"column":52},"end":{"line":50,"column":54}}],"line":50},"4":{"loc":{"start":{"line":51,"column":45},"end":{"line":51,"column":103}},"type":"binary-expr","locations":[{"start":{"line":51,"column":45},"end":{"line":51,"column":65}},{"start":{"line":51,"column":65},"end":{"line":51,"column":103}}],"line":51},"5":{"loc":{"start":{"line":52,"column":45},"end":{"line":52,"column":80}},"type":"binary-expr","locations":[{"start":{"line":52,"column":45},"end":{"line":52,"column":78}},{"start":{"line":52,"column":78},"end":{"line":52,"column":80}}],"line":52},"6":{"loc":{"start":{"line":53,"column":51},"end":{"line":53,"column":76}},"type":"binary-expr","locations":[{"start":{"line":53,"column":51},"end":{"line":53,"column":74}},{"start":{"line":53,"column":74},"end":{"line":53,"column":76}}],"line":53},"7":{"loc":{"start":{"line":54,"column":64},"end":{"line":54,"column":90}},"type":"binary-expr","locations":[{"start":{"line":54,"column":64},"end":{"line":54,"column":86}},{"start":{"line":54,"column":86},"end":{"line":54,"column":90}}],"line":54},"8":{"loc":{"start":{"line":55,"column":64},"end":{"line":55,"column":90}},"type":"binary-expr","locations":[{"start":{"line":55,"column":64},"end":{"line":55,"column":86}},{"start":{"line":55,"column":86},"end":{"line":55,"column":90}}],"line":55},"9":{"loc":{"start":{"line":60,"column":35},"end":{"line":60,"column":51}},"type":"binary-expr","locations":[{"start":{"line":60,"column":35},"end":{"line":60,"column":49}},{"start":{"line":60,"column":49},"end":{"line":60,"column":51}}],"line":60},"10":{"loc":{"start":{"line":61,"column":41},"end":{"line":61,"column":60}},"type":"binary-expr","locations":[{"start":{"line":61,"column":41},"end":{"line":61,"column":58}},{"start":{"line":61,"column":58},"end":{"line":61,"column":60}}],"line":61},"11":{"loc":{"start":{"line":62,"column":45},"end":{"line":62,"column":72}},"type":"binary-expr","locations":[{"start":{"line":62,"column":45},"end":{"line":62,"column":70}},{"start":{"line":62,"column":70},"end":{"line":62,"column":72}}],"line":62},"12":{"loc":{"start":{"line":63,"column":45},"end":{"line":63,"column":72}},"type":"binary-expr","locations":[{"start":{"line":63,"column":45},"end":{"line":63,"column":70}},{"start":{"line":63,"column":70},"end":{"line":63,"column":72}}],"line":63},"13":{"loc":{"start":{"line":64,"column":45},"end":{"line":64,"column":61}},"type":"binary-expr","locations":[{"start":{"line":64,"column":45},"end":{"line":64,"column":59}},{"start":{"line":64,"column":59},"end":{"line":64,"column":61}}],"line":64},"14":{"loc":{"start":{"line":66,"column":72},"end":{"line":66,"column":90}},"type":"binary-expr","locations":[{"start":{"line":66,"column":72},"end":{"line":66,"column":88}},{"start":{"line":66,"column":88},"end":{"line":66,"column":90}}],"line":66},"15":{"loc":{"start":{"line":79,"column":4},"end":{"line":79,"column":null}},"type":"if","locations":[{"start":{"line":79,"column":4},"end":{"line":79,"column":null}},{"start":{},"end":{}}],"line":79},"16":{"loc":{"start":{"line":79,"column":8},"end":{"line":79,"column":95}},"type":"binary-expr","locations":[{"start":{"line":79,"column":8},"end":{"line":79,"column":25}},{"start":{"line":79,"column":25},"end":{"line":79,"column":37}},{"start":{"line":79,"column":37},"end":{"line":79,"column":67}},{"start":{"line":79,"column":67},"end":{"line":79,"column":95}}],"line":79},"17":{"loc":{"start":{"line":80,"column":4},"end":{"line":83,"column":null}},"type":"if","locations":[{"start":{"line":80,"column":4},"end":{"line":83,"column":null}},{"start":{},"end":{}}],"line":80},"18":{"loc":{"start":{"line":90,"column":6},"end":{"line":90,"column":null}},"type":"if","locations":[{"start":{"line":90,"column":6},"end":{"line":90,"column":null}},{"start":{},"end":{}}],"line":90},"19":{"loc":{"start":{"line":98,"column":6},"end":{"line":98,"column":null}},"type":"if","locations":[{"start":{"line":98,"column":6},"end":{"line":98,"column":null}},{"start":{},"end":{}}],"line":98},"20":{"loc":{"start":{"line":99,"column":6},"end":{"line":101,"column":null}},"type":"if","locations":[{"start":{"line":99,"column":6},"end":{"line":101,"column":null}},{"start":{},"end":{}}],"line":99},"21":{"loc":{"start":{"line":100,"column":24},"end":{"line":100,"column":81}},"type":"binary-expr","locations":[{"start":{"line":100,"column":24},"end":{"line":100,"column":50}},{"start":{"line":100,"column":50},"end":{"line":100,"column":79}},{"start":{"line":100,"column":79},"end":{"line":100,"column":81}}],"line":100},"22":{"loc":{"start":{"line":102,"column":6},"end":{"line":104,"column":null}},"type":"if","locations":[{"start":{"line":102,"column":6},"end":{"line":104,"column":null}},{"start":{},"end":{}}],"line":102},"23":{"loc":{"start":{"line":102,"column":10},"end":{"line":102,"column":78}},"type":"binary-expr","locations":[{"start":{"line":102,"column":10},"end":{"line":102,"column":50}},{"start":{"line":102,"column":50},"end":{"line":102,"column":78}}],"line":102},"24":{"loc":{"start":{"line":103,"column":30},"end":{"line":103,"column":122}},"type":"binary-expr","locations":[{"start":{"line":103,"column":30},"end":{"line":103,"column":41}},{"start":{"line":103,"column":30},"end":{"line":103,"column":122}}],"line":103},"25":{"loc":{"start":{"line":107,"column":6},"end":{"line":107,"column":null}},"type":"if","locations":[{"start":{"line":107,"column":6},"end":{"line":107,"column":null}},{"start":{},"end":{}}],"line":107},"26":{"loc":{"start":{"line":108,"column":23},"end":{"line":108,"column":57}},"type":"binary-expr","locations":[{"start":{"line":108,"column":23},"end":{"line":108,"column":40}},{"start":{"line":108,"column":40},"end":{"line":108,"column":57}}],"line":108},"27":{"loc":{"start":{"line":116,"column":4},"end":{"line":127,"column":null}},"type":"binary-expr","locations":[{"start":{"line":116,"column":4},"end":{"line":116,"column":null}},{"start":{"line":117,"column":4},"end":{"line":117,"column":null}},{"start":{"line":118,"column":4},"end":{"line":118,"column":null}},{"start":{"line":119,"column":4},"end":{"line":119,"column":null}},{"start":{"line":120,"column":4},"end":{"line":120,"column":null}},{"start":{"line":121,"column":4},"end":{"line":121,"column":null}},{"start":{"line":122,"column":4},"end":{"line":122,"column":null}},{"start":{"line":123,"column":4},"end":{"line":123,"column":null}},{"start":{"line":124,"column":4},"end":{"line":124,"column":null}},{"start":{"line":125,"column":4},"end":{"line":125,"column":null}},{"start":{"line":126,"column":4},"end":{"line":126,"column":null}},{"start":{"line":127,"column":4},"end":{"line":127,"column":null}}],"line":116},"28":{"loc":{"start":{"line":130,"column":4},"end":{"line":130,"column":null}},"type":"if","locations":[{"start":{"line":130,"column":4},"end":{"line":130,"column":null}},{"start":{},"end":{}}],"line":130},"29":{"loc":{"start":{"line":130,"column":8},"end":{"line":130,"column":108}},"type":"binary-expr","locations":[{"start":{"line":130,"column":8},"end":{"line":130,"column":24}},{"start":{"line":130,"column":24},"end":{"line":130,"column":37}},{"start":{"line":130,"column":37},"end":{"line":130,"column":48}},{"start":{"line":130,"column":48},"end":{"line":130,"column":108}}],"line":130},"30":{"loc":{"start":{"line":138,"column":15},"end":{"line":138,"column":null}},"type":"binary-expr","locations":[{"start":{"line":138,"column":15},"end":{"line":138,"column":24}},{"start":{"line":138,"column":24},"end":{"line":138,"column":null}}],"line":138},"31":{"loc":{"start":{"line":139,"column":15},"end":{"line":139,"column":null}},"type":"binary-expr","locations":[{"start":{"line":139,"column":15},"end":{"line":139,"column":24}},{"start":{"line":139,"column":24},"end":{"line":139,"column":null}}],"line":139},"32":{"loc":{"start":{"line":141,"column":20},"end":{"line":141,"column":null}},"type":"binary-expr","locations":[{"start":{"line":141,"column":20},"end":{"line":141,"column":33}},{"start":{"line":141,"column":33},"end":{"line":141,"column":null}}],"line":141},"33":{"loc":{"start":{"line":142,"column":23},"end":{"line":142,"column":null}},"type":"binary-expr","locations":[{"start":{"line":142,"column":23},"end":{"line":142,"column":39}},{"start":{"line":142,"column":39},"end":{"line":142,"column":null}}],"line":142},"34":{"loc":{"start":{"line":145,"column":14},"end":{"line":145,"column":null}},"type":"binary-expr","locations":[{"start":{"line":145,"column":14},"end":{"line":145,"column":22}},{"start":{"line":145,"column":22},"end":{"line":145,"column":null}}],"line":145},"35":{"loc":{"start":{"line":146,"column":17},"end":{"line":146,"column":null}},"type":"binary-expr","locations":[{"start":{"line":146,"column":17},"end":{"line":146,"column":28}},{"start":{"line":146,"column":28},"end":{"line":146,"column":null}}],"line":146},"36":{"loc":{"start":{"line":149,"column":14},"end":{"line":151,"column":null}},"type":"cond-expr","locations":[{"start":{"line":150,"column":12},"end":{"line":150,"column":null}},{"start":{"line":151,"column":12},"end":{"line":151,"column":null}}],"line":149},"37":{"loc":{"start":{"line":149,"column":14},"end":{"line":149,"column":null}},"type":"binary-expr","locations":[{"start":{"line":149,"column":14},"end":{"line":149,"column":44}},{"start":{"line":149,"column":44},"end":{"line":149,"column":60}},{"start":{"line":149,"column":60},"end":{"line":149,"column":87}},{"start":{"line":149,"column":87},"end":{"line":149,"column":null}}],"line":149},"38":{"loc":{"start":{"line":153,"column":6},"end":{"line":169,"column":null}},"type":"if","locations":[{"start":{"line":153,"column":6},"end":{"line":169,"column":null}},{"start":{},"end":{}}],"line":153},"39":{"loc":{"start":{"line":153,"column":10},"end":{"line":153,"column":46}},"type":"binary-expr","locations":[{"start":{"line":153,"column":10},"end":{"line":153,"column":37}},{"start":{"line":153,"column":37},"end":{"line":153,"column":46}}],"line":153},"40":{"loc":{"start":{"line":161,"column":10},"end":{"line":163,"column":null}},"type":"if","locations":[{"start":{"line":161,"column":10},"end":{"line":163,"column":null}},{"start":{},"end":{}}],"line":161},"41":{"loc":{"start":{"line":170,"column":6},"end":{"line":174,"column":null}},"type":"if","locations":[{"start":{"line":170,"column":6},"end":{"line":174,"column":null}},{"start":{},"end":{}}],"line":170},"42":{"loc":{"start":{"line":170,"column":10},"end":{"line":170,"column":48}},"type":"binary-expr","locations":[{"start":{"line":170,"column":10},"end":{"line":170,"column":39}},{"start":{"line":170,"column":39},"end":{"line":170,"column":48}}],"line":170},"43":{"loc":{"start":{"line":183,"column":4},"end":{"line":183,"column":null}},"type":"if","locations":[{"start":{"line":183,"column":4},"end":{"line":183,"column":null}},{"start":{},"end":{}}],"line":183},"44":{"loc":{"start":{"line":191,"column":4},"end":{"line":191,"column":null}},"type":"if","locations":[{"start":{"line":191,"column":4},"end":{"line":191,"column":null}},{"start":{},"end":{}}],"line":191},"45":{"loc":{"start":{"line":192,"column":4},"end":{"line":195,"column":null}},"type":"if","locations":[{"start":{"line":192,"column":4},"end":{"line":195,"column":null}},{"start":{},"end":{}}],"line":192},"46":{"loc":{"start":{"line":199,"column":28},"end":{"line":199,"column":46}},"type":"binary-expr","locations":[{"start":{"line":199,"column":28},"end":{"line":199,"column":42}},{"start":{"line":199,"column":42},"end":{"line":199,"column":46}}],"line":199},"47":{"loc":{"start":{"line":210,"column":4},"end":{"line":210,"column":null}},"type":"if","locations":[{"start":{"line":210,"column":4},"end":{"line":210,"column":null}},{"start":{},"end":{}}],"line":210},"48":{"loc":{"start":{"line":211,"column":4},"end":{"line":211,"column":null}},"type":"if","locations":[{"start":{"line":211,"column":4},"end":{"line":211,"column":null}},{"start":{},"end":{}}],"line":211},"49":{"loc":{"start":{"line":226,"column":17},"end":{"line":226,"column":null}},"type":"cond-expr","locations":[{"start":{"line":226,"column":34},"end":{"line":226,"column":65}},{"start":{"line":226,"column":65},"end":{"line":226,"column":null}}],"line":226},"50":{"loc":{"start":{"line":230,"column":11},"end":{"line":230,"column":null}},"type":"cond-expr","locations":[{"start":{"line":230,"column":28},"end":{"line":230,"column":59}},{"start":{"line":230,"column":59},"end":{"line":230,"column":null}}],"line":230},"51":{"loc":{"start":{"line":238,"column":9},"end":{"line":246,"column":null}},"type":"binary-expr","locations":[{"start":{"line":238,"column":9},"end":{"line":238,"column":26}},{"start":{"line":238,"column":26},"end":{"line":246,"column":null}}],"line":238},"52":{"loc":{"start":{"line":238,"column":26},"end":{"line":246,"column":null}},"type":"cond-expr","locations":[{"start":{"line":239,"column":10},"end":{"line":241,"column":11}},{"start":{"line":241,"column":10},"end":{"line":246,"column":null}}],"line":238},"53":{"loc":{"start":{"line":239,"column":73},"end":{"line":239,"column":124}},"type":"binary-expr","locations":[{"start":{"line":239,"column":73},"end":{"line":239,"column":82}},{"start":{"line":239,"column":82},"end":{"line":239,"column":124}}],"line":239},"54":{"loc":{"start":{"line":249,"column":9},"end":{"line":319,"column":null}},"type":"binary-expr","locations":[{"start":{"line":249,"column":9},"end":{"line":249,"column":null}},{"start":{"line":250,"column":10},"end":{"line":319,"column":null}}],"line":249},"55":{"loc":{"start":{"line":256,"column":32},"end":{"line":256,"column":67}},"type":"cond-expr","locations":[{"start":{"line":256,"column":46},"end":{"line":256,"column":58}},{"start":{"line":256,"column":58},"end":{"line":256,"column":67}}],"line":256},"56":{"loc":{"start":{"line":260,"column":17},"end":{"line":269,"column":null}},"type":"cond-expr","locations":[{"start":{"line":261,"column":18},"end":{"line":266,"column":null}},{"start":{"line":266,"column":18},"end":{"line":269,"column":null}}],"line":260},"57":{"loc":{"start":{"line":267,"column":21},"end":{"line":268,"column":35}},"type":"cond-expr","locations":[{"start":{"line":267,"column":35},"end":{"line":267,"column":77}},{"start":{"line":267,"column":76},"end":{"line":268,"column":35}}],"line":267},"58":{"loc":{"start":{"line":268,"column":21},"end":{"line":268,"column":null}},"type":"cond-expr","locations":[{"start":{"line":268,"column":35},"end":{"line":268,"column":60}},{"start":{"line":268,"column":60},"end":{"line":268,"column":null}}],"line":268},"59":{"loc":{"start":{"line":274,"column":31},"end":{"line":274,"column":null}},"type":"cond-expr","locations":[{"start":{"line":274,"column":45},"end":{"line":274,"column":72}},{"start":{"line":274,"column":72},"end":{"line":274,"column":null}}],"line":274},"60":{"loc":{"start":{"line":275,"column":26},"end":{"line":275,"column":null}},"type":"binary-expr","locations":[{"start":{"line":275,"column":26},"end":{"line":275,"column":42}},{"start":{"line":275,"column":42},"end":{"line":275,"column":null}}],"line":275},"61":{"loc":{"start":{"line":277,"column":18},"end":{"line":279,"column":null}},"type":"cond-expr","locations":[{"start":{"line":278,"column":22},"end":{"line":278,"column":null}},{"start":{"line":279,"column":22},"end":{"line":279,"column":null}}],"line":277},"62":{"loc":{"start":{"line":277,"column":18},"end":{"line":277,"column":null}},"type":"binary-expr","locations":[{"start":{"line":277,"column":18},"end":{"line":277,"column":34}},{"start":{"line":277,"column":34},"end":{"line":277,"column":null}}],"line":277},"63":{"loc":{"start":{"line":283,"column":17},"end":{"line":283,"column":null}},"type":"cond-expr","locations":[{"start":{"line":283,"column":31},"end":{"line":283,"column":60}},{"start":{"line":283,"column":60},"end":{"line":283,"column":null}}],"line":283},"64":{"loc":{"start":{"line":287,"column":13},"end":{"line":317,"column":null}},"type":"binary-expr","locations":[{"start":{"line":287,"column":13},"end":{"line":287,"column":29}},{"start":{"line":287,"column":29},"end":{"line":287,"column":null}},{"start":{"line":288,"column":14},"end":{"line":317,"column":null}}],"line":287},"65":{"loc":{"start":{"line":297,"column":24},"end":{"line":305,"column":null}},"type":"if","locations":[{"start":{"line":297,"column":24},"end":{"line":305,"column":null}},{"start":{"line":302,"column":31},"end":{"line":305,"column":null}}],"line":297},"66":{"loc":{"start":{"line":300,"column":28},"end":{"line":300,"column":null}},"type":"if","locations":[{"start":{"line":300,"column":28},"end":{"line":300,"column":null}},{"start":{},"end":{}}],"line":300},"67":{"loc":{"start":{"line":311,"column":19},"end":{"line":316,"column":null}},"type":"binary-expr","locations":[{"start":{"line":311,"column":19},"end":{"line":311,"column":null}},{"start":{"line":312,"column":20},"end":{"line":316,"column":null}}],"line":311},"68":{"loc":{"start":{"line":322,"column":10},"end":{"line":376,"column":null}},"type":"binary-expr","locations":[{"start":{"line":322,"column":10},"end":{"line":322,"column":31}},{"start":{"line":322,"column":31},"end":{"line":322,"column":null}},{"start":{"line":323,"column":10},"end":{"line":376,"column":null}}],"line":322},"69":{"loc":{"start":{"line":327,"column":17},"end":{"line":342,"column":null}},"type":"binary-expr","locations":[{"start":{"line":327,"column":17},"end":{"line":327,"column":30}},{"start":{"line":327,"column":30},"end":{"line":327,"column":41}},{"start":{"line":327,"column":41},"end":{"line":327,"column":null}},{"start":{"line":328,"column":18},"end":{"line":342,"column":null}}],"line":327},"70":{"loc":{"start":{"line":344,"column":17},"end":{"line":359,"column":null}},"type":"binary-expr","locations":[{"start":{"line":344,"column":17},"end":{"line":344,"column":null}},{"start":{"line":345,"column":18},"end":{"line":359,"column":null}}],"line":344},"71":{"loc":{"start":{"line":349,"column":22},"end":{"line":353,"column":null}},"type":"if","locations":[{"start":{"line":349,"column":22},"end":{"line":353,"column":null}},{"start":{"line":351,"column":29},"end":{"line":353,"column":null}}],"line":349},"72":{"loc":{"start":{"line":379,"column":9},"end":{"line":470,"column":null}},"type":"binary-expr","locations":[{"start":{"line":379,"column":9},"end":{"line":379,"column":25}},{"start":{"line":379,"column":25},"end":{"line":470,"column":null}}],"line":379},"73":{"loc":{"start":{"line":380,"column":11},"end":{"line":397,"column":13}},"type":"cond-expr","locations":[{"start":{"line":381,"column":12},"end":{"line":387,"column":13}},{"start":{"line":387,"column":12},"end":{"line":397,"column":13}}],"line":380},"74":{"loc":{"start":{"line":381,"column":12},"end":{"line":387,"column":13}},"type":"binary-expr","locations":[{"start":{"line":381,"column":12},"end":{"line":381,"column":null}},{"start":{"line":382,"column":14},"end":{"line":387,"column":13}}],"line":381},"75":{"loc":{"start":{"line":397,"column":12},"end":{"line":470,"column":null}},"type":"binary-expr","locations":[{"start":{"line":397,"column":12},"end":{"line":397,"column":25}},{"start":{"line":397,"column":25},"end":{"line":397,"column":44}},{"start":{"line":397,"column":44},"end":{"line":397,"column":null}},{"start":{"line":398,"column":10},"end":{"line":470,"column":null}}],"line":397},"76":{"loc":{"start":{"line":416,"column":21},"end":{"line":419,"column":null}},"type":"binary-expr","locations":[{"start":{"line":416,"column":21},"end":{"line":416,"column":null}},{"start":{"line":417,"column":22},"end":{"line":419,"column":null}}],"line":416},"77":{"loc":{"start":{"line":423,"column":17},"end":{"line":431,"column":null}},"type":"binary-expr","locations":[{"start":{"line":423,"column":17},"end":{"line":423,"column":null}},{"start":{"line":424,"column":18},"end":{"line":431,"column":null}}],"line":423},"78":{"loc":{"start":{"line":449,"column":21},"end":{"line":452,"column":null}},"type":"binary-expr","locations":[{"start":{"line":449,"column":21},"end":{"line":449,"column":null}},{"start":{"line":450,"column":22},"end":{"line":452,"column":null}}],"line":449},"79":{"loc":{"start":{"line":456,"column":17},"end":{"line":464,"column":null}},"type":"binary-expr","locations":[{"start":{"line":456,"column":17},"end":{"line":456,"column":null}},{"start":{"line":457,"column":18},"end":{"line":464,"column":null}}],"line":456},"80":{"loc":{"start":{"line":505,"column":21},"end":{"line":505,"column":null}},"type":"binary-expr","locations":[{"start":{"line":505,"column":21},"end":{"line":505,"column":38}},{"start":{"line":505,"column":38},"end":{"line":505,"column":null}}],"line":505},"81":{"loc":{"start":{"line":508,"column":31},"end":{"line":508,"column":92}},"type":"if","locations":[{"start":{"line":508,"column":31},"end":{"line":508,"column":92}},{"start":{},"end":{}}],"line":508},"82":{"loc":{"start":{"line":512,"column":13},"end":{"line":513,"column":null}},"type":"binary-expr","locations":[{"start":{"line":512,"column":13},"end":{"line":512,"column":36}},{"start":{"line":512,"column":36},"end":{"line":513,"column":null}}],"line":512},"83":{"loc":{"start":{"line":514,"column":11},"end":{"line":537,"column":null}},"type":"binary-expr","locations":[{"start":{"line":514,"column":11},"end":{"line":514,"column":34}},{"start":{"line":514,"column":34},"end":{"line":514,"column":null}},{"start":{"line":515,"column":12},"end":{"line":537,"column":null}}],"line":514},"84":{"loc":{"start":{"line":533,"column":21},"end":{"line":534,"column":null}},"type":"binary-expr","locations":[{"start":{"line":533,"column":21},"end":{"line":533,"column":34}},{"start":{"line":533,"column":34},"end":{"line":534,"column":null}}],"line":533},"85":{"loc":{"start":{"line":539,"column":11},"end":{"line":539,"column":null}},"type":"binary-expr","locations":[{"start":{"line":539,"column":11},"end":{"line":539,"column":23}},{"start":{"line":539,"column":23},"end":{"line":539,"column":null}}],"line":539},"86":{"loc":{"start":{"line":540,"column":11},"end":{"line":540,"column":null}},"type":"binary-expr","locations":[{"start":{"line":540,"column":11},"end":{"line":540,"column":28}},{"start":{"line":540,"column":28},"end":{"line":540,"column":null}}],"line":540},"87":{"loc":{"start":{"line":544,"column":9},"end":{"line":566,"column":null}},"type":"binary-expr","locations":[{"start":{"line":544,"column":9},"end":{"line":544,"column":25}},{"start":{"line":544,"column":25},"end":{"line":566,"column":null}}],"line":544},"88":{"loc":{"start":{"line":554,"column":41},"end":{"line":554,"column":59}},"type":"cond-expr","locations":[{"start":{"line":554,"column":50},"end":{"line":554,"column":55}},{"start":{"line":554,"column":55},"end":{"line":554,"column":59}}],"line":554},"89":{"loc":{"start":{"line":556,"column":20},"end":{"line":556,"column":null}},"type":"cond-expr","locations":[{"start":{"line":556,"column":29},"end":{"line":556,"column":34}},{"start":{"line":556,"column":34},"end":{"line":556,"column":null}}],"line":556},"90":{"loc":{"start":{"line":558,"column":25},"end":{"line":558,"column":null}},"type":"cond-expr","locations":[{"start":{"line":558,"column":34},"end":{"line":558,"column":112}},{"start":{"line":558,"column":112},"end":{"line":558,"column":null}}],"line":558},"91":{"loc":{"start":{"line":578,"column":42},"end":{"line":578,"column":60}},"type":"cond-expr","locations":[{"start":{"line":578,"column":51},"end":{"line":578,"column":56}},{"start":{"line":578,"column":56},"end":{"line":578,"column":60}}],"line":578},"92":{"loc":{"start":{"line":580,"column":18},"end":{"line":582,"column":null}},"type":"cond-expr","locations":[{"start":{"line":581,"column":22},"end":{"line":581,"column":null}},{"start":{"line":582,"column":22},"end":{"line":582,"column":null}}],"line":580},"93":{"loc":{"start":{"line":593,"column":9},"end":{"line":623,"column":null}},"type":"binary-expr","locations":[{"start":{"line":593,"column":9},"end":{"line":593,"column":26}},{"start":{"line":593,"column":26},"end":{"line":593,"column":39}},{"start":{"line":593,"column":39},"end":{"line":593,"column":null}},{"start":{"line":594,"column":10},"end":{"line":623,"column":null}}],"line":593},"94":{"loc":{"start":{"line":600,"column":19},"end":{"line":605,"column":null}},"type":"binary-expr","locations":[{"start":{"line":600,"column":19},"end":{"line":600,"column":null}},{"start":{"line":601,"column":20},"end":{"line":605,"column":null}}],"line":600},"95":{"loc":{"start":{"line":607,"column":15},"end":{"line":622,"column":null}},"type":"binary-expr","locations":[{"start":{"line":607,"column":15},"end":{"line":607,"column":null}},{"start":{"line":608,"column":16},"end":{"line":622,"column":null}}],"line":607},"96":{"loc":{"start":{"line":612,"column":20},"end":{"line":615,"column":null}},"type":"if","locations":[{"start":{"line":612,"column":20},"end":{"line":615,"column":null}},{"start":{},"end":{}}],"line":612},"97":{"loc":{"start":{"line":612,"column":24},"end":{"line":612,"column":60}},"type":"binary-expr","locations":[{"start":{"line":612,"column":24},"end":{"line":612,"column":45}},{"start":{"line":612,"column":45},"end":{"line":612,"column":60}}],"line":612},"98":{"loc":{"start":{"line":628,"column":9},"end":{"line":636,"column":null}},"type":"binary-expr","locations":[{"start":{"line":628,"column":9},"end":{"line":628,"column":22}},{"start":{"line":628,"column":22},"end":{"line":628,"column":null}},{"start":{"line":629,"column":10},"end":{"line":636,"column":null}}],"line":628},"99":{"loc":{"start":{"line":638,"column":9},"end":{"line":645,"column":null}},"type":"binary-expr","locations":[{"start":{"line":638,"column":9},"end":{"line":638,"column":22}},{"start":{"line":638,"column":22},"end":{"line":638,"column":null}},{"start":{"line":639,"column":10},"end":{"line":645,"column":null}}],"line":638},"100":{"loc":{"start":{"line":654,"column":9},"end":{"line":662,"column":null}},"type":"binary-expr","locations":[{"start":{"line":654,"column":9},"end":{"line":654,"column":null}},{"start":{"line":655,"column":10},"end":{"line":662,"column":null}}],"line":654},"101":{"loc":{"start":{"line":661,"column":13},"end":{"line":661,"column":null}},"type":"cond-expr","locations":[{"start":{"line":661,"column":22},"end":{"line":661,"column":43}},{"start":{"line":661,"column":43},"end":{"line":661,"column":null}}],"line":661}},"s":{"0":1,"1":1,"2":199,"3":199,"4":199,"5":199,"6":199,"7":199,"8":199,"9":199,"10":199,"11":199,"12":199,"13":199,"14":199,"15":199,"16":199,"17":199,"18":199,"19":199,"20":199,"21":199,"22":199,"23":199,"24":199,"25":199,"26":199,"27":199,"28":199,"29":199,"30":199,"31":199,"32":199,"33":43,"34":32,"35":11,"36":1,"37":1,"38":10,"39":10,"40":10,"41":9,"42":9,"43":9,"44":1,"45":8,"46":8,"47":8,"48":8,"49":1,"50":7,"51":6,"52":7,"53":2,"54":2,"55":7,"56":3,"57":1,"58":2,"59":3,"60":10,"61":10,"62":199,"63":199,"64":5,"65":1,"66":4,"67":199,"68":15,"69":15,"70":15,"71":3,"72":4,"73":3,"74":15,"75":3,"76":3,"77":3,"78":3,"79":1,"80":2,"81":2,"82":1,"83":1,"84":3,"85":15,"86":1,"87":1,"88":1,"89":15,"90":15,"91":199,"92":5,"93":5,"94":1,"95":4,"96":4,"97":4,"98":199,"99":6,"100":6,"101":6,"102":2,"103":6,"104":1,"105":1,"106":5,"107":4,"108":4,"109":3,"110":3,"111":1,"112":199,"113":4,"114":4,"115":1,"116":3,"117":3,"118":2,"119":3,"120":199,"121":19,"122":7,"123":199,"124":199,"125":199,"126":5,"127":1,"128":2,"129":2,"130":6,"131":5,"132":8,"133":5,"134":3,"135":3,"136":2,"137":2,"138":1,"139":2,"140":2,"141":2,"142":2,"143":16,"144":2,"145":2,"146":2,"147":2,"148":2,"149":4,"150":2,"151":2,"152":2,"153":2,"154":2,"155":1,"156":1,"157":1,"158":1,"159":1,"160":10,"161":1,"162":1,"163":1,"164":17,"165":94,"166":11,"167":11,"168":11,"169":1,"170":2,"171":2,"172":60,"173":17,"174":17,"175":17,"176":1,"177":2,"178":1,"179":1,"180":1,"181":6,"182":2,"183":1,"184":4,"185":1,"186":1,"187":1,"188":1,"189":1,"190":1,"191":664,"192":664,"193":2,"194":1194,"195":1194,"196":2,"197":33,"198":1,"199":1,"200":2,"201":12,"202":15,"203":3,"204":3,"205":1},"f":{"0":199,"1":43,"2":9,"3":2,"4":3,"5":10,"6":5,"7":15,"8":3,"9":4,"10":3,"11":1,"12":5,"13":4,"14":6,"15":4,"16":3,"17":4,"18":2,"19":19,"20":7,"21":5,"22":1,"23":2,"24":2,"25":6,"26":5,"27":8,"28":5,"29":1,"30":2,"31":2,"32":16,"33":2,"34":2,"35":4,"36":2,"37":2,"38":2,"39":2,"40":1,"41":1,"42":10,"43":1,"44":1,"45":1,"46":17,"47":94,"48":11,"49":1,"50":2,"51":2,"52":60,"53":17,"54":1,"55":2,"56":1,"57":1,"58":1,"59":6,"60":2,"61":4,"62":1,"63":664,"64":2,"65":1194,"66":2,"67":33,"68":1,"69":1,"70":2,"71":12,"72":15,"73":1},"b":{"0":[199],"1":[199],"2":[199,190],"3":[199,197],"4":[199,1],"5":[199,174],"6":[199,196],"7":[199,196],"8":[199,196],"9":[199,192],"10":[199,192],"11":[199,173],"12":[199,173],"13":[199,193],"14":[199,2],"15":[32,11],"16":[43,12,12,11],"17":[1,10],"18":[1,8],"19":[1,7],"20":[6,1],"21":[6,3,3],"22":[2,5],"23":[7,7],"24":[2,2],"25":[1,2],"26":[2,1],"27":[199,149,139,136,136,129,125,124,102,102,99,89],"28":[1,4],"29":[5,4,3,2],"30":[15,13],"31":[15,13],"32":[15,12],"33":[15,13],"34":[15,14],"35":[15,13],"36":[1,14],"37":[15,2,1,1],"38":[3,12],"39":[15,3],"40":[1,1],"41":[1,14],"42":[15,1],"43":[1,4],"44":[2,4],"45":[1,5],"46":[3,1],"47":[1,3],"48":[2,1],"49":[113,86],"50":[113,86],"51":[199,166],"52":[3,163],"53":[3,1],"54":[199,196],"55":[1,1],"56":[1,195],"57":[33,162],"58":[33,162],"59":[1,5],"60":[196,163],"61":[13,183],"62":[196,163],"63":[33,163],"64":[196,163,13],"65":[3,2],"66":[1,1],"67":[13,5],"68":[199,188,21],"69":[16,14,4,4],"70":[16,14],"71":[1,1],"72":[199,166],"73":[3,163],"74":[3,1],"75":[166,3,2,164],"76":[94,93],"77":[164,163],"78":[60,59],"79":[164,163],"80":[199,188],"81":[1,1],"82":[199,25],"83":[199,11,3],"84":[4,3],"85":[199,10],"86":[199,5],"87":[199,166],"88":[1,1],"89":[7,657],"90":[7,657],"91":[1,1],"92":[11,1183],"93":[199,166,3,164],"94":[33,32],"95":[164,163],"96":[3,12],"97":[15,13],"98":[199,196,1],"99":[199,196,33],"100":[199,196],"101":[16,180]},"meta":{"lastBranch":102,"lastFunction":74,"lastStatement":206,"seen":{"s:16:18:16:Infinity":0,"s:17:18:17:Infinity":1,"f:43:24:43:43":0,"b:44:39:44:46":0,"b:44:57:44:64":1,"s:46:10:46:Infinity":2,"s:47:8:47:Infinity":3,"s:49:16:49:Infinity":4,"b:49:37:49:52:49:52:49:54":2,"s:50:16:50:Infinity":5,"b:50:37:50:52:50:52:50:54":3,"s:51:20:51:Infinity":6,"b:51:45:51:65:51:65:51:103":4,"s:52:20:52:Infinity":7,"b:52:45:52:78:52:78:52:80":5,"s:53:23:53:Infinity":8,"b:53:51:53:74:53:74:53:76":6,"s:54:22:54:Infinity":9,"b:54:64:54:86:54:86:54:90":7,"s:55:22:55:Infinity":10,"b:55:64:55:86:55:86:55:90":8,"s:56:24:56:Infinity":11,"s:57:26:57:Infinity":12,"s:58:30:58:Infinity":13,"s:59:8:59:Infinity":14,"s:60:15:60:Infinity":15,"b:60:35:60:49:60:49:60:51":9,"s:61:18:61:Infinity":16,"b:61:41:61:58:61:58:61:60":10,"s:62:15:62:Infinity":17,"b:62:45:62:70:62:70:62:72":11,"s:63:15:63:Infinity":18,"b:63:45:63:70:63:70:63:72":12,"s:64:15:64:Infinity":19,"b:64:45:64:59:64:59:64:61":13,"s:65:19:65:Infinity":20,"s:66:17:66:Infinity":21,"b:66:72:66:88:66:88:66:90":14,"s:67:23:67:Infinity":22,"s:68:25:68:Infinity":23,"s:69:26:69:Infinity":24,"s:70:17:70:Infinity":25,"s:71:22:71:Infinity":26,"s:72:19:72:Infinity":27,"s:73:24:73:Infinity":28,"s:74:25:74:Infinity":29,"s:75:8:75:Infinity":30,"s:76:8:76:Infinity":31,"s:78:2:113:Infinity":32,"f:78:2:78:18":1,"b:79:4:79:Infinity:undefined:undefined:undefined:undefined":15,"s:79:4:79:Infinity":33,"b:79:8:79:25:79:25:79:37:79:37:79:67:79:67:79:95":16,"s:79:95:79:Infinity":34,"b:80:4:83:Infinity:undefined:undefined:undefined:undefined":17,"s:80:4:83:Infinity":35,"s:81:6:81:Infinity":36,"s:82:6:82:Infinity":37,"s:85:17:85:Infinity":38,"s:86:4:86:Infinity":39,"s:87:4:110:Infinity":40,"f:87:45:87:51":2,"s:88:18:88:Infinity":41,"s:89:18:89:Infinity":42,"b:90:6:90:Infinity:undefined:undefined:undefined:undefined":18,"s:90:6:90:Infinity":43,"s:90:19:90:Infinity":44,"s:91:6:91:Infinity":45,"s:92:6:92:Infinity":46,"s:94:43:97:Infinity":47,"b:98:6:98:Infinity:undefined:undefined:undefined:undefined":19,"s:98:6:98:Infinity":48,"s:98:19:98:Infinity":49,"b:99:6:101:Infinity:undefined:undefined:undefined:undefined":20,"s:99:6:101:Infinity":50,"s:100:8:100:Infinity":51,"b:100:24:100:50:100:50:100:79:100:79:100:81":21,"b:102:6:104:Infinity:undefined:undefined:undefined:undefined":22,"s:102:6:104:Infinity":52,"b:102:10:102:50:102:50:102:78":23,"s:103:8:103:Infinity":53,"f:103:8:103:19":3,"s:103:30:103:122":54,"b:103:30:103:41:103:30:103:122":24,"s:105:6:105:Infinity":55,"f:106:4:106:7":4,"b:107:6:107:Infinity:undefined:undefined:undefined:undefined":25,"s:107:6:107:Infinity":56,"s:107:19:107:Infinity":57,"s:108:6:108:Infinity":58,"b:108:23:108:40:108:40:108:57":26,"s:109:6:109:Infinity":59,"s:112:4:112:Infinity":60,"f:112:4:112:17":5,"s:112:19:112:34":61,"s:116:4:127:Infinity":62,"b:116:4:116:Infinity:117:4:117:Infinity:118:4:118:Infinity:119:4:119:Infinity:120:4:120:Infinity:121:4:121:Infinity:122:4:122:Infinity:123:4:123:Infinity:124:4:124:Infinity:125:4:125:Infinity:126:4:126:Infinity:127:4:127:Infinity":27,"s:129:8:132:Infinity":63,"f:129:8:129:28":6,"b:130:4:130:Infinity:undefined:undefined:undefined:undefined":28,"s:130:4:130:Infinity":64,"b:130:8:130:24:130:24:130:37:130:37:130:48:130:48:130:108":29,"s:130:108:130:Infinity":65,"s:131:4:131:Infinity":66,"s:134:21:179:Infinity":67,"f:134:21:134:33":7,"s:135:4:135:Infinity":68,"s:136:4:178:Infinity":69,"s:137:22:152:Infinity":70,"b:138:15:138:24:138:24:138:Infinity":30,"b:139:15:139:24:139:24:139:Infinity":31,"b:141:20:141:33:141:33:141:Infinity":32,"b:142:23:142:39:142:39:142:Infinity":33,"b:145:14:145:22:145:22:145:Infinity":34,"b:146:17:146:28:146:28:146:Infinity":35,"f:147:19:147:26":8,"s:147:33:147:43":71,"f:148:32:148:39":9,"s:148:44:148:52":72,"f:148:66:148:73":10,"s:148:78:148:86":73,"b:150:12:150:Infinity:151:12:151:Infinity":36,"b:149:14:149:44:149:44:149:60:149:60:149:87:149:87:149:Infinity":37,"b:153:6:169:Infinity:undefined:undefined:undefined:undefined":38,"s:153:6:169:Infinity":74,"b:153:10:153:37:153:37:153:46":39,"s:154:25:154:Infinity":75,"s:155:8:155:Infinity":76,"s:156:8:168:Infinity":77,"s:157:29:159:Infinity":78,"f:158:12:158:24":11,"s:158:29:158:Infinity":79,"s:160:10:160:Infinity":80,"b:161:10:163:Infinity:undefined:undefined:undefined:undefined":40,"s:161:10:163:Infinity":81,"s:162:12:162:Infinity":82,"s:165:10:165:Infinity":83,"s:167:10:167:Infinity":84,"b:170:6:174:Infinity:undefined:undefined:undefined:undefined":41,"s:170:6:174:Infinity":85,"b:170:10:170:39:170:39:170:48":42,"s:171:8:173:Infinity":86,"s:172:10:172:Infinity":87,"s:172:16:172:61":88,"s:175:6:175:Infinity":89,"s:177:6:177:Infinity":90,"s:181:27:186:Infinity":91,"f:181:27:181:34":12,"s:182:18:182:Infinity":92,"b:183:4:183:Infinity:undefined:undefined:undefined:undefined":43,"s:183:4:183:Infinity":93,"s:183:24:183:Infinity":94,"s:184:23:184:Infinity":95,"s:185:4:185:Infinity":96,"f:185:4:185:20":13,"s:185:28:185:52":97,"s:188:8:206:Infinity":98,"f:188:8:188:26":14,"s:189:4:189:Infinity":99,"s:190:4:190:Infinity":100,"b:191:4:191:Infinity:undefined:undefined:undefined:undefined":44,"s:191:4:191:Infinity":101,"s:191:34:191:Infinity":102,"b:192:4:195:Infinity:undefined:undefined:undefined:undefined":45,"s:192:4:195:Infinity":103,"s:193:6:193:Infinity":104,"s:194:6:194:Infinity":105,"s:196:4:205:Infinity":106,"f:196:42:196:54":15,"s:197:6:204:Infinity":107,"s:198:20:198:Infinity":108,"s:199:8:201:Infinity":109,"b:199:28:199:42:199:42:199:46":46,"f:199:58:199:63":16,"s:199:150:201:10":110,"s:203:8:203:Infinity":111,"s:208:8:213:Infinity":112,"f:208:8:208:23":17,"s:209:18:209:Infinity":113,"b:210:4:210:Infinity:undefined:undefined:undefined:undefined":47,"s:210:4:210:Infinity":114,"s:210:16:210:Infinity":115,"b:211:4:211:Infinity:undefined:undefined:undefined:undefined":48,"s:211:4:211:Infinity":116,"s:211:31:211:Infinity":117,"f:211:31:211:39":18,"s:211:47:211:63":118,"s:212:4:212:Infinity":119,"s:215:33:215:Infinity":120,"f:215:47:215:54":19,"s:215:60:215:93":121,"f:215:68:215:73":20,"s:215:78:215:92":122,"s:217:18:217:Infinity":123,"s:218:21:218:Infinity":124,"s:220:2:665:Infinity":125,"b:226:34:226:65:226:65:226:Infinity":49,"b:230:28:230:59:230:59:230:Infinity":50,"b:238:9:238:26:238:26:246:Infinity":51,"b:239:10:241:11:241:10:246:Infinity":52,"b:239:73:239:82:239:82:239:124":53,"f:243:12:243:22":21,"s:243:27:243:Infinity":126,"b:249:9:249:Infinity:250:10:319:Infinity":54,"f:251:133:251:142":22,"s:251:149:251:191":127,"f:252:118:252:127":23,"s:252:134:252:176":128,"f:256:16:256:32":24,"s:256:16:256:Infinity":129,"b:256:46:256:58:256:58:256:67":55,"b:261:18:266:Infinity:266:18:269:Infinity":56,"b:267:35:267:77:267:76:268:35":57,"b:268:35:268:60:268:60:268:Infinity":58,"f:274:16:274:31":25,"s:274:31:274:Infinity":130,"b:274:45:274:72:274:72:274:Infinity":59,"f:274:72:274:91":26,"s:274:96:274:98":131,"b:275:26:275:42:275:42:275:Infinity":60,"b:278:22:278:Infinity:279:22:279:Infinity":61,"b:277:18:277:34:277:34:277:Infinity":62,"b:283:31:283:60:283:60:283:Infinity":63,"b:287:13:287:29:287:29:287:Infinity:288:14:317:Infinity":64,"f:290:42:290:46":27,"s:291:20:309:Infinity":132,"f:296:31:296:43":28,"b:297:24:305:Infinity:302:31:305:Infinity":65,"s:297:24:305:Infinity":133,"s:298:26:301:Infinity":134,"s:299:43:299:Infinity":135,"b:300:28:300:Infinity:undefined:undefined:undefined:undefined":66,"s:300:28:300:Infinity":136,"s:300:40:300:Infinity":137,"f:300:40:300:50":29,"s:300:58:300:75":138,"s:303:26:303:Infinity":139,"f:303:26:303:44":30,"s:303:52:303:68":140,"s:304:26:304:Infinity":141,"f:304:26:304:36":31,"s:304:44:304:57":142,"b:311:19:311:Infinity:312:20:316:Infinity":67,"b:322:10:322:31:322:31:322:Infinity:323:10:376:Infinity":68,"f:324:20:324:25":32,"s:325:14:361:Infinity":143,"b:327:17:327:30:327:30:327:41:327:41:327:Infinity:328:18:342:Infinity":69,"f:330:20:330:35":33,"s:331:22:337:Infinity":144,"f:331:22:331:32":34,"s:332:37:332:Infinity":145,"s:333:40:333:Infinity":146,"s:334:24:334:Infinity":147,"s:335:24:335:Infinity":148,"f:335:29:335:38":35,"s:335:50:335:115":149,"f:335:99:335:111":36,"s:336:24:336:Infinity":150,"b:344:17:344:Infinity:345:18:359:Infinity":70,"f:347:29:347:41":37,"s:348:22:348:Infinity":151,"f:348:22:348:32":38,"s:348:40:348:71":152,"f:348:45:348:52":39,"s:348:57:348:70":153,"b:349:22:353:Infinity:351:29:353:Infinity":71,"s:349:22:353:Infinity":154,"s:350:24:350:Infinity":155,"s:350:30:350:75":156,"s:352:24:352:Infinity":157,"f:352:24:352:42":40,"s:352:50:352:80":158,"f:352:55:352:62":41,"s:352:68:352:79":159,"f:363:26:363:31":42,"s:364:14:374:Infinity":160,"f:368:18:368:33":43,"s:368:33:368:Infinity":161,"f:368:33:368:49":44,"s:368:57:368:87":162,"f:368:62:368:70":45,"s:368:79:368:86":163,"b:379:9:379:25:379:25:470:Infinity":72,"b:381:12:387:13:387:12:397:13":73,"b:381:12:381:Infinity:382:14:387:13":74,"f:390:14:390:24":46,"s:390:29:390:Infinity":164,"b:397:12:397:25:397:25:397:44:397:44:397:Infinity:398:10:470:Infinity":75,"f:406:22:406:27":47,"s:407:18:421:Infinity":165,"f:412:22:412:32":48,"s:412:52:412:63":166,"s:412:63:412:89":167,"s:412:89:412:103":168,"b:416:21:416:Infinity:417:22:419:Infinity":76,"f:417:44:417:59":49,"s:417:59:417:100":169,"f:417:72:417:80":50,"s:417:89:417:96":170,"b:423:17:423:Infinity:424:18:431:Infinity":77,"f:426:20:426:35":51,"s:426:35:426:Infinity":171,"f:439:22:439:27":52,"s:440:18:454:Infinity":172,"f:445:22:445:32":53,"s:445:52:445:63":173,"s:445:63:445:89":174,"s:445:89:445:103":175,"b:449:21:449:Infinity:450:22:452:Infinity":78,"f:450:44:450:59":54,"s:450:59:450:100":176,"f:450:72:450:80":55,"s:450:89:450:96":177,"b:456:17:456:Infinity:457:18:464:Infinity":79,"f:459:20:459:35":56,"s:459:35:459:Infinity":178,"f:481:16:481:26":57,"s:481:31:481:Infinity":179,"f:493:16:493:26":58,"s:493:31:493:Infinity":180,"b:505:21:505:38:505:38:505:Infinity":80,"f:507:14:507:24":59,"s:507:29:507:Infinity":181,"f:508:14:508:29":60,"b:508:31:508:92:undefined:undefined:undefined:undefined":81,"s:508:31:508:92":182,"s:508:63:508:92":183,"b:512:13:512:36:512:36:513:Infinity":82,"b:514:11:514:34:514:34:514:Infinity:515:12:537:Infinity":83,"f:516:31:516:36":61,"s:517:16:535:Infinity":184,"f:520:18:520:33":62,"s:521:20:521:Infinity":185,"s:522:20:522:Infinity":186,"s:523:20:523:Infinity":187,"s:524:20:524:Infinity":188,"s:525:20:525:Infinity":189,"s:526:20:526:Infinity":190,"b:533:21:533:34:533:34:534:Infinity":84,"b:539:11:539:23:539:23:539:Infinity":85,"b:540:11:540:28:540:28:540:Infinity":86,"b:544:9:544:25:544:25:566:Infinity":87,"f:547:26:547:30":63,"s:548:29:548:Infinity":191,"s:549:14:562:Infinity":192,"f:554:18:554:33":64,"s:554:33:554:Infinity":193,"b:554:50:554:55:554:55:554:59":88,"b:556:29:556:34:556:34:556:Infinity":89,"b:558:34:558:112:558:112:558:Infinity":90,"f:571:27:571:31":65,"s:572:27:572:Infinity":194,"s:573:12:587:Infinity":195,"f:578:16:578:31":66,"s:578:31:578:Infinity":196,"b:578:51:578:56:578:56:578:60":91,"b:581:22:581:Infinity:582:22:582:Infinity":92,"b:593:9:593:26:593:26:593:39:593:39:593:Infinity:594:10:623:Infinity":93,"f:597:20:597:24":67,"s:598:16:605:Infinity":197,"b:600:19:600:Infinity:601:20:605:Infinity":94,"f:601:42:601:57":68,"s:601:57:601:103":198,"f:601:57:601:65":69,"s:601:73:601:100":199,"f:601:78:601:85":70,"s:601:90:601:99":200,"b:607:15:607:Infinity:608:16:622:Infinity":95,"f:610:18:610:28":71,"s:610:33:610:Infinity":201,"f:611:18:611:29":72,"b:612:20:615:Infinity:undefined:undefined:undefined:undefined":96,"s:612:20:615:Infinity":202,"b:612:24:612:45:612:45:612:60":97,"s:613:22:613:Infinity":203,"s:614:22:614:Infinity":204,"b:628:9:628:22:628:22:628:Infinity:629:10:636:Infinity":98,"b:638:9:638:22:638:22:638:Infinity:639:10:645:Infinity":99,"f:641:12:641:27":73,"s:641:27:641:Infinity":205,"b:654:9:654:Infinity:655:10:662:Infinity":100,"b:661:22:661:43:661:43:661:Infinity":101},"fnNames":{}}}
-}
diff --git a/client/src/api/client.behavior.test.ts b/client/src/api/client.behavior.test.ts
index a5ff0cf08..71837160a 100644
--- a/client/src/api/client.behavior.test.ts
+++ b/client/src/api/client.behavior.test.ts
@@ -1,4 +1,4 @@
-// FE-APIWIRE-001 to FE-APIWIRE-035
+// FE-APIWIRE-001 to FE-APIWIRE-036
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
import { AxiosError, type AxiosAdapter, type AxiosResponse, type InternalAxiosRequestConfig } from 'axios'
import { http, HttpResponse } from 'msw'
@@ -184,6 +184,20 @@ describe('client > rate-limit translation', () => {
const err = await captureError(() => apiClient.get('/limited'))
expect(err.response?.data).toEqual({ error: 'Too many attempts. Please try again later.' })
})
+
+ it('FE-APIWIRE-035: an array 429 body is replaced, not grafted onto', async () => {
+ server.use(http.get('/api/limited', () => HttpResponse.json([{ field: 'email' }], { status: 429 })))
+ const err = await captureError(() => apiClient.get('/limited'))
+ expect(err.response?.data).toEqual({ error: 'Too many attempts. Please try again later.' })
+ })
+
+ it('FE-APIWIRE-036: Catalan, Greek and Vietnamese have their own 429 message', async () => {
+ for (const lang of ['ca', 'gr', 'vi']) {
+ localStorage.setItem('app_language', lang)
+ const err = await captureError(() => apiClient.get('/limited'))
+ expect(err.message).not.toBe('Too many attempts. Please try again later.')
+ }
+ })
})
describe('client > proxy auth challenges', () => {
@@ -398,6 +412,7 @@ describe('client > adminApi.llmLocalPull', () => {
read: async () => (i < chunks.length
? { done: false, value: encoder.encode(chunks[i++]) }
: { done: true, value: undefined }),
+ cancel: async () => {},
}),
},
} as unknown as Response
@@ -450,13 +465,26 @@ describe('client > adminApi.llmLocalPull', () => {
.rejects.toThrow('Pull failed (500)')
})
- it('FE-APIWIRE-033: a 200 without a readable body is treated as a failure', async () => {
+ it('FE-APIWIRE-036: a throw from onProgress aborts the pull', async () => {
+ vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce(streamingResponse([
+ '{"status":"pulling manifest"}\n{"error":"manifest not found"}\n{"status":"success"}\n',
+ ]))
+ const onProgress = vi.fn((p: { error?: string }) => {
+ if (p.error) throw new Error(p.error)
+ })
+
+ await expect(adminApi.llmLocalPull('http://ollama:11434', 'x', onProgress))
+ .rejects.toThrow('manifest not found')
+ expect(onProgress).toHaveBeenCalledTimes(2)
+ })
+
+ it('FE-APIWIRE-033: a 200 without a readable body reports the missing stream', async () => {
vi.spyOn(globalThis, 'fetch').mockResolvedValueOnce({
ok: true, status: 200, body: null,
json: async () => ({}),
} as unknown as Response)
await expect(adminApi.llmLocalPull('http://ollama:11434', 'x', vi.fn()))
- .rejects.toThrow('Pull failed (200)')
+ .rejects.toThrow('Pull returned no progress stream')
})
})
diff --git a/client/src/api/client.ts b/client/src/api/client.ts
index f3d9c833f..8d355bf48 100644
--- a/client/src/api/client.ts
+++ b/client/src/api/client.ts
@@ -105,6 +105,9 @@ const RATE_LIMIT_MESSAGES: Record<string, string> = {
ko: '시도 횟수가 너무 많습니다. 잠시 후 다시 시도해 주세요.',
uk: 'Занадто багато спроб. Спробуйте пізніше.',
sv: 'För många försök. Prova igen senare.',
+ ca: 'Massa intents. Torneu-ho a provar més tard.',
+ gr: 'Πάρα πολλές προσπάθειες. Δοκιμάστε ξανά αργότερα.',
+ vi: 'Quá nhiều lần thử. Vui lòng thử lại sau.',
}
function translateRateLimit(): string {
@@ -228,9 +231,11 @@ apiClient.interceptors.response.use(
}
if (error.response?.status === 429) {
const translated = translateRateLimit()
- const data = error.response.data as { error?: string } | undefined
- if (data && typeof data === 'object') {
- data.error = translated
+ const data = error.response.data
+ // Only a plain object body carries an `error` field worth overwriting;
+ // an array (a validation-error list) or a string is replaced outright.
+ if (data && typeof data === 'object' && !Array.isArray(data)) {
+ (data as { error?: string }).error = translated
} else {
error.response.data = { error: translated }
}
@@ -551,24 +556,35 @@ export const adminApi = {
headers: { 'content-type': 'application/json' },
body: JSON.stringify({ baseUrl, model }),
})
- if (!res.ok || !res.body) {
+ if (!res.ok) {
let msg = `Pull failed (${res.status})`
try { msg = (await res.json())?.error ?? msg } catch { /* non-json */ }
throw new Error(msg)
}
+ // An accepted request without a stream can't be followed to completion.
+ if (!res.body) throw new Error('Pull returned no progress stream')
const reader = res.body.getReader()
const dec = new TextDecoder()
let buf = ''
- for (;;) {
- const { done, value } = await reader.read()
- if (done) break
- buf += dec.decode(value, { stream: true })
- const lines = buf.split('\n')
- buf = lines.pop() ?? ''
- for (const line of lines) {
- if (!line.trim()) continue
- try { onProgress(JSON.parse(line)) } catch { /* skip partial */ }
+ try {
+ for (;;) {
+ const { done, value } = await reader.read()
+ if (done) break
+ buf += dec.decode(value, { stream: true })
+ // split() always yields at least one element; the last one is the
+ // trailing (possibly partial) line carried into the next chunk.
+ const lines = buf.split('\n')
+ buf = lines.pop()!
+ for (const line of lines) {
+ if (!line.trim()) continue
+ // Only the parse is swallowed — a throw from onProgress aborts the pull.
+ let frame: { status?: string; total?: number; completed?: number; error?: string }
+ try { frame = JSON.parse(line) } catch { continue }
+ onProgress(frame)
+ }
}
+ } finally {
+ reader.cancel().catch(() => {})
}
},
checkVersion: () => apiClient.get('/admin/version-check').then(r => r.data),
diff --git a/client/src/components/Admin/AddonManager.test.tsx b/client/src/components/Admin/AddonManager.test.tsx
index 20c6c1a5c..6f13fcf7d 100644
--- a/client/src/components/Admin/AddonManager.test.tsx
+++ b/client/src/components/Admin/AddonManager.test.tsx
@@ -560,7 +560,7 @@ describe('AddonManager', () => {
});
});
- it('FE-ADMIN-ADDON-027: an error frame in the pull stream is tolerated and the row returns to idle', async () => {
+ it('FE-ADMIN-ADDON-027: an error frame in the pull stream aborts the pull and is reported', async () => {
const user = userEvent.setup();
server.use(
addonsRoute([llmAddon({ provider: 'local' })]),
@@ -575,6 +575,8 @@ describe('AddonManager', () => {
await screen.findByText('No models installed yet — pull one below.');
await user.click(screen.getByRole('button', { name: 'Pull' }));
+ await screen.findByText('manifest not found');
+ expect(screen.queryByText('Model pulled')).not.toBeInTheDocument();
await waitFor(() => expect(screen.getByRole('button', { name: 'Pull' })).toBeEnabled());
expect(screen.queryByText('Pulling…')).not.toBeInTheDocument();
});
diff --git a/client/src/components/Admin/AdminPluginsPanel.test.tsx b/client/src/components/Admin/AdminPluginsPanel.test.tsx
index 74da6b02f..7fff27480 100644
--- a/client/src/components/Admin/AdminPluginsPanel.test.tsx
+++ b/client/src/components/Admin/AdminPluginsPanel.test.tsx
@@ -1242,6 +1242,21 @@ describe('AdminPluginsPanel — Discover cards and the detail modal', () => {
expect(screen.queryByText('Setup')).not.toBeInTheDocument()
})
+ it('FE-COMP-PLUGINS-PANEL-043b: a manifest that omits the lists still renders the modal', async () => {
+ const detail = manifestDetail({ size: 0 })
+ delete (detail.manifest as Record<string, unknown>).egress
+ delete (detail.manifest as Record<string, unknown>).settings
+ delete (detail.manifest as Record<string, unknown>).permissions
+ discoverWith({}, detail)
+ render(<AdminPluginsPanel />)
+ await clickDiscover()
+ fireEvent.click(await screen.findByText('Gotify'))
+
+ expect(await screen.findByText('Needs no special access.')).toBeInTheDocument()
+ expect(screen.queryByText('Connects to')).not.toBeInTheDocument()
+ expect(screen.queryByText('Setup')).not.toBeInTheDocument()
+ })
+
it('FE-COMP-PLUGINS-PANEL-044: an incompatible entry explains the blocked button in the modal body', async () => {
discoverWith({ compatible: false, latestCompatible: null, trek: '>=4.0.0', hostVersion: '3.3.0' })
render(<AdminPluginsPanel />)
diff --git a/client/src/components/Admin/AdminPluginsPanel.tsx b/client/src/components/Admin/AdminPluginsPanel.tsx
index 2d0baa95b..de5d42c54 100644
--- a/client/src/components/Admin/AdminPluginsPanel.tsx
+++ b/client/src/components/Admin/AdminPluginsPanel.tsx
@@ -96,15 +96,19 @@ interface RegistryDetail extends RegistryItem {
size: number | null
publishedAt: string | null
manifest: {
- permissions: string[]
- egress: string[]
+ // Optional because a registry may omit an empty list — the detail view has to
+ // degrade rather than throw halfway through its render.
+ permissions?: string[]
+ egress?: string[]
/** The plugin needs OPERATOR-supplied hosts — its egress list is not the whole story. */
operatorEgress?: boolean
- settings: Array<{ key: string; label: string; inputType: string; scope: string; required: boolean }>
+ settings?: Array<{ key: string; label: string; inputType: string; scope: string; required: boolean }>
license: string | null
icon: string | null
requiredAddons?: string[]
pluginDependencies?: PluginDep[]
+ /** Display slice of the manifest's capabilities — drives the same chips as an installed row. */
+ capabilities?: { widget?: { slot?: string }; tripPage?: { replaces?: string[] } }
} | null
}
@@ -300,13 +304,8 @@ function installOffer(item: RegistryItem, t: T): { blocked: boolean; version?: s
return { blocked: true, label: t('admin.plugins.incompatible'), title }
}
-function ReviewedBadge({ t, compact }: { t: T; compact?: boolean }) {
- if (compact) return <ShieldCheck size={13} className="text-success shrink-0" aria-label={t('admin.plugins.reviewed')} />
- return (
- <span className="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold bg-success-soft text-success">
- <ShieldCheck size={11} /> {t('admin.plugins.reviewed')}
- </span>
- )
+function ReviewedBadge({ t }: { t: T }) {
+ return <ShieldCheck size={13} className="text-success shrink-0" aria-label={t('admin.plugins.reviewed')} />
}
/** Marks a manually-uploaded (sideloaded) plugin: no registry, unsigned, not reviewed. */
@@ -1149,7 +1148,7 @@ function InstalledRow({ p, t, busy, menu, setMenu, hasUpdate, latestVer, blocked
<div className="flex items-center gap-2 flex-wrap">
<span className="text-[14.5px] font-semibold tracking-[-.006em] text-content">{p.name}</span>
{p.version && <span className="text-[11.5px] text-content-faint font-medium tabular-nums">v{p.version}</span>}
- {p.reviewed_at && <ReviewedBadge t={t} compact />}
+ {p.reviewed_at && <ReviewedBadge t={t} />}
{p.source_repo === 'local:upload' && <SideloadedBadge t={t} />}
{p.source_repo === 'local:link' && <DevLinkBadge t={t} />}
{/* Registry plugins only — a sideloaded/dev-linked plugin already says something
@@ -1401,7 +1400,10 @@ function PluginDetailModal({ item, installed, busy, onInstall, onClose, t, local
}, [item.id])
const manifest = detail?.manifest ?? null
- const caps = manifest ? deriveCaps(manifest.permissions, {}, t) : []
+ const permissions = manifest?.permissions ?? []
+ const egress = manifest?.egress ?? []
+ const settings = manifest?.settings ?? []
+ const caps = manifest ? deriveCaps(permissions, manifest.capabilities ?? {}, t) : []
const repoUrl = `https://github.com/${item.repo}`
const homepage = item.homepage && /^https?:\/\//i.test(item.homepage) && item.homepage !== repoUrl ? item.homepage : null
const sizeKb = detail?.size ? Math.max(1, Math.round(detail.size / 1024)) : null
@@ -1425,7 +1427,7 @@ function PluginDetailModal({ item, installed, busy, onInstall, onClose, t, local
<div className="flex-1 min-w-0 pt-8">
<div className="flex items-center gap-2 flex-wrap">
<h3 className="text-lg font-semibold tracking-tight text-content">{item.name}</h3>
- {item.reviewedAt && <ReviewedBadge t={t} compact />}
+ {item.reviewedAt && <ReviewedBadge t={t} />}
</div>
<p className="text-[12.5px] text-content-faint mt-0.5">{item.author}{item.latest ? ` · v${item.latest}` : ''}</p>
</div>
@@ -1451,7 +1453,7 @@ function PluginDetailModal({ item, installed, busy, onInstall, onClose, t, local
{manifest && (
<div className="mt-5">
<h4 className="text-[11px] font-semibold uppercase tracking-wider text-content-muted">{t('admin.plugins.accessTitle')}</h4>
- {caps.filter(c => !c.net).length === 0 && !manifest.permissions.includes('db:own') ? (
+ {caps.filter(c => !c.net).length === 0 && !permissions.includes('db:own') ? (
<p className="text-xs text-content-faint mt-2">{t('admin.plugins.noAccess')}</p>
) : (
<div className="mt-2 space-y-1.5">
@@ -1460,7 +1462,7 @@ function PluginDetailModal({ item, installed, busy, onInstall, onClose, t, local
<c.icon size={15} className="text-accent mt-0.5 shrink-0" /><span>{c.label}</span>
</div>
))}
- {manifest.permissions.includes('db:own') && (
+ {permissions.includes('db:own') && (
<div className="flex items-start gap-2.5 text-[13px] text-content-secondary py-0.5">
<Database size={15} className="text-accent mt-0.5 shrink-0" /><span>{t('admin.plugins.perm.db:own')}</span>
</div>
@@ -1470,11 +1472,11 @@ function PluginDetailModal({ item, installed, busy, onInstall, onClose, t, local
</div>
)}
- {manifest && (manifest.egress.length > 0 || manifest.operatorEgress) && (
+ {manifest && (egress.length > 0 || manifest.operatorEgress) && (
<div className="mt-5">
<h4 className="text-[11px] font-semibold uppercase tracking-wider text-content-muted">{t('admin.plugins.connectsTitle')}</h4>
<div className="flex flex-wrap items-center gap-1.5 mt-2">
- {manifest.egress.map(h => (
+ {egress.map(h => (
<code key={h} className="text-[12px] font-mono text-info bg-info-soft rounded-md px-2 py-1">{h}</code>
))}
{/* The hosts above are NOT the whole story for this plugin: it talks to a
@@ -1493,11 +1495,11 @@ function PluginDetailModal({ item, installed, busy, onInstall, onClose, t, local
</div>
)}
- {manifest && manifest.settings.length > 0 && (
+ {manifest && settings.length > 0 && (
<div className="mt-5">
<h4 className="text-[11px] font-semibold uppercase tracking-wider text-content-muted">{t('admin.plugins.setupTitle')}</h4>
<ul className="mt-2 space-y-1.5">
- {manifest.settings.map(s => (
+ {settings.map(s => (
<li key={s.key} className="flex items-center gap-2 text-xs text-content-muted flex-wrap">
<span className="font-medium">{s.label}</span>
<span className="text-[10px] px-1.5 py-0.5 rounded-full bg-surface-tertiary text-content-faint">{t(`admin.plugins.scope.${s.scope}` as never)}</span>
diff --git a/client/src/components/Admin/CategoryManager.tsx b/client/src/components/Admin/CategoryManager.tsx
index 687378966..6c68f4bc0 100644
--- a/client/src/components/Admin/CategoryManager.tsx
+++ b/client/src/components/Admin/CategoryManager.tsx
@@ -56,8 +56,8 @@ export default function CategoryManager() {
setEditingId(null)
}
+ // The Save button carries disabled={… || !form.name.trim()}, so the name is set here.
const handleSave = async () => {
- if (!form.name.trim()) { toast.error(t('categories.toast.nameRequired')); return }
setIsSaving(true)
try {
if (editingId) {
diff --git a/client/src/components/Admin/DefaultUserSettingsTab.tsx b/client/src/components/Admin/DefaultUserSettingsTab.tsx
index c9121edec..d7bd03b2b 100644
--- a/client/src/components/Admin/DefaultUserSettingsTab.tsx
+++ b/client/src/components/Admin/DefaultUserSettingsTab.tsx
@@ -48,8 +48,8 @@ function normalizeProvider(value: unknown): MapProvider {
return value === 'mapbox-gl' || value === 'maplibre-gl' ? value : 'leaflet'
}
-function styleForProvider(provider: MapProvider, style?: string | null): string {
- if (provider === 'leaflet') return style || MAPBOX_DEFAULT_STYLE
+/** Only the GL providers keep a style — Leaflet is handled by its callers. */
+function styleForProvider(provider: GlMapProvider, style?: string | null): string {
if (provider === 'mapbox-gl' && isOpenFreeMapStyle(style)) return MAPBOX_DEFAULT_STYLE
return normalizeStyleForProvider(provider, style)
}
diff --git a/client/src/components/Admin/DevNotificationsPanel.test.tsx b/client/src/components/Admin/DevNotificationsPanel.test.tsx
index 9402586ab..35932e52e 100644
--- a/client/src/components/Admin/DevNotificationsPanel.test.tsx
+++ b/client/src/components/Admin/DevNotificationsPanel.test.tsx
@@ -110,7 +110,20 @@ describe('DevNotificationsPanel', () => {
});
});
- it('FE-ADMIN-DEVNOTIF-008: error toast shown on API failure', async () => {
+ it('FE-ADMIN-DEVNOTIF-008: the server error field is what the toast shows', async () => {
+ server.use(
+ http.post('/api/admin/dev/test-notification', () =>
+ HttpResponse.json({ error: 'No channel configured' }, { status: 500 }),
+ ),
+ );
+ const user = userEvent.setup();
+ render(<><ToastContainer /><DevNotificationsPanel /></>);
+ await screen.findByText('Type Testing');
+ await user.click(screen.getByText('Simple → Me').closest('button')!);
+ await screen.findByText('No channel configured');
+ });
+
+ it('FE-ADMIN-DEVNOTIF-008b: a failure without an error field falls back to the generic text', async () => {
server.use(
http.post('/api/admin/dev/test-notification', () =>
HttpResponse.json({ message: 'Server error' }, { status: 500 }),
@@ -120,7 +133,7 @@ describe('DevNotificationsPanel', () => {
render(<><ToastContainer /><DevNotificationsPanel /></>);
await screen.findByText('Type Testing');
await user.click(screen.getByText('Simple → Me').closest('button')!);
- await screen.findByText(/failed|error/i);
+ await screen.findByText('Failed');
});
it('FE-ADMIN-DEVNOTIF-009: changing trip selector updates payload targetId', async () => {
diff --git a/client/src/components/Admin/DevNotificationsPanel.tsx b/client/src/components/Admin/DevNotificationsPanel.tsx
index f5322e739..7237b23ae 100644
--- a/client/src/components/Admin/DevNotificationsPanel.tsx
+++ b/client/src/components/Admin/DevNotificationsPanel.tsx
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react'
import { adminApi, tripsApi } from '../../api/client'
+import { getApiErrorMessage } from '../../utils/apiError'
import { useAuthStore } from '../../store/authStore'
import { useToast } from '../shared/Toast'
import {
@@ -46,8 +47,8 @@ export default function DevNotificationsPanel(): React.ReactElement {
try {
await adminApi.sendTestNotification(payload)
toast.success(`Sent: ${label}`)
- } catch (err: any) {
- toast.error(err.message || 'Failed')
+ } catch (err: unknown) {
+ toast.error(getApiErrorMessage(err, 'Failed'))
} finally {
setSending(null)
}
diff --git a/client/src/components/Admin/PackingTemplateManager.test.tsx b/client/src/components/Admin/PackingTemplateManager.test.tsx
index 1e150a2aa..8abb51cde 100644
--- a/client/src/components/Admin/PackingTemplateManager.test.tsx
+++ b/client/src/components/Admin/PackingTemplateManager.test.tsx
@@ -697,7 +697,7 @@ describe('PackingTemplateManager', () => {
await user.click(categoryButtons('Clothing')[2]);
- expect(await screen.findByText('Failed to delete template')).toBeInTheDocument();
+ expect(await screen.findByText('Failed to delete category')).toBeInTheDocument();
expect(screen.getByText('Clothing')).toBeInTheDocument();
expect(screen.getByText('T-shirt')).toBeInTheDocument();
});
@@ -798,7 +798,7 @@ describe('PackingTemplateManager', () => {
await user.click(itemButtons('T-shirt')[1]);
- expect(await screen.findByText('Failed to delete template')).toBeInTheDocument();
+ expect(await screen.findByText('Failed to delete item')).toBeInTheDocument();
expect(screen.getByText('T-shirt')).toBeInTheDocument();
});
diff --git a/client/src/components/Admin/PackingTemplateManager.tsx b/client/src/components/Admin/PackingTemplateManager.tsx
index adcbe9a0c..9773b1999 100644
--- a/client/src/components/Admin/PackingTemplateManager.tsx
+++ b/client/src/components/Admin/PackingTemplateManager.tsx
@@ -115,12 +115,13 @@ export default function PackingTemplateManager() {
await adminApi.deleteTemplateCategory(expandedId, catId)
setCategories(prev => prev.filter(c => c.id !== catId))
setItems(prev => prev.filter(i => i.category_id !== catId))
- } catch { toast.error(t('admin.packingTemplates.deleteError')) }
+ } catch { toast.error(t('admin.packingTemplates.deleteCategoryError')) }
}
// Item CRUD
const handleAddItem = async (catId: number) => {
- if (!newItemName.trim() || !expandedId) return
+ // The name is already guaranteed non-empty by the button and the Enter handler.
+ if (!expandedId) return
try {
const data = await adminApi.addTemplateItem(expandedId, catId, { name: newItemName.trim() })
setItems(prev => [...prev, data.item])
@@ -143,7 +144,7 @@ export default function PackingTemplateManager() {
try {
await adminApi.deleteTemplateItem(expandedId, itemId)
setItems(prev => prev.filter(i => i.id !== itemId))
- } catch { toast.error(t('admin.packingTemplates.deleteError')) }
+ } catch { toast.error(t('admin.packingTemplates.deleteItemError')) }
}
const inputStyle = 'w-full px-3 py-2 border border-slate-200 rounded-lg text-sm focus:ring-2 focus:ring-slate-400 focus:border-transparent outline-none'
diff --git a/client/src/components/Budget/BudgetPanel.helpers.test.ts b/client/src/components/Budget/BudgetPanel.helpers.test.ts
index 438affa14..4a72cf3bb 100644
--- a/client/src/components/Budget/BudgetPanel.helpers.test.ts
+++ b/client/src/components/Budget/BudgetPanel.helpers.test.ts
@@ -1,5 +1,5 @@
import { describe, it, expect } from 'vitest'
-import { calcPP, hasCustomMemberSplit } from './BudgetPanel.helpers'
+import { calcPP, hasCustomMemberSplit, normalizePastedAmount } from './BudgetPanel.helpers'
describe('BudgetPanel.helpers', () => {
describe('hasCustomMemberSplit (#1458)', () => {
@@ -25,4 +25,18 @@ describe('BudgetPanel.helpers', () => {
expect(calcPP(100, 0)).toBeNull()
expect(calcPP(100, null)).toBeNull()
})
+
+ describe('normalizePastedAmount', () => {
+ it('keeps the last separator as the decimal point', () => {
+ expect(normalizePastedAmount('1.234,56 €')).toBe('1234.56')
+ expect(normalizePastedAmount('$1,234.56')).toBe('1234.56')
+ expect(normalizePastedAmount(' -12,5 ')).toBe('-12.5')
+ })
+
+ it('drops everything that is not part of the number', () => {
+ expect(normalizePastedAmount('EUR 1 234 567')).toBe('1234567')
+ expect(normalizePastedAmount('42')).toBe('42')
+ expect(normalizePastedAmount('abc')).toBe('')
+ })
+ })
})
diff --git a/client/src/components/Budget/BudgetPanel.helpers.ts b/client/src/components/Budget/BudgetPanel.helpers.ts
index c3b13fdc9..987b4a18d 100644
--- a/client/src/components/Budget/BudgetPanel.helpers.ts
+++ b/client/src/components/Budget/BudgetPanel.helpers.ts
@@ -77,3 +77,15 @@ export function splitColorFor(userId: number, order: number) {
export function colorForUserId(userId: number) {
return SPLIT_COLORS[((userId | 0) - 1 + SPLIT_COLORS.length * 1000) % SPLIT_COLORS.length]
}
+
+/**
+ * Normalises a pasted amount to a plain `1234.56` string: drops currency
+ * symbols and spaces, treats the last comma/dot as the decimal separator and
+ * removes every thousand separator before it.
+ */
+export function normalizePastedAmount(raw: string): string {
+ const text = raw.trim().replace(/[^\d.,-]/g, '')
+ const decimalPos = Math.max(text.lastIndexOf(','), text.lastIndexOf('.'))
+ if (decimalPos === -1) return text.replace(/[.,]/g, '')
+ return text.substring(0, decimalPos).replace(/[.,]/g, '') + '.' + text.substring(decimalPos + 1)
+}
diff --git a/client/src/components/Budget/BudgetPanelAddItemRow.tsx b/client/src/components/Budget/BudgetPanelAddItemRow.tsx
index 484cddaa2..5f9deb4fa 100644
--- a/client/src/components/Budget/BudgetPanelAddItemRow.tsx
+++ b/client/src/components/Budget/BudgetPanelAddItemRow.tsx
@@ -1,6 +1,7 @@
import { useState, useRef } from 'react'
import { Plus } from 'lucide-react'
import { CustomDatePicker } from '../shared/CustomDateTimePicker'
+import { normalizePastedAmount } from './BudgetPanel.helpers'
interface AddItemRowProps {
onAdd: (data: { name: string; total_price: number; persons: number | null; days: number | null; note: string | null; expense_date: string | null }) => void
@@ -33,7 +34,7 @@ export default function AddItemRow({ onAdd, t }: AddItemRowProps) {
</td>
<td style={{ padding: '4px 6px' }}>
<input value={price} onChange={e => setPrice(e.target.value)} onKeyDown={e => e.key === 'Enter' && handleAdd()}
- onPaste={e => { e.preventDefault(); let t = e.clipboardData.getData('text').trim().replace(/[^\d.,-]/g, ''); const lc = t.lastIndexOf(','), ld = t.lastIndexOf('.'), dp = Math.max(lc, ld); if (dp > -1) { t = t.substring(0, dp).replace(/[.,]/g, '') + '.' + t.substring(dp + 1) } else { t = t.replace(/[.,]/g, '') } setPrice(t) }}
+ onPaste={e => { e.preventDefault(); setPrice(normalizePastedAmount(e.clipboardData.getData('text'))) }}
placeholder="0,00" inputMode="decimal" style={{ ...inp, textAlign: 'center' }} />
</td>
<td className="hidden sm:table-cell" style={{ padding: '4px 6px', textAlign: 'center' }}>
diff --git a/client/src/components/Budget/BudgetPanelInlineEditCell.tsx b/client/src/components/Budget/BudgetPanelInlineEditCell.tsx
index 5dae2a574..159bd500d 100644
--- a/client/src/components/Budget/BudgetPanelInlineEditCell.tsx
+++ b/client/src/components/Budget/BudgetPanelInlineEditCell.tsx
@@ -1,4 +1,5 @@
import { useState, useEffect, useRef } from 'react'
+import { normalizePastedAmount } from './BudgetPanel.helpers'
interface InlineEditCellProps {
value: string | number | null | undefined
@@ -29,21 +30,7 @@ export default function InlineEditCell({ value, onSave, type = 'text', style = {
const handlePaste = (e: React.ClipboardEvent<HTMLInputElement>) => {
if (type !== 'number') return
e.preventDefault()
- let text = e.clipboardData.getData('text').trim()
- // Strip everything except digits, dots, commas, minus
- text = text.replace(/[^\d.,-]/g, '')
- // Remove all thousand separators (dots or commas before 3-digit groups), keep last separator as decimal
- const lastComma = text.lastIndexOf(',')
- const lastDot = text.lastIndexOf('.')
- const decimalPos = Math.max(lastComma, lastDot)
- if (decimalPos > -1) {
- const intPart = text.substring(0, decimalPos).replace(/[.,]/g, '')
- const decPart = text.substring(decimalPos + 1)
- text = intPart + '.' + decPart
- } else {
- text = text.replace(/[.,]/g, '')
- }
- setEditValue(text)
+ setEditValue(normalizePastedAmount(e.clipboardData.getData('text')))
}
if (editing) {
diff --git a/client/src/components/Budget/CostsPanel.test.tsx b/client/src/components/Budget/CostsPanel.test.tsx
index 19e1b2686..d84f687e7 100644
--- a/client/src/components/Budget/CostsPanel.test.tsx
+++ b/client/src/components/Budget/CostsPanel.test.tsx
@@ -170,6 +170,35 @@ describe('CostsPanel — settlements in the ledger', () => {
expect(screen.getByText('Unfinished')).toBeInTheDocument()
})
+ it('shows the net hint on a settled expense row and hides it while unfinished', async () => {
+ seedStore(useAuthStore, { user: buildUser({ id: 1, username: 'alice' }), isAuthenticated: true })
+ seedStore(useSettingsStore, { settings: { ...useSettingsStore.getState().settings, default_currency: 'EUR' } })
+ // alice fronted the whole 90 for a two-way split, so she is 45 up.
+ const lent = {
+ ...buildBudgetItem({ trip_id: 1, category: 'food', name: 'Dinner' }),
+ total_price: 90,
+ payers: [{ user_id: 1, amount: 90, username: 'alice' }],
+ members: [{ user_id: 1, username: 'alice', paid: 1 }, { user_id: 2, username: 'bob', paid: 0 }],
+ }
+ const unpaid = {
+ ...buildBudgetItem({ trip_id: 1, category: 'lodging', name: 'Hotel' }),
+ total_price: 90,
+ payers: [],
+ members: [{ user_id: 1, username: 'alice', paid: 0 }, { user_id: 2, username: 'bob', paid: 0 }],
+ }
+ server.use(
+ http.get('/api/trips/1/budget', () => HttpResponse.json({ items: [lent, unpaid] })),
+ http.get('/api/trips/1/budget/settlement', () => HttpResponse.json({ balances: [], flows: [], settlements: [] })),
+ )
+ render(<CostsPanel tripId={1} tripMembers={tripMembers} />)
+
+ const dinnerRow = (await screen.findByText('Dinner')).closest('.exp-row') as HTMLElement
+ expect(within(dinnerRow).getByText(/you lent/)).toHaveTextContent('45')
+
+ const hotelRow = (await screen.findByText('Hotel')).closest('.exp-row') as HTMLElement
+ expect(within(hotelRow).queryByText(/you lent|you borrowed/)).toBeNull()
+ })
+
it('sums only unfinished expenses in the Outstanding amount card', async () => {
// Display in the trip's own currency so FX conversion is an identity — keeps the asserted sum deterministic.
seedStore(useSettingsStore, { settings: { ...useSettingsStore.getState().settings, default_currency: 'EUR' } })
diff --git a/client/src/components/Budget/CostsPanel.tsx b/client/src/components/Budget/CostsPanel.tsx
index edc2723b3..d0e99bb18 100644
--- a/client/src/components/Budget/CostsPanel.tsx
+++ b/client/src/components/Budget/CostsPanel.tsx
@@ -11,6 +11,7 @@ import { budgetApi } from '../../api/client'
import { useExchangeRates } from '../../hooks/useExchangeRates'
import { useIsMobile } from '../../hooks/useIsMobile'
import { formatMoney, currencyDecimals, currencyLocale, localizeAmountInput } from '../../utils/formatters'
+import { downloadBlob } from '../../utils/fileDownload'
import Modal from '../shared/Modal'
import CustomSelect from '../shared/CustomSelect'
import { CustomDatePicker } from '../shared/CustomDateTimePicker'
@@ -319,13 +320,8 @@ export default function CostsPanel({ tripId, tripMembers = [] }: CostsPanelProps
const bom = ''
const blob = new Blob([bom + rows.join('\r\n')], { type: 'text/csv;charset=utf-8;' })
- const url = URL.createObjectURL(blob)
- const a = document.createElement('a')
- a.href = url
const safeName = (trip?.title || 'trip').replace(/[^a-zA-Z0-9À-ɏ _-]/g, '').trim()
- a.download = `costs-${safeName}.csv`
- a.click()
- URL.revokeObjectURL(url)
+ downloadBlob(blob, `costs-${safeName}.csv`)
}
// ── small presentational helpers ────────────────────────────────────────
@@ -763,7 +759,7 @@ export default function CostsPanel({ tripId, tripMembers = [] }: CostsPanelProps
<div style={{ display: 'flex', alignItems: 'center', gap: 10, alignSelf: 'center' }}>
<div style={{ textAlign: 'right', whiteSpace: 'nowrap' }}>
<div className="text-content" style={{ fontSize: 'calc(18px * var(--fs-scale-subtitle, 1))', fontWeight: 600 }}>{fmt(baseTotal(e))}</div>
- {!isUnfinished && (e.members || []).length > 0 && Math.abs(net) > 0.01 && (
+ {!unfinished && (e.members || []).length > 0 && Math.abs(net) > 0.01 && (
<div style={{ fontSize: 'calc(12px * var(--fs-scale-body, 1))', marginTop: 2, fontWeight: 500, whiteSpace: 'nowrap', color: net > 0 ? '#16a34a' : '#dc2626' }}>
{net > 0 ? t('costs.youLent', { amount: fmt(net) }) : t('costs.youBorrowed', { amount: fmt(-net) })}
</div>
diff --git a/client/src/components/Collab/CollabChatMessages.tsx b/client/src/components/Collab/CollabChatMessages.tsx
index 1fe7b658a..b335c0bef 100644
--- a/client/src/components/Collab/CollabChatMessages.tsx
+++ b/client/src/components/Collab/CollabChatMessages.tsx
@@ -218,12 +218,9 @@ export function ChatMessages(props: any) {
borderRadius: 99, background: 'var(--bg-card)',
boxShadow: '0 1px 6px rgba(0,0,0,0.12)', border: '1px solid var(--border-faint)',
}}>
- {msg.reactions.map(r => {
- const myReaction = r.users.some(u => String(u.user_id) === String(currentUser.id))
- return (
- <ReactionBadge key={r.emoji} reaction={r} currentUserId={currentUser.id} onReact={() => { if (canEdit) handleReact(msg.id, r.emoji) }} />
- )
- })}
+ {msg.reactions.map(r => (
+ <ReactionBadge key={r.emoji} reaction={r} currentUserId={currentUser.id} onReact={() => { if (canEdit) handleReact(msg.id, r.emoji) }} />
+ ))}
</div>
</div>
)}
diff --git a/client/src/components/Collab/CollabChatSmall.test.tsx b/client/src/components/Collab/CollabChatSmall.test.tsx
index 5087f171a..43269b718 100644
--- a/client/src/components/Collab/CollabChatSmall.test.tsx
+++ b/client/src/components/Collab/CollabChatSmall.test.tsx
@@ -1,4 +1,4 @@
-// FE-W4CCS-001 to FE-W4CCS-014
+// FE-W4CCS-001 to FE-W4CCS-016
import { describe, it, expect, vi, beforeEach } from 'vitest'
import { render, screen, fireEvent, waitFor } from '../../../tests/helpers/render'
import type { ChatReaction } from './CollabChat.types'
@@ -155,4 +155,33 @@ describe('WebsiteThumbnail', () => {
await waitFor(() => expect(linkPreview).toHaveBeenCalled())
expect(screen.getByRole('link')).toHaveAttribute('title', 'not a url')
})
+
+ it('FE-W4CCS-015: caches per trip, because the preview endpoint is trip-scoped', async () => {
+ linkPreview.mockResolvedValue({ title: 'Trip 4', image: null })
+ const shared = 'https://example.com/shared'
+ const first = render(<WebsiteThumbnail url={shared} tripId={4} color="#000" />)
+ await waitFor(() => expect(screen.getByRole('link')).toHaveAttribute('title', 'Trip 4'))
+ first.unmount()
+
+ linkPreview.mockResolvedValue({ title: 'Trip 9', image: null })
+ render(<WebsiteThumbnail url={shared} tripId={9} color="#000" />)
+
+ await waitFor(() => expect(screen.getByRole('link')).toHaveAttribute('title', 'Trip 9'))
+ expect(linkPreview).toHaveBeenCalledTimes(2)
+ expect(linkPreview).toHaveBeenLastCalledWith(9, shared)
+ })
+
+ it('FE-W4CCS-016: a broken OG image does not poison the next url', async () => {
+ linkPreview.mockResolvedValue({ title: 'A', image: 'https://cdn.example/a.png' })
+ const { container, rerender } = render(<WebsiteThumbnail url="https://a.example/x" tripId={4} color="#000" />)
+ await waitFor(() => expect(container.querySelector('img')).not.toBeNull())
+ fireEvent.error(container.querySelector('img')!)
+ expect(container.querySelector('img')).toBeNull()
+
+ linkPreview.mockResolvedValue({ title: 'B', image: 'https://cdn.example/b.png' })
+ rerender(<WebsiteThumbnail url="https://b.example/y" tripId={4} color="#000" />)
+
+ await waitFor(() => expect(container.querySelector('img')).not.toBeNull())
+ expect(container.querySelector('img')).toHaveAttribute('src', 'https://cdn.example/b.png')
+ })
})
diff --git a/client/src/components/Collab/CollabNotes.test.tsx b/client/src/components/Collab/CollabNotes.test.tsx
index 0bb6129f2..618699e98 100644
--- a/client/src/components/Collab/CollabNotes.test.tsx
+++ b/client/src/components/Collab/CollabNotes.test.tsx
@@ -1270,7 +1270,7 @@ describe('CollabNotes', () => {
});
});
-// FE-W5CNT-001 to FE-W5CNT-028
+// FE-W5CNT-001 to FE-W5CNT-029
// Fills in the load/error/attachment/category branches of useCollabNotes and the
// view modal that the smoke tests above do not reach.
@@ -1802,4 +1802,21 @@ describe('CollabNotes details', () => {
await screen.findByText('Newer note');
expect(screen.getByText('Older note')).toBeInTheDocument();
});
+
+ it('FE-W5CNT-029: a failing delete reports an error and keeps the note in the list', async () => {
+ const user = userEvent.setup();
+ serveNotes({ notes: [buildNote({ id: 30, title: 'Stubborn note' })] });
+ server.use(
+ http.delete('/api/trips/1/collab/notes/30', () => new HttpResponse(null, { status: 500 })),
+ );
+ render(<CollabNotes {...defaultProps} />);
+ await screen.findByText('Stubborn note');
+
+ await user.click(screen.getByTitle('Delete'));
+ const dialog = (await screen.findByText('Delete note?')).closest('div.trek-modal-enter') as HTMLElement;
+ await user.click(within(dialog).getByRole('button', { name: 'Delete' }));
+
+ await waitFor(() => expect(addToast).toHaveBeenCalledWith('Error', 'error', undefined));
+ expect(screen.getByText('Stubborn note')).toBeInTheDocument();
+ });
});
diff --git a/client/src/components/Collab/CollabNotes.tsx b/client/src/components/Collab/CollabNotes.tsx
index 04deb0a85..b5e8fb0e2 100644
--- a/client/src/components/Collab/CollabNotes.tsx
+++ b/client/src/components/Collab/CollabNotes.tsx
@@ -271,7 +271,7 @@ function CollabNotesHeader({ t, canEdit, setShowSettings, setShowNewModal }: Not
{t('collab.notes.title')}
</h3>
<div style={{ display: 'flex', gap: 4, alignItems: 'center' }}>
- {canEdit && <button onClick={() => setShowSettings(true)} title={t('collab.notes.categorySettings') || 'Categories'}
+ {canEdit && <button onClick={() => setShowSettings(true)} title={t('collab.notes.categorySettings')}
style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', width: 28, height: 28, borderRadius: 8, border: 'none', background: 'transparent', cursor: 'pointer', color: 'var(--text-faint)', transition: 'color 0.12s' }}
onMouseEnter={e => e.currentTarget.style.color = 'var(--text-primary)'}
onMouseLeave={e => e.currentTarget.style.color = 'var(--text-faint)'}>
@@ -526,7 +526,8 @@ export default function CollabNotes(props: CollabNotesProps) {
<ConfirmDialog
isOpen={pendingDeleteNoteId !== null}
onClose={() => setPendingDeleteNoteId(null)}
- onConfirm={() => { if (pendingDeleteNoteId !== null) handleDeleteNote(pendingDeleteNoteId) }}
+ // Hand the promise back so the dialog absorbs the rethrow of a failed DELETE.
+ onConfirm={() => (pendingDeleteNoteId !== null ? handleDeleteNote(pendingDeleteNoteId) : undefined)}
title={t('collab.notes.confirmDeleteTitle')}
message={t('collab.notes.confirmDeleteBody')}
/>
diff --git a/client/src/components/Collab/CollabNotesWebsiteThumbnail.tsx b/client/src/components/Collab/CollabNotesWebsiteThumbnail.tsx
index c1136e21a..92e440a29 100644
Binary files a/client/src/components/Collab/CollabNotesWebsiteThumbnail.tsx and b/client/src/components/Collab/CollabNotesWebsiteThumbnail.tsx differ
diff --git a/client/src/components/Collab/CollabPanel.tsx b/client/src/components/Collab/CollabPanel.tsx
index 0489769ff..e75f5e3f2 100644
--- a/client/src/components/Collab/CollabPanel.tsx
+++ b/client/src/components/Collab/CollabPanel.tsx
@@ -39,10 +39,10 @@ interface CollabPanelProps {
}
const ALL_TABS = [
- { id: 'chat', featureKey: 'chat' as const, labelKey: 'collab.tabs.chat', fallback: 'Chat', icon: MessageCircle },
- { id: 'notes', featureKey: 'notes' as const, labelKey: 'collab.tabs.notes', fallback: 'Notes', icon: StickyNote },
- { id: 'polls', featureKey: 'polls' as const, labelKey: 'collab.tabs.polls', fallback: 'Polls', icon: BarChart3 },
- { id: 'next', featureKey: 'whatsnext' as const, labelKey: 'collab.whatsNext.title', fallback: "What's Next", icon: Sparkles },
+ { id: 'chat', featureKey: 'chat' as const, labelKey: 'collab.tabs.chat', icon: MessageCircle },
+ { id: 'notes', featureKey: 'notes' as const, labelKey: 'collab.tabs.notes', icon: StickyNote },
+ { id: 'polls', featureKey: 'polls' as const, labelKey: 'collab.tabs.polls', icon: BarChart3 },
+ { id: 'next', featureKey: 'whatsnext' as const, labelKey: 'collab.whatsNext.title', icon: Sparkles },
]
export default function CollabPanel({ tripId, tripMembers = [], collabFeatures }: CollabPanelProps) {
@@ -55,7 +55,7 @@ export default function CollabPanel({ tripId, tripMembers = [], collabFeatures }
const tabs = useMemo(() =>
ALL_TABS.filter(tab => features[tab.featureKey]).map(tab => ({
...tab,
- label: t(tab.labelKey) || tab.fallback,
+ label: t(tab.labelKey),
})),
[features, t])
diff --git a/client/src/components/Collab/CollabPolls.tsx b/client/src/components/Collab/CollabPolls.tsx
index 530f2b1ca..4507112d3 100644
--- a/client/src/components/Collab/CollabPolls.tsx
+++ b/client/src/components/Collab/CollabPolls.tsx
@@ -98,7 +98,7 @@ function CreatePollModal({ onClose, onCreate, t }: CreatePollModalProps) {
{/* Question */}
<div>
<div style={{ fontSize: 'calc(9px * var(--fs-scale-caption, 1))', fontWeight: 600, color: 'var(--text-faint)', textTransform: 'uppercase', letterSpacing: '0.05em', marginBottom: 4 }}>{t('collab.polls.question')}</div>
- <input autoFocus value={question} onChange={e => setQuestion(e.target.value)} placeholder={t('collab.polls.questionPlaceholder') || 'Ask a question...'} style={{ width: '100%', border: '1px solid var(--border-primary)', borderRadius: 10, padding: '8px 12px', fontSize: 'calc(13px * var(--fs-scale-body, 1))', background: 'var(--bg-input)', color: 'var(--text-primary)', fontFamily: 'inherit', outline: 'none', boxSizing: 'border-box' }} />
+ <input autoFocus value={question} onChange={e => setQuestion(e.target.value)} placeholder={t('collab.polls.questionPlaceholder')} style={{ width: '100%', border: '1px solid var(--border-primary)', borderRadius: 10, padding: '8px 12px', fontSize: 'calc(13px * var(--fs-scale-body, 1))', background: 'var(--bg-input)', color: 'var(--text-primary)', fontFamily: 'inherit', outline: 'none', boxSizing: 'border-box' }} />
</div>
{/* Options */}
@@ -208,6 +208,8 @@ function PollCard({ poll, currentUser, canEdit, onVote, onClose, onDelete, t }:
const isClosed = poll.is_closed || isExpired(poll.deadline)
const remaining = timeRemaining(poll.deadline)
const hasVoted = (poll.options || []).some(o => (o.voters || []).some(v => String(v.user_id) === String(currentUser.id)))
+ // Highest vote count across the options; 0 for a poll without options.
+ const topCount = (poll.options || []).reduce((max, o) => Math.max(max, o.voters?.length || 0), 0)
return (
<div style={{
@@ -271,10 +273,12 @@ function PollCard({ poll, currentUser, canEdit, onVote, onClose, onDelete, t }:
const count = opt.voters?.length || 0
const pct = total > 0 ? Math.round((count / total) * 100) : 0
const myVote = (opt.voters || []).some(v => String(v.user_id) === String(currentUser.id))
- const isWinner = isClosed && count === Math.max(...(poll.options || []).map(o => o.voters?.length || 0)) && count > 0
+ const isWinner = isClosed && count > 0 && count === topCount
return (
- <button key={idx} onClick={() => !isClosed && onVote(poll.id, idx)}
+ // React dispatches no mouse events on a disabled control, so the
+ // handlers below need no isClosed guard of their own.
+ <button key={idx} onClick={() => onVote(poll.id, idx)}
disabled={isClosed}
style={{
position: 'relative', display: 'flex', alignItems: 'center', gap: 8,
@@ -282,7 +286,7 @@ function PollCard({ poll, currentUser, canEdit, onVote, onClose, onDelete, t }:
background: 'var(--bg-secondary)', fontFamily: FONT, textAlign: 'left', width: '100%',
overflow: 'hidden', transition: 'transform 0.1s',
}}
- onMouseEnter={e => { if (!isClosed) e.currentTarget.style.transform = 'scale(1.01)' }}
+ onMouseEnter={e => { e.currentTarget.style.transform = 'scale(1.01)' }}
onMouseLeave={e => e.currentTarget.style.transform = 'scale(1)'}
>
{/* Progress bar background */}
@@ -474,7 +478,7 @@ export default function CollabPolls({ tripId, currentUser }: CollabPollsProps) {
<>
{activePolls.length > 0 && (
<div style={{ fontSize: 'calc(10px * var(--fs-scale-caption, 1))', fontWeight: 600, color: 'var(--text-faint)', textTransform: 'uppercase', letterSpacing: 0.3, padding: '8px 0 2px' }}>
- {t('collab.polls.closedSection') || 'Closed'}
+ {t('collab.polls.closedSection')}
</div>
)}
{closedPolls.map(poll => (
diff --git a/client/src/components/Collections/AddPlaceToCollectionModal.test.tsx b/client/src/components/Collections/AddPlaceToCollectionModal.test.tsx
index c9e698c3e..7658da9d9 100644
--- a/client/src/components/Collections/AddPlaceToCollectionModal.test.tsx
+++ b/client/src/components/Collections/AddPlaceToCollectionModal.test.tsx
@@ -261,6 +261,14 @@ describe('AddPlaceToCollectionModal', () => {
expect(screen.getByPlaceholderText('Longitude (e.g. 2.3522)')).toHaveValue('2.3522')
})
+ it('FE-COMP-ADDPLACECOL-015b: the pair is split the same way when pasted into longitude', () => {
+ setup()
+ const lng = screen.getByPlaceholderText('Longitude (e.g. 2.3522)')
+ fireEvent.paste(lng, { clipboardData: { getData: () => '48.8566, 2.3522' } })
+ expect(screen.getByPlaceholderText('Latitude (e.g. 48.8566)')).toHaveValue('48.8566')
+ expect(lng).toHaveValue('2.3522')
+ })
+
it('FE-COMP-ADDPLACECOL-016: a paste that is not a coordinate pair is left to the input', () => {
setup()
const lat = screen.getByPlaceholderText('Latitude (e.g. 48.8566)')
diff --git a/client/src/components/Collections/AddPlaceToCollectionModal.tsx b/client/src/components/Collections/AddPlaceToCollectionModal.tsx
index 671e5c01e..0e53dc78c 100644
--- a/client/src/components/Collections/AddPlaceToCollectionModal.tsx
+++ b/client/src/components/Collections/AddPlaceToCollectionModal.tsx
@@ -192,7 +192,7 @@ export default function AddPlaceToCollectionModal({ isOpen, collectionId, collec
<input value={address} onChange={e => setAddress(e.target.value)} placeholder={t('places.formAddressPlaceholder')} className={coordInputClass} />
<div className="grid grid-cols-2 gap-2 mt-2">
<NumericInput mode="signed" value={lat} onValueChange={setLat} onPaste={coordPaste} placeholder={t('places.formLat')} className={coordInputClass} />
- <NumericInput mode="signed" value={lng} onValueChange={setLng} placeholder={t('places.formLng')} className={coordInputClass} />
+ <NumericInput mode="signed" value={lng} onValueChange={setLng} onPaste={coordPaste} placeholder={t('places.formLng')} className={coordInputClass} />
</div>
</div>
diff --git a/client/src/components/Collections/CollectionPicker.tsx b/client/src/components/Collections/CollectionPicker.tsx
index 5626ed87c..5cc071c82 100644
--- a/client/src/components/Collections/CollectionPicker.tsx
+++ b/client/src/components/Collections/CollectionPicker.tsx
@@ -31,6 +31,28 @@ function distanceTo(p: CollectionPlace, center: { lat: number; lng: number }): n
interface Opt { key: string | number; label: string; icon?: React.ReactNode; count?: number }
+/** Detail requests fired at once while building the union — keeps a user with
+ * many lists from opening the modal with a burst of parallel requests. */
+const DETAIL_BATCH = 4
+
+/** Union of every list's places, in list order, without duplicates. */
+async function loadSavedPlaces(ids: number[]): Promise<CollectionPlace[]> {
+ const merged: CollectionPlace[] = []
+ const seen = new Set<number>()
+ for (let i = 0; i < ids.length; i += DETAIL_BATCH) {
+ const batch = await Promise.all(ids.slice(i, i + DETAIL_BATCH).map(id => collectionsApi.get(id).catch(() => null)))
+ for (const d of batch) {
+ if (!d) continue
+ for (const p of d.places) {
+ if (seen.has(p.id)) continue
+ seen.add(p.id)
+ merged.push(p)
+ }
+ }
+ }
+ return merged
+}
+
/** Compact click-away dropdown (Tailwind — this panel lives outside .trek-dash). */
function FilterDropdown({ current, options, onSelect, lead }: {
current: string | number
@@ -93,13 +115,8 @@ export default function CollectionPicker({ bias, onSelect, t }: CollectionPicker
setLoading(true)
collectionsApi.list()
.then(async (res) => {
- const detail = await Promise.all(res.collections.map(c => collectionsApi.get(c.id).catch(() => null)))
+ const merged = await loadSavedPlaces(res.collections.map(c => c.id))
if (cancelled) return
- const merged: CollectionPlace[] = []
- for (const d of detail) {
- if (!d) continue
- for (const p of d.places) merged.push(p)
- }
setLists(res.collections.map(c => ({ id: c.id, name: c.name, color: c.color ?? null })))
setPlaces(merged)
})
diff --git a/client/src/components/Collections/CollectionPlaceDetail.test.tsx b/client/src/components/Collections/CollectionPlaceDetail.test.tsx
index 440097c64..9fd473998 100644
--- a/client/src/components/Collections/CollectionPlaceDetail.test.tsx
+++ b/client/src/components/Collections/CollectionPlaceDetail.test.tsx
@@ -233,7 +233,8 @@ describe('CollectionPlaceDetail', () => {
const input = document.querySelector('input[type="file"]') as HTMLInputElement;
fireEvent.change(input, { target: { files: [new File(['x'], 'cover.png', { type: 'image/png' })] } });
- await waitFor(() => expect(addToast).toHaveBeenCalledWith('Upload rejected', 'error', undefined));
+ // A rejection without a server payload falls back to the localized message.
+ await waitFor(() => expect(addToast).toHaveBeenCalledWith('Could not upload image', 'error', undefined));
// The spinner is gone again, so the control accepts a retry.
await waitFor(() => expect(document.querySelector('.animate-spin')).toBeNull());
});
diff --git a/client/src/components/Collections/CollectionPlaceDetail.tsx b/client/src/components/Collections/CollectionPlaceDetail.tsx
index 0d8e3612f..42a7991da 100644
--- a/client/src/components/Collections/CollectionPlaceDetail.tsx
+++ b/client/src/components/Collections/CollectionPlaceDetail.tsx
@@ -15,7 +15,7 @@ import { useToast } from '../shared/Toast'
import { Tooltip } from '../shared/Tooltip'
import PlaceRating from '../shared/StarRating'
import { normalizeImageFile } from '../../utils/convertHeic'
-import { getApiErrorMessage } from '../../types'
+import { getApiErrorMessage } from '../../utils/apiError'
function linkHost(url: string): string {
try { return new URL(url).hostname.replace(/^www\./, '') } catch { return url }
diff --git a/client/src/components/Collections/ListEditorModal.test.tsx b/client/src/components/Collections/ListEditorModal.test.tsx
index 7b965a37e..bac602ebd 100644
--- a/client/src/components/Collections/ListEditorModal.test.tsx
+++ b/client/src/components/Collections/ListEditorModal.test.tsx
@@ -322,7 +322,8 @@ describe('ListEditorModal', () => {
const { props } = setup()
fireEvent.change(screen.getByPlaceholderText('e.g. Tokyo 2025'), { target: { value: 'Oslo' } })
fireEvent.click(screen.getByRole('button', { name: 'Create' }))
- await waitFor(() => expect(addToast).toHaveBeenCalledWith('boom', 'error', undefined))
+ // A plain failure has no server-provided message, so the translated fallback shows.
+ await waitFor(() => expect(addToast).toHaveBeenCalledWith('Error', 'error', undefined))
expect(props.onClose).not.toHaveBeenCalled()
// The save button releases again so the user can retry.
await waitFor(() => expect(screen.getByRole('button', { name: 'Create' })).not.toBeDisabled())
diff --git a/client/src/components/Collections/ListEditorModal.tsx b/client/src/components/Collections/ListEditorModal.tsx
index 2b0f5cf86..9b0609cb1 100644
--- a/client/src/components/Collections/ListEditorModal.tsx
+++ b/client/src/components/Collections/ListEditorModal.tsx
@@ -4,7 +4,7 @@ import Modal from '../shared/Modal'
import { useCollectionStore } from '../../store/collectionStore'
import { useToast } from '../shared/Toast'
import { tripsApi } from '../../api/client'
-import { getApiErrorMessage } from '../../types'
+import { getApiErrorMessage } from '../../utils/apiError'
import { normalizeLinkUrl } from '../../pages/collections/collectionsModel'
import type { TranslationFn } from '../../types'
import type { Collection, CollectionLink } from '@trek/shared'
diff --git a/client/src/components/Collections/SaveToCollectionModal.test.tsx b/client/src/components/Collections/SaveToCollectionModal.test.tsx
index 61e6637e5..e3487b8cc 100644
--- a/client/src/components/Collections/SaveToCollectionModal.test.tsx
+++ b/client/src/components/Collections/SaveToCollectionModal.test.tsx
@@ -219,7 +219,7 @@ describe('SaveToCollectionModal', () => {
expect(useSaveToCollectionStore.getState().version).toBe(0);
});
- it('FE-COMP-SAVETOCOL-013: a second click on the busy row is ignored while the save runs', async () => {
+ it('FE-COMP-SAVETOCOL-013: every row locks while a save runs', async () => {
let resolve!: (v: CollectionSaveResult) => void;
const save = vi.spyOn(collectionsApi, 'savePlace').mockReturnValue(new Promise(r => { resolve = r; }));
openFor();
@@ -228,7 +228,9 @@ describe('SaveToCollectionModal', () => {
const wishlist = await screen.findByRole('button', { name: /Wishlist/ });
fireEvent.click(wishlist);
expect(wishlist).toBeDisabled();
- fireEvent.click(screen.getByRole('button', { name: /Favorites/ }));
+ const favorites = screen.getByRole('button', { name: /Favorites/ });
+ expect(favorites).toBeDisabled();
+ fireEvent.click(favorites);
expect(save).toHaveBeenCalledTimes(1);
resolve({});
diff --git a/client/src/components/Collections/SaveToCollectionModal.tsx b/client/src/components/Collections/SaveToCollectionModal.tsx
index 521fd84d4..77d3bc476 100644
--- a/client/src/components/Collections/SaveToCollectionModal.tsx
+++ b/client/src/components/Collections/SaveToCollectionModal.tsx
@@ -169,7 +169,7 @@ export default function SaveToCollectionModal(): React.ReactElement | null {
key={list.id}
type="button"
onClick={() => handleToggle(list)}
- disabled={busy}
+ disabled={busyId != null}
className={`flex items-center gap-3 px-3 py-2.5 rounded-xl border text-left transition-colors disabled:opacity-60 ${saved ? 'border-accent bg-accent-subtle' : 'border-edge bg-surface-card hover:bg-surface-hover'}`}
>
<span className="w-2.5 h-2.5 rounded-full shrink-0" style={{ background: list.color || 'var(--accent)' }} />
diff --git a/client/src/components/Collections/SaveTripPlacesToListModal.test.tsx b/client/src/components/Collections/SaveTripPlacesToListModal.test.tsx
index 4f7f23f8b..f588d579c 100644
--- a/client/src/components/Collections/SaveTripPlacesToListModal.test.tsx
+++ b/client/src/components/Collections/SaveTripPlacesToListModal.test.tsx
@@ -98,7 +98,7 @@ describe('SaveTripPlacesToListModal', () => {
vi.spyOn(collectionsApi, 'list').mockResolvedValue(listResponse(many));
renderModal();
- const search = await screen.findByPlaceholderText('Search trips');
+ const search = await screen.findByPlaceholderText('Search lists');
fireEvent.change(search, { target: { value: 'list 4' } });
expect(screen.getByText('List 4')).toBeInTheDocument();
expect(screen.queryByText('List 5')).not.toBeInTheDocument();
@@ -110,7 +110,7 @@ describe('SaveTripPlacesToListModal', () => {
it('FE-COMP-SAVETRIPPL-007: five lists or fewer need no search box', async () => {
renderModal();
await screen.findByText('Favorites');
- expect(screen.queryByPlaceholderText('Search trips')).not.toBeInTheDocument();
+ expect(screen.queryByPlaceholderText('Search lists')).not.toBeInTheDocument();
});
it('FE-COMP-SAVETRIPPL-008: picking a list copies every selected place, reports it and closes', async () => {
diff --git a/client/src/components/Collections/SaveTripPlacesToListModal.tsx b/client/src/components/Collections/SaveTripPlacesToListModal.tsx
index 120f18f9c..3063d0d8e 100644
--- a/client/src/components/Collections/SaveTripPlacesToListModal.tsx
+++ b/client/src/components/Collections/SaveTripPlacesToListModal.tsx
@@ -77,7 +77,7 @@ export default function SaveTripPlacesToListModal({ isOpen, tripId, placeIds, on
autoFocus
value={search}
onChange={e => setSearch(e.target.value)}
- placeholder={t('collections.copyToTripSearch')}
+ placeholder={t('collections.searchLists')}
className="w-full pl-8 pr-3 py-2 rounded-lg border border-edge bg-surface-input text-content text-[13px] outline-none focus:border-accent"
/>
</div>
diff --git a/client/src/components/Collections/ShareCollectionModal.tsx b/client/src/components/Collections/ShareCollectionModal.tsx
index b9ff7868e..5ade54945 100644
--- a/client/src/components/Collections/ShareCollectionModal.tsx
+++ b/client/src/components/Collections/ShareCollectionModal.tsx
@@ -114,6 +114,7 @@ export default function ShareCollectionModal({
}
const handleSetRole = async (userId: number, role: CollectionRole) => {
+ if (settingRoleId != null) return
setSettingRoleId(userId)
try {
await setMemberRole(collectionId, userId, role)
diff --git a/client/src/components/Files/FileManagerImageLightbox.test.tsx b/client/src/components/Files/FileManagerImageLightbox.test.tsx
index ce25174db..e49ff1f5f 100644
--- a/client/src/components/Files/FileManagerImageLightbox.test.tsx
+++ b/client/src/components/Files/FileManagerImageLightbox.test.tsx
@@ -1,4 +1,4 @@
-// FE-W4LBX-001 to FE-W4LBX-017
+// FE-W4LBX-001 to FE-W4LBX-019
import { describe, it, expect, vi, beforeEach } from 'vitest'
import type { TripFile } from '../../types'
import { render, screen, fireEvent, waitFor } from '../../../tests/helpers/render'
@@ -208,4 +208,41 @@ describe('ImageLightbox', () => {
expect(onClose).not.toHaveBeenCalled()
})
+
+ it('FE-W4LBX-018: Escape reaches the current onClose after a re-render', () => {
+ const first = vi.fn()
+ const second = vi.fn()
+ const { rerender } = render(<ImageLightbox files={IMAGES} initialIndex={0} onClose={first} />)
+
+ rerender(<ImageLightbox files={IMAGES} initialIndex={0} onClose={second} />)
+ fireEvent.keyDown(window, { key: 'Escape' })
+
+ expect(second).toHaveBeenCalledOnce()
+ expect(first).not.toHaveBeenCalled()
+ })
+
+ it('FE-W4LBX-019: the strip mints thumbnail tokens only for thumbs in view', async () => {
+ // Every thumbnail costs its own one-shot token, so an off-screen thumb must
+ // stay quiet. The default observer stub never intersects.
+ const { unmount } = render(<ImageLightbox files={IMAGES} initialIndex={0} onClose={() => {}} />)
+ await waitFor(() => expect(getAuthUrl).toHaveBeenCalledWith('/f/a.jpg', 'download'))
+ expect(getAuthUrl).toHaveBeenCalledTimes(1)
+ unmount()
+
+ getAuthUrl.mockClear()
+ const original = globalThis.IntersectionObserver
+ globalThis.IntersectionObserver = class {
+ constructor(private cb: IntersectionObserverCallback) {}
+ observe() { this.cb([{ isIntersecting: true } as IntersectionObserverEntry], this as unknown as IntersectionObserver) }
+ disconnect() {}
+ unobserve() {}
+ takeRecords() { return [] }
+ } as unknown as typeof IntersectionObserver
+ try {
+ render(<ImageLightbox files={IMAGES} initialIndex={0} onClose={() => {}} />)
+ await waitFor(() => expect(getAuthUrl).toHaveBeenCalledWith('/f/c.jpg', 'download'))
+ } finally {
+ globalThis.IntersectionObserver = original
+ }
+ })
})
diff --git a/client/src/components/Files/FileManagerImageLightbox.tsx b/client/src/components/Files/FileManagerImageLightbox.tsx
index 5492d412c..0afaa127a 100644
--- a/client/src/components/Files/FileManagerImageLightbox.tsx
+++ b/client/src/components/Files/FileManagerImageLightbox.tsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react'
+import { useState, useEffect, useRef } from 'react'
import { ExternalLink, Download, X, ChevronLeft, ChevronRight, Play } from 'lucide-react'
import { useTranslation } from '../../i18n'
import type { TripFile } from '../../types'
@@ -41,7 +41,7 @@ export function ImageLightbox({ files, initialIndex, onClose }: ImageLightboxPro
}
window.addEventListener('keydown', handler)
return () => window.removeEventListener('keydown', handler)
- }, [])
+ }, [onClose])
if (!file) return null
@@ -128,11 +128,30 @@ export function ImageLightbox({ files, initialIndex, onClose }: ImageLightboxPro
function ThumbImg({ file, active, onClick }: { file: TripFile & { url: string }; active: boolean; onClick: () => void }) {
const fileIsVideo = isVideo(file.mime_type)
const [src, setSrc] = useState('')
+ const [visible, setVisible] = useState(false)
+ const ref = useRef<HTMLButtonElement>(null)
+
+ // Each thumbnail costs its own one-shot download token, so the strip only
+ // mints them for the thumbs that actually scroll into view.
+ useEffect(() => {
+ const el = ref.current
+ if (!el || typeof IntersectionObserver !== 'function') { setVisible(true); return }
+ const io = new IntersectionObserver(([e]) => { if (e.isIntersecting) { setVisible(true); io.disconnect() } }, { rootMargin: '200px' })
+ io.observe(el)
+ return () => io.disconnect()
+ }, [])
+
// Videos have no stored thumbnail and can't render as an <img>; show a play
// placeholder and don't mint a download token for them (#823).
- useEffect(() => { if (!fileIsVideo) getAuthUrl(file.url, 'download').then(setSrc) }, [file.url, fileIsVideo])
+ useEffect(() => {
+ if (!visible || fileIsVideo) return
+ let current = true
+ getAuthUrl(file.url, 'download').then(u => { if (current) setSrc(u) })
+ return () => { current = false }
+ }, [file.url, fileIsVideo, visible])
+
return (
- <button onClick={onClick} style={{
+ <button ref={ref} onClick={onClick} style={{
width: 48, height: 48, borderRadius: 6, overflow: 'hidden', border: active ? '2px solid #fff' : '2px solid transparent',
opacity: active ? 1 : 0.5, cursor: 'pointer', padding: 0, background: '#111', flexShrink: 0, transition: 'opacity 0.15s',
display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'rgba(255,255,255,0.7)',
diff --git a/client/src/components/Files/useFileManager.ts b/client/src/components/Files/useFileManager.ts
index 0bfcb5cc3..87a675cf9 100644
--- a/client/src/components/Files/useFileManager.ts
+++ b/client/src/components/Files/useFileManager.ts
@@ -54,6 +54,7 @@ export function useFileManager({ files = [], onUpload, onDelete, onUpdate, place
setShowTrash(v => !v)
}, [showTrash, loadTrash])
+ // onUpdate doubles as the "files changed" signal towards the parent; the arguments carry no payload.
const refreshFiles = useCallback(async () => {
if (onUpdate) onUpdate(0, {} as any)
}, [onUpdate])
diff --git a/client/src/components/FourZero/NoFearShow.test.tsx b/client/src/components/FourZero/NoFearShow.test.tsx
index e2ec0bf39..2de2a7628 100644
--- a/client/src/components/FourZero/NoFearShow.test.tsx
+++ b/client/src/components/FourZero/NoFearShow.test.tsx
@@ -208,13 +208,20 @@ describe('NoFearShow', () => {
expect(signal.aborted).toBe(true)
})
- it('FE-NOFEAR-SHOW-005: re-fits the canvas on window resize', () => {
+ it('FE-NOFEAR-SHOW-005: coalesces a resize storm into a single re-fit', () => {
render(<NoFearShow onClose={vi.fn()} />)
expect(scene().layout).toHaveBeenCalledTimes(1)
- act(() => { window.dispatchEvent(new Event('resize')) })
+ act(() => {
+ for (let i = 0; i < 20; i++) window.dispatchEvent(new Event('resize'))
+ })
+ // layout() rebakes every static layer, so nothing happens while the drag runs
+ expect(scene().layout).toHaveBeenCalledTimes(1)
+
+ act(() => { vi.advanceTimersByTime(150) })
expect(scene().layout).toHaveBeenCalledTimes(2)
+ expect(scene().layout).toHaveBeenLastCalledWith(800, 600)
})
it('FE-NOFEAR-SHOW-006: shows no line before the first cue', () => {
@@ -248,10 +255,9 @@ describe('NoFearShow', () => {
expect(ghost).not.toBeNull()
expect(ghost?.querySelectorAll('.fz-char-decay')).toHaveLength(LINES.afraid.length)
- // The 1.4s retirement timer captures `lastCue` by reference, and the loop has
- // already advanced it — so the faded-out ghost node stays in the DOM.
+ // Once its letters have decayed the ghost retires itself.
act(() => { vi.advanceTimersByTime(1400) })
- expect(document.querySelector('.fz-line-ghost')).not.toBeNull()
+ expect(document.querySelector('.fz-line-ghost')).toBeNull()
frame(12.1)
const ghostText = document.querySelector('.fz-line-ghost')?.textContent ?? ''
@@ -572,6 +578,13 @@ describe('NoFearShow', () => {
frame(76)
expect(stubs.assembly).toHaveLength(1)
expect(screen.getByRole('heading', { level: 1 })).not.toHaveClass('fz-word-hidden')
+
+ // Targets are absolute screen coordinates, so a resize invalidates them and
+ // the next frame re-samples the moved title.
+ act(() => { window.dispatchEvent(new Event('resize')) })
+ act(() => { vi.advanceTimersByTime(150) })
+ frame(77)
+ expect(stubs.assembly).toHaveLength(2)
})
it('FE-NOFEAR-SHOW-031: tears down chrome, listeners and audio on unmount', () => {
diff --git a/client/src/components/FourZero/NoFearShow.tsx b/client/src/components/FourZero/NoFearShow.tsx
index a0bfe95f9..4a72f05f1 100644
--- a/client/src/components/FourZero/NoFearShow.tsx
+++ b/client/src/components/FourZero/NoFearShow.tsx
@@ -114,10 +114,20 @@ export default function NoFearShow({ onClose }: { onClose: () => void }) {
cv.height = Math.round(cv.clientHeight * dpr)
cv.getContext('2d')?.setTransform(dpr, 0, 0, dpr, 0, 0)
scene.layout(cv.clientWidth, cv.clientHeight)
+ // The finale samples the title rect in screen coordinates, so it has to be
+ // re-sampled against the new geometry.
+ assemblyRef.current = null
}
fit()
if (cv) void scene.load(cv.clientWidth, cv.clientHeight, aborter.signal)
- window.addEventListener('resize', fit)
+ // layout() rebakes every static layer, which is far too heavy for the event
+ // storm a window drag produces — coalesce to the end of the gesture.
+ let refitTimer = 0
+ const onResize = () => {
+ window.clearTimeout(refitTimer)
+ refitTimer = window.setTimeout(fit, 150)
+ }
+ window.addEventListener('resize', onResize)
// The traveler's own places, gathered quietly during the fear act. Fail-soft:
// without them the show falls back to its generic lines.
void (async () => {
@@ -163,7 +173,8 @@ export default function NoFearShow({ onClose }: { onClose: () => void }) {
if (reducedMotion) skipToEnd()
return () => {
document.body.classList.remove('fz-show-open')
- window.removeEventListener('resize', fit)
+ window.clearTimeout(refitTimer)
+ window.removeEventListener('resize', onResize)
document.removeEventListener('visibilitychange', onVisibility)
window.removeEventListener('pointerdown', onPointer)
aborter.abort()
@@ -191,10 +202,11 @@ export default function NoFearShow({ onClose }: { onClose: () => void }) {
if (idx !== lastCue && idx >= 0) {
// A replaced fear-act line decays letter by letter instead of vanishing.
if (lastCue >= 0 && lastCue <= 3) {
- const prevKey = CUES[lastCue].line
+ const ghostId = lastCue // pin it — lastCue advances on the next line
+ const prevKey = CUES[ghostId].line
if (prevKey) {
- setGhost({ text: copy.lines[prevKey], id: lastCue })
- window.setTimeout(() => setGhost(g => (g?.id === lastCue ? null : g)), 1400)
+ setGhost({ text: copy.lines[prevKey], id: ghostId })
+ window.setTimeout(() => setGhost(g => (g?.id === ghostId ? null : g)), 1400)
}
}
lastCue = idx
diff --git a/client/src/components/FourZero/noFearAssembly.test.ts b/client/src/components/FourZero/noFearAssembly.test.ts
index eea015ea9..91cf91055 100644
--- a/client/src/components/FourZero/noFearAssembly.test.ts
+++ b/client/src/components/FourZero/noFearAssembly.test.ts
@@ -213,6 +213,23 @@ describe('TextAssembly.init', () => {
expect(main.fills).toHaveLength(0)
})
+ it('FE-NOFEAR-ASM-019: drops the previous targets when a re-init cannot raster', () => {
+ alphaAt = () => 255
+ cycleRandom([0.1])
+
+ const a = new TextAssembly()
+ a.init('X', 'bold 64px Inter', BOX, 1000, 600)
+ expect(a.isReady()).toBe(true)
+
+ contextAvailable = false
+ a.init('X', 'bold 64px Inter', BOX, 1000, 600)
+ expect(a.isReady()).toBe(false)
+
+ const main = makeCtx()
+ a.draw(asCtx(main), 1, 0, 0)
+ expect(main.fills).toHaveLength(0)
+ })
+
it('FE-NOFEAR-ASM-009: keeps a degenerate box at one raster pixel', () => {
alphaAt = () => 255
cycleRandom([0.1, 0.1, 0.1, 0.1, 0.1, 0])
diff --git a/client/src/components/FourZero/noFearAssembly.ts b/client/src/components/FourZero/noFearAssembly.ts
index d8a19af14..d8f6b21ca 100644
--- a/client/src/components/FourZero/noFearAssembly.ts
+++ b/client/src/components/FourZero/noFearAssembly.ts
@@ -32,6 +32,10 @@ export class TextAssembly {
off.width = Math.max(Math.round(box.width * scale), 1)
off.height = Math.max(Math.round(box.height * scale), 1)
const c = off.getContext('2d')
+ // A re-init that cannot raster must go quiet rather than keep the previous
+ // run's particles on screen at coordinates that no longer hold.
+ this.ready = false
+ this.particles = []
if (!c) return
c.font = font.replace(/(\d+(?:\.\d+)?)px/, (_, n) => `${Number(n) * scale}px`)
c.textAlign = 'center'
@@ -40,7 +44,6 @@ export class TextAssembly {
c.fillText(text, off.width / 2, off.height / 2)
const img = c.getImageData(0, 0, off.width, off.height).data
const step = 3 // sample grid in raster px — ~800-1400 particles for a title
- this.particles = []
for (let y = 0; y < off.height; y += step) {
for (let x = 0; x < off.width; x += step) {
if (img[(y * off.width + x) * 4 + 3] > 128) {
diff --git a/client/src/components/FourZero/noFearScene.ts b/client/src/components/FourZero/noFearScene.ts
index fb7679f97..249149eb8 100644
--- a/client/src/components/FourZero/noFearScene.ts
+++ b/client/src/components/FourZero/noFearScene.ts
@@ -144,7 +144,7 @@ export class NoFearScene {
if (r.length < step * 4) continue // rings too small to survive decimation are visual noise
const thin: Ring = []
for (let i = 0; i < r.length; i += step) thin.push(r[i])
- if (thin.length >= 4) rings.push(thin)
+ rings.push(thin)
}
this.rings = rings
if (signal?.aborted) return
diff --git a/client/src/components/Journey/JournalBody.test.tsx b/client/src/components/Journey/JournalBody.test.tsx
index 0d9cc0270..f22553bd4 100644
--- a/client/src/components/Journey/JournalBody.test.tsx
+++ b/client/src/components/Journey/JournalBody.test.tsx
@@ -66,11 +66,11 @@ describe('JournalBody', () => {
expect(code!.getAttribute('style')).toContain('rgba(0, 0, 0, 0.06)');
});
- it('FE-COMP-JOURNALBODY-010: renders fenced code blocks inside a pre element', () => {
+ it('FE-COMP-JOURNALBODY-010: renders fenced code blocks inside a single pre element', () => {
const { container } = render(<JournalBody text={'```js\nconst a = 1\n```'} />);
- const pre = container.querySelector('pre');
- expect(pre).toBeInTheDocument();
- expect(pre!.querySelector('code')!.textContent).toContain('const a = 1');
+ const pres = container.querySelectorAll('pre');
+ expect(pres).toHaveLength(1);
+ expect(pres[0].querySelector('code')!.textContent).toContain('const a = 1');
});
it('FE-COMP-JOURNALBODY-011: renders h1 and h3 as plain paragraphs', () => {
@@ -93,7 +93,9 @@ describe('JournalBody', () => {
const { container } = render(<JournalBody text={'`x`\n\n```js\ny\n```'} dark />);
const [inline] = Array.from(container.querySelectorAll('code'));
expect(inline.getAttribute('style')).toContain('rgba(255, 255, 255, 0.08)');
- // react-markdown supplies its own outer <pre>; the styled one is nested inside.
- expect(container.querySelectorAll('pre')[1].getAttribute('style')).toContain('rgba(255, 255, 255, 0.05)');
+ // the block styling sits on react-markdown's own <pre>, there is no second one
+ const pres = container.querySelectorAll('pre');
+ expect(pres).toHaveLength(1);
+ expect(pres[0].getAttribute('style')).toContain('rgba(255, 255, 255, 0.05)');
});
});
diff --git a/client/src/components/Journey/JournalBody.tsx b/client/src/components/Journey/JournalBody.tsx
index 2051b31a4..952df32e4 100644
--- a/client/src/components/Journey/JournalBody.tsx
+++ b/client/src/components/Journey/JournalBody.tsx
@@ -41,19 +41,18 @@ export default function JournalBody({ text, dark }: Props) {
strong: ({ children }) => <strong style={{ fontWeight: 600 }}>{children}</strong>,
em: ({ children }) => <em>{children}</em>,
hr: () => <hr style={{ border: 'none', borderTop: '1px solid var(--journal-border)', margin: '20px 0' }} />,
+ // react-markdown already wraps fenced code in a <pre>, so the block
+ // styling belongs here — the code renderer only handles inline code.
+ pre: ({ children }) => (
+ <pre style={{
+ background: dark ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.04)',
+ borderRadius: 8, padding: 14, overflowX: 'auto',
+ fontSize: 'calc(13px * var(--fs-scale-body, 1))', fontFamily: 'monospace', margin: '12px 0',
+ }}>{children}</pre>
+ ),
code: ({ children, className }) => {
const isBlock = className?.includes('language-')
- if (isBlock) {
- return (
- <pre style={{
- background: dark ? 'rgba(255,255,255,0.05)' : 'rgba(0,0,0,0.04)',
- borderRadius: 8, padding: 14, overflowX: 'auto',
- fontSize: 'calc(13px * var(--fs-scale-body, 1))', fontFamily: 'monospace', margin: '12px 0',
- }}>
- <code>{children}</code>
- </pre>
- )
- }
+ if (isBlock) return <code>{children}</code>
return (
<code style={{
background: dark ? 'rgba(255,255,255,0.08)' : 'rgba(0,0,0,0.06)',
diff --git a/client/src/components/Journey/JourneyDetailPageEntryEditor.test.tsx b/client/src/components/Journey/JourneyDetailPageEntryEditor.test.tsx
index dce30731b..7607acd7a 100644
--- a/client/src/components/Journey/JourneyDetailPageEntryEditor.test.tsx
+++ b/client/src/components/Journey/JourneyDetailPageEntryEditor.test.tsx
@@ -431,6 +431,27 @@ describe('EntryEditor', () => {
expect(await screen.findByText('No connected photo providers are available.')).toBeInTheDocument()
})
+ it('FE-JRN-EDITOR-019b: leaving the external tab while the providers load does not strand the picker', async () => {
+ server.use(
+ http.get('/api/addons', async () => {
+ await delay(120)
+ return HttpResponse.json({
+ addons: [{ id: 'immich', name: 'Immich', type: 'photo_provider', icon: 'camera', enabled: true }],
+ })
+ }),
+ http.get('/api/integrations/memories/immich/status', () => HttpResponse.json({ connected: true })),
+ http.post('/api/integrations/memories/immich/search', () => HttpResponse.json({ assets: [], hasMore: false })),
+ )
+ const user = userEvent.setup()
+ mountEditor(buildEntry({ id: 10 }))
+
+ await user.click(screen.getByRole('button', { name: 'External photos' }))
+ await user.click(screen.getByRole('button', { name: /Upload photos/ }))
+ await user.click(screen.getByRole('button', { name: 'External photos' }))
+
+ expect(await screen.findByTestId('journey-external-provider-immich')).toBeInTheDocument()
+ })
+
it('FE-JRN-EDITOR-020: queues photos picked from a connected provider and clears them again', async () => {
useConnectedImmich()
const user = userEvent.setup()
diff --git a/client/src/components/Journey/JourneyDetailPageEntryEditor.tsx b/client/src/components/Journey/JourneyDetailPageEntryEditor.tsx
index 56ac22c1d..86c19ce13 100644
--- a/client/src/components/Journey/JourneyDetailPageEntryEditor.tsx
+++ b/client/src/components/Journey/JourneyDetailPageEntryEditor.tsx
@@ -86,8 +86,10 @@ export function EntryEditor({ entry, journeyId, tripDates, galleryPhotos, trips,
useEffect(() => {
if (photoTab !== 'external' || availableProviders.length > 0 || providersLoading) return
- let cancelled = false
setProvidersLoading(true)
+ // The discovery is not tied to the open tab, so the result is applied even if
+ // the user left the tab meanwhile — dropping it would leave providersLoading
+ // stuck and block every later run of this effect.
;(async () => {
try {
const addonsData = await addonsApi.enabled()
@@ -99,14 +101,11 @@ export function EntryEditor({ entry, journeyId, tripDates, galleryPhotos, trips,
if (response.ok && (await response.json()).connected) connected.push({ id: provider.id, name: provider.name })
} catch {}
}
- if (!cancelled) {
- setAvailableProviders(connected)
- if (connected.length > 0) setExternalProvider(current => current || connected[0].id)
- }
+ setAvailableProviders(connected)
+ if (connected.length > 0) setExternalProvider(current => current || connected[0].id)
} catch {}
- if (!cancelled) setProvidersLoading(false)
+ setProvidersLoading(false)
})()
- return () => { cancelled = true }
}, [photoTab, availableProviders.length])
const activeExternalProvider = externalProvider || availableProviders[0]?.id || null
diff --git a/client/src/components/Journey/JourneyDetailPageMapView.tsx b/client/src/components/Journey/JourneyDetailPageMapView.tsx
index bcfec72c7..a6baefb87 100644
--- a/client/src/components/Journey/JourneyDetailPageMapView.tsx
+++ b/client/src/components/Journey/JourneyDetailPageMapView.tsx
@@ -25,10 +25,6 @@ export function MapView({ entries, mapEntries, sortedDates, activeLocationId, fu
})
const dates = [...byDate.keys()].sort()
- // find first and last entry indices
- const firstId = mapEntries[0]?.id
- const lastId = mapEntries[mapEntries.length - 1]?.id
-
const mapItems = useMemo(() => mapEntries.map(e => ({
id: String(e.id),
lat: e.location_lat!,
@@ -85,8 +81,6 @@ export function MapView({ entries, mapEntries, sortedDates, activeLocationId, fu
{/* Location items */}
{items.map(({ entry: e, globalIdx }, itemIdx) => {
const isActive = activeLocationId === String(e.id)
- const isFirst = e.id === firstId
- const isLast = e.id === lastId
const showConnector = itemIdx < items.length - 1
return (
diff --git a/client/src/components/Journey/JourneyDetailPageSettingsDialog.test.tsx b/client/src/components/Journey/JourneyDetailPageSettingsDialog.test.tsx
index b25be7f96..481063e24 100644
--- a/client/src/components/Journey/JourneyDetailPageSettingsDialog.test.tsx
+++ b/client/src/components/Journey/JourneyDetailPageSettingsDialog.test.tsx
@@ -323,6 +323,19 @@ describe('JourneySettingsDialog', () => {
expect(await screen.findByRole('heading', { name: 'Link Trip' })).toBeInTheDocument()
})
+ it('FE-JRN-SETTINGS-019b: closing the link-trip dialog leaves the settings dialog alone', async () => {
+ const user = userEvent.setup()
+ const { onClose } = mountDialog(buildJourney({ trips: [] }))
+
+ await user.click(screen.getByRole('button', { name: 'Add Trip' }))
+ const linkHeading = await screen.findByRole('heading', { name: 'Link Trip' })
+ await user.click(linkHeading.parentElement!.querySelector('button')!)
+
+ expect(screen.queryByRole('heading', { name: 'Link Trip' })).not.toBeInTheDocument()
+ expect(onClose).not.toHaveBeenCalled()
+ expect(screen.getByRole('heading', { name: 'Journey Settings' })).toBeInTheDocument()
+ })
+
it('FE-JRN-SETTINGS-020: closes straight away when nothing was edited', async () => {
const user = userEvent.setup()
const { onClose } = mountDialog()
diff --git a/client/src/components/Journey/JourneyDetailPageSettingsDialog.tsx b/client/src/components/Journey/JourneyDetailPageSettingsDialog.tsx
index 7090c9df0..22f893045 100644
--- a/client/src/components/Journey/JourneyDetailPageSettingsDialog.tsx
+++ b/client/src/components/Journey/JourneyDetailPageSettingsDialog.tsx
@@ -275,14 +275,17 @@ export function JourneySettingsDialog({ journey, onClose, onSaved, onOpenInvite,
danger
/>
- {/* Add Trip */}
+ {/* Add Trip — sits inside the backdrop, so its clicks have to be kept
+ from bubbling into the close/discard handler underneath */}
{showAddTrip && (
- <AddTripDialog
- journeyId={journey.id}
- existingTripIds={journey.trips.map((t: any) => t.trip_id)}
- onClose={() => setShowAddTrip(false)}
- onAdded={() => { setShowAddTrip(false); onSaved() }}
- />
+ <div onClick={e => e.stopPropagation()}>
+ <AddTripDialog
+ journeyId={journey.id}
+ existingTripIds={journey.trips.map((t: any) => t.trip_id)}
+ onClose={() => setShowAddTrip(false)}
+ onAdded={() => { setShowAddTrip(false); onSaved() }}
+ />
+ </div>
)}
<ConfirmDialog
diff --git a/client/src/components/Journey/JourneyMap.tsx b/client/src/components/Journey/JourneyMap.tsx
index 54e5c5734..1345de53d 100644
--- a/client/src/components/Journey/JourneyMap.tsx
+++ b/client/src/components/Journey/JourneyMap.tsx
@@ -154,10 +154,6 @@ const JourneyMap = forwardRef<JourneyMapHandle, Props>(function JourneyMap(
useEffect(() => {
if (!containerRef.current) return
- if (mapRef.current) {
- mapRef.current.remove()
- mapRef.current = null
- }
markersRef.current.clear()
const map = L.map(containerRef.current, {
diff --git a/client/src/components/Journey/JourneyMapGL.test.tsx b/client/src/components/Journey/JourneyMapGL.test.tsx
index ff6ef4252..193462a0b 100644
--- a/client/src/components/Journey/JourneyMapGL.test.tsx
+++ b/client/src/components/Journey/JourneyMapGL.test.tsx
@@ -549,6 +549,20 @@ describe('JourneyMapGL', () => {
expect(addTerrainAndSky).not.toHaveBeenCalled()
})
+ it('FE-COMP-JMAPGL-031b: switching the ui language repins the labels without rebuilding the map', () => {
+ withToken({ language: 'gr' })
+ vi.mocked(isStandardFamily).mockReturnValue(true)
+
+ render(<JourneyMapGL checkins={[]} entries={entries} />)
+ const builds = vi.mocked(mapboxgl.Map).mock.calls.length
+ gl.map.setConfigProperty.mockClear()
+
+ act(() => { withToken({ language: 'fr' }) })
+
+ expect(gl.map.setConfigProperty).toHaveBeenCalledWith('basemap', 'language', 'fr')
+ expect(vi.mocked(mapboxgl.Map).mock.calls).toHaveLength(builds)
+ })
+
it('FE-COMP-JMAPGL-032: sdk failures while configuring the basemap do not break the load', () => {
withToken()
vi.mocked(isStandardFamily).mockReturnValue(true)
diff --git a/client/src/components/Journey/JourneyMapGL.tsx b/client/src/components/Journey/JourneyMapGL.tsx
index c57d7c327..f3e585411 100644
--- a/client/src/components/Journey/JourneyMapGL.tsx
+++ b/client/src/components/Journey/JourneyMapGL.tsx
@@ -233,6 +233,8 @@ const JourneyMapGL = forwardRef<JourneyMapGLHandle, Props>(function JourneyMapGL
onMarkerClickRef.current = onMarkerClick
const darkRef = useRef(dark)
darkRef.current = dark
+ const mapLangRef = useRef(mapLang)
+ mapLangRef.current = mapLang
const showPopup = useCallback((id: string) => {
const item = itemsRef.current.find(i => i.id === id)
@@ -382,7 +384,7 @@ const JourneyMapGL = forwardRef<JourneyMapGLHandle, Props>(function JourneyMapGL
// Pin the basemap label language to the UI language so labels don't fall back to the
// browser/OS locale and stack multiple scripts per place (#1299).
if (!isMapLibre && isStandardFamily(glStyle)) {
- try { map.setConfigProperty('basemap', 'language', basemapLanguage(mapLang)) } catch { /* style/SDK may not support it */ }
+ try { map.setConfigProperty('basemap', 'language', basemapLanguage(mapLangRef.current)) } catch { /* style/SDK may not support it */ }
}
// route trail — dashed line connecting entries in time order
@@ -451,6 +453,14 @@ const JourneyMapGL = forwardRef<JourneyMapGLHandle, Props>(function JourneyMapGL
}
}, [entries, stableTrail, glProvider, glStyle, mapboxToken, enableMapbox3d, mapboxQuality, fullScreen, paddingBottom])
+ // Switching the UI language has to repin the basemap labels without tearing
+ // the map down. The load handler covers the initial run.
+ useEffect(() => {
+ const map = mapRef.current
+ if (!map || isMapLibre || !isStandardFamily(glStyle)) return
+ try { map.setConfigProperty('basemap', 'language', basemapLanguage(mapLang)) } catch { /* style/SDK may not support it */ }
+ }, [mapLang, isMapLibre, glStyle])
+
// external activeMarkerId → highlight + flyTo
useEffect(() => {
if (!activeMarkerId || !mapRef.current) return
diff --git a/client/src/components/Journey/MobileEntryCard.test.tsx b/client/src/components/Journey/MobileEntryCard.test.tsx
index bedf35b7c..b18c1c41e 100644
--- a/client/src/components/Journey/MobileEntryCard.test.tsx
+++ b/client/src/components/Journey/MobileEntryCard.test.tsx
@@ -63,6 +63,11 @@ describe('MobileEntryCard', () => {
expect(container.querySelector('img')).toHaveAttribute('src', '/api/photos/42/thumbnail')
})
+ it('FE-COMP-JENTRYCARD-003b: a photo carrying only an id also resolves against the api', () => {
+ const { container } = renderCard(buildEntry({ photos: [{ id: 11 }] }))
+ expect(container.querySelector('img')).toHaveAttribute('src', '/api/photos/11/thumbnail')
+ })
+
it('FE-COMP-JENTRYCARD-004: a public journey builds its own photo url', () => {
const publicPhotoUrl = (id: number) => `/public/p/${id}.jpg`
const { container } = renderCard(buildEntry({ photos: [{ photo_id: 7 }] }), { publicPhotoUrl })
diff --git a/client/src/components/Journey/MobileEntryCard.tsx b/client/src/components/Journey/MobileEntryCard.tsx
index 9cc1a5497..1146bad9f 100644
--- a/client/src/components/Journey/MobileEntryCard.tsx
+++ b/client/src/components/Journey/MobileEntryCard.tsx
@@ -1,6 +1,6 @@
import { MapPin, Camera, Smile, Laugh, Meh, Frown, Sun, CloudSun, Cloud, CloudRain, CloudLightning, Snowflake } from 'lucide-react'
import { formatLocationName } from '../../utils/formatters'
-import type { JourneyEntry, JourneyPhoto } from '../../store/journeyStore'
+import type { JourneyEntry } from '../../store/journeyStore'
const MOOD_ICONS: Record<string, typeof Smile> = {
amazing: Laugh,
@@ -25,8 +25,14 @@ const WEATHER_ICONS: Record<string, typeof Sun> = {
cold: Snowflake,
}
-function photoUrl(p: JourneyPhoto): string {
- return `/api/photos/${p.photo_id}/thumbnail`
+// Shared journeys hand us photos that only carry `id`, the journey's own
+// photos carry `photo_id` — accept either.
+function photoId(p: { photo_id?: number; id?: number }): number | undefined {
+ return p.photo_id ?? p.id
+}
+
+function photoUrl(id: number): string {
+ return `/api/photos/${id}/thumbnail`
}
function stripMarkdown(text: string): string {
@@ -53,11 +59,12 @@ export default function MobileEntryCard({ entry, dayLabel, dayColor, isActive, o
const moodColor = entry.mood ? MOOD_COLORS[entry.mood] : ''
const WeatherIcon = entry.weather ? WEATHER_ICONS[entry.weather] : null
- const thumbSrc = firstPhoto
- ? publicPhotoUrl
- ? publicPhotoUrl((firstPhoto as any).photo_id ?? (firstPhoto as any).id)
- : photoUrl(firstPhoto as JourneyPhoto)
- : null
+ const firstPhotoId = firstPhoto ? photoId(firstPhoto) : undefined
+ const thumbSrc = firstPhotoId == null
+ ? null
+ : publicPhotoUrl
+ ? publicPhotoUrl(firstPhotoId)
+ : photoUrl(firstPhotoId)
const date = new Date(entry.entry_date + 'T00:00:00')
const dateStr = date.toLocaleDateString(undefined, { month: 'short', day: 'numeric' })
diff --git a/client/src/components/Journey/MobileEntryView.tsx b/client/src/components/Journey/MobileEntryView.tsx
index fc340f4ac..d79264b47 100644
--- a/client/src/components/Journey/MobileEntryView.tsx
+++ b/client/src/components/Journey/MobileEntryView.tsx
@@ -1,9 +1,8 @@
-import { useState } from 'react'
import {
X, Pencil, Trash2, MapPin, Clock, Camera,
Laugh, Smile, Meh, Frown,
Sun, CloudSun, Cloud, CloudRain, CloudLightning, Snowflake,
- ThumbsUp, ThumbsDown, ChevronDown,
+ ThumbsUp, ThumbsDown,
} from 'lucide-react'
import JournalBody from './JournalBody'
import { formatLocationName } from '../../utils/formatters'
diff --git a/client/src/components/Journey/MobileMapTimeline.test.tsx b/client/src/components/Journey/MobileMapTimeline.test.tsx
index eaaa18faf..b3a1b4339 100644
--- a/client/src/components/Journey/MobileMapTimeline.test.tsx
+++ b/client/src/components/Journey/MobileMapTimeline.test.tsx
@@ -198,6 +198,25 @@ describe('MobileMapTimeline', () => {
}
})
+ it('FE-COMP-JMAPTL-008b: markers arriving after the entries still get the initial focus', () => {
+ vi.useFakeTimers()
+ try {
+ const onEntryClick = vi.fn()
+ const { rerender } = render(
+ <MobileMapTimeline entries={entries} mapEntries={[]} onEntryClick={onEntryClick} />,
+ )
+ act(() => { vi.advanceTimersByTime(500) })
+ expect(mapHandle.focusMarker).not.toHaveBeenCalled()
+
+ rerender(<MobileMapTimeline entries={entries} mapEntries={mapEntries} onEntryClick={onEntryClick} />)
+ act(() => { vi.advanceTimersByTime(500) })
+
+ expect(mapHandle.focusMarker).toHaveBeenCalledWith('1')
+ } finally {
+ vi.useRealTimers()
+ }
+ })
+
it('FE-COMP-JMAPTL-009: an entry that has no marker clears the highlight instead', () => {
vi.useFakeTimers()
try {
diff --git a/client/src/components/Journey/MobileMapTimeline.tsx b/client/src/components/Journey/MobileMapTimeline.tsx
index 27ead4b0e..d3c4dd36c 100644
--- a/client/src/components/Journey/MobileMapTimeline.tsx
+++ b/client/src/components/Journey/MobileMapTimeline.tsx
@@ -65,6 +65,12 @@ export default function MobileMapTimeline({
try { mapRef.current?.highlightMarker(null) } catch {}
}
}, [entries, mapEntries])
+ // The delayed initial focus reads both through refs so it always works off
+ // the current map entries, not the ones from the render that armed the timer.
+ const syncMapToCarouselRef = useRef(syncMapToCarousel)
+ syncMapToCarouselRef.current = syncMapToCarousel
+ const activeIndexRef = useRef(activeIndex)
+ activeIndexRef.current = activeIndex
// Pick the card that's currently closest to the carousel horizontal center.
// More stable than IntersectionObserver thresholds when the active card can
@@ -129,13 +135,15 @@ export default function MobileMapTimeline({
}
}, [activeIndex, onEntryClick, scrollCardIntoCenter])
- // Initial map focus — delay to let Leaflet initialize and fitBounds
+ // Initial map focus — delay to let Leaflet initialize and fitBounds. Also
+ // re-runs when the markers arrive later than the entries, otherwise the
+ // focus would fire against an empty map and never be retried.
useEffect(() => {
if (entries.length > 0) {
- const timer = setTimeout(() => syncMapToCarousel(0), 500)
+ const timer = setTimeout(() => syncMapToCarouselRef.current(activeIndexRef.current), 500)
return () => clearTimeout(timer)
}
- }, [entries.length])
+ }, [entries.length, mapEntries.length])
const activeEntryId = entries[activeIndex]
? String(entries[activeIndex].id)
diff --git a/client/src/components/Map/MapView.test.tsx b/client/src/components/Map/MapView.test.tsx
index 89f9e068e..6c9fc6c1b 100644
--- a/client/src/components/Map/MapView.test.tsx
+++ b/client/src/components/Map/MapView.test.tsx
@@ -1001,6 +1001,15 @@ describe('MapView photo thumbnails', () => {
expect(iconHtmlOf(screen.getAllByTestId('marker')[0])).toContain('/uploads/places/mine.jpg')
})
+ it('FE-COMP-MAPVIEW-076: a place with neither provider id nor coordinates has no cache key and is skipped', () => {
+ render(<MapView places={[
+ buildMapPlace({ id: 25, lat: null, lng: null, image_url: 'https://example.com/a.jpg' }),
+ buildMapPlace({ id: 26, lat: null, lng: null, image_url: 'https://example.com/b.jpg' }),
+ ]} />)
+ expect(thumbCallbacks.size).toBe(0)
+ expect(vi.mocked(photoService.fetchPhoto)).not.toHaveBeenCalled()
+ })
+
it('FE-COMP-MAPVIEW-071: photos are not fetched at all when the feature is off', () => {
useAuthStore.setState({ placesPhotosEnabled: false })
render(<MapView places={[buildMapPlace({ id: 24, lat: 48, lng: 2, google_place_id: 'gp-24' })]} />)
diff --git a/client/src/components/Map/MapView.tsx b/client/src/components/Map/MapView.tsx
index efe257bfc..94bef008b 100644
--- a/client/src/components/Map/MapView.tsx
+++ b/client/src/components/Map/MapView.tsx
@@ -36,15 +36,6 @@ L.Icon.Default.mergeOptions({
shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.9.4/images/marker-shadow.png',
})
-/**
- * Create a round photo-circle marker.
- * Shows image_url if available, otherwise category icon in colored circle.
- */
-function escAttr(s) {
- if (!s) return ''
- return s.replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;')
-}
-
const iconCache = new Map<string, L.DivIcon>()
// Tone dot for a plugin route's via points (charging stops, rest areas) — smaller
@@ -73,6 +64,10 @@ function formatViaDwell(seconds: number): string {
return h > 0 ? `${h} h ${m} min` : `${m} min`
}
+/**
+ * Create a round photo-circle marker.
+ * Shows image_url if available, otherwise category icon in colored circle.
+ */
function createPlaceIcon(place, orderNumbers, isSelected) {
const cacheKey = `${place.id}:${isSelected}:${place.image_url || ''}:${place.category_color || ''}:${place.category_icon || ''}:${orderNumbers?.join(',') || ''}`
const cached = iconCache.get(cacheKey)
@@ -329,16 +324,6 @@ interface MapClickHandlerProps {
onClick: ((e: L.LeafletMouseEvent) => void) | null
}
-function ZoomTracker({ onZoomStart, onZoomEnd }: { onZoomStart: () => void; onZoomEnd: () => void }) {
- const map = useMap()
- useEffect(() => {
- map.on('zoomstart', onZoomStart)
- map.on('zoomend', onZoomEnd)
- return () => { map.off('zoomstart', onZoomStart); map.off('zoomend', onZoomEnd) }
- }, [map, onZoomStart, onZoomEnd])
- return null
-}
-
const TRACK_CASING_PANE = 'trek-track-casing'
/**
@@ -385,7 +370,7 @@ function MapContextMenuHandler({ onContextMenu }: { onContextMenu: ((e: L.Leafle
// Module-level photo cache shared with PlaceAvatar
import { getCached, isLoading, fetchPhoto, onThumbReady, getAllThumbs } from '../../services/photoService'
-import { isCustomPlaceImage } from './placePhoto'
+import { isCustomPlaceImage, photoCacheKey } from './placePhoto'
import { useAuthStore } from '../../store/authStore'
import { useGeolocation } from '../../hooks/useGeolocation'
import LocationButton from './LocationButton'
@@ -647,7 +632,7 @@ export const MapView = memo(function MapView({
// photo for it (the request would 404 for OSM-only places and the fetched
// thumb would shadow the user's own image). (#1136)
if (isCustomPlaceImage(place.image_url)) continue
- const cacheKey = place.google_place_id || place.osm_id || `${place.lat},${place.lng}`
+ const cacheKey = photoCacheKey(place)
if (!cacheKey) continue
const cached = getCached(cacheKey)
@@ -693,7 +678,7 @@ export const MapView = memo(function MapView({
const markers = useMemo(() => places.map((place) => {
const isSelected = place.id === selectedPlaceId
- const pck = place.google_place_id || place.osm_id || `${place.lat},${place.lng}`
+ const pck = photoCacheKey(place)
// A custom uploaded image wins over the auto-fetched thumb; otherwise fall back.
const photoUrl = isCustomPlaceImage(place.image_url) ? place.image_url! : ((pck && photoUrls[pck]) || place.image_url || null)
const orderNumbers = dayOrderMap[place.id] ?? null
diff --git a/client/src/components/Map/MapViewGL.test.tsx b/client/src/components/Map/MapViewGL.test.tsx
index f5afff66a..86a1d5111 100644
--- a/client/src/components/Map/MapViewGL.test.tsx
+++ b/client/src/components/Map/MapViewGL.test.tsx
@@ -909,6 +909,29 @@ describe('MapViewGL', () => {
expect(queryByTestId('tooltip')).toBeNull()
})
+ it('FE-COMP-MAPVIEWGL-067: hovering does not rebuild the markers under the cursor (#1404)', async () => {
+ loadOnAttach()
+ const places = [
+ buildMapPlace({ id: 41, lat: 48.41, lng: 2.41 }),
+ buildMapPlace({ id: 42, lat: 48.42, lng: 2.42 }),
+ ]
+
+ const { queryByTestId } = render(<MapViewGL places={places} fitKey={1} />)
+ await act(async () => {})
+ const before = glMarkers.created.length
+ const el = glMarkers.created[0].element
+
+ act(() => { el.dispatchEvent(new MouseEvent('mouseenter', { clientX: 10, clientY: 10 })) })
+ await act(async () => {})
+
+ // The hover card is component state, so it re-renders MapViewGL. The omitted
+ // collection props have to keep their identity across that render — a fresh
+ // `[]`/`{}` default would re-run the reconcile effects and recreate every
+ // marker, and a marker recreated under the pointer never fires mouseleave.
+ expect(queryByTestId('tooltip')).toBeTruthy()
+ expect(glMarkers.created).toHaveLength(before)
+ })
+
it('FE-COMP-MAPVIEWGL-027: clicking a GPX track selects its place unless a marker or cluster is on top', async () => {
loadOnAttach()
const onMarkerClick = vi.fn()
@@ -1588,6 +1611,17 @@ describe('MapViewGL', () => {
expect(photoService.fetchPhoto).toHaveBeenCalledWith('osm-5', '/api/maps/place-photo/abc', 48.5, 2.5, 'Museum')
})
+ it('FE-COMP-MAPVIEWGL-066: a place with neither provider id nor coordinates has no cache key and is skipped', async () => {
+ render(<MapViewGL places={[
+ buildMapPlace({ id: 98, lat: null, lng: null, image_url: 'https://example.com/a.jpg' }),
+ buildMapPlace({ id: 99, lat: null, lng: null, image_url: 'https://example.com/b.jpg' }),
+ ]} fitKey={1} />)
+ await act(async () => {})
+
+ expect(photoService.fetchPhoto).not.toHaveBeenCalled()
+ expect(photoService.onThumbReady).not.toHaveBeenCalled()
+ })
+
it('FE-COMP-MAPVIEWGL-057: no photos are fetched when place photos are switched off', async () => {
useAuthStore.setState({ placesPhotosEnabled: false })
diff --git a/client/src/components/Map/MapViewGL.tsx b/client/src/components/Map/MapViewGL.tsx
index 24e853c6a..6e95c306c 100644
--- a/client/src/components/Map/MapViewGL.tsx
+++ b/client/src/components/Map/MapViewGL.tsx
@@ -7,7 +7,7 @@ import 'maplibre-gl/dist/maplibre-gl.css'
import { useSettingsStore } from '../../store/settingsStore'
import { useAuthStore } from '../../store/authStore'
import { getCached, isLoading, fetchPhoto, onThumbReady, getAllThumbs } from '../../services/photoService'
-import { isCustomPlaceImage } from './placePhoto'
+import { isCustomPlaceImage, photoCacheKey } from './placePhoto'
import { CATEGORY_ICON_MAP } from '../shared/categoryIcons'
import { isStandardFamily, supportsCustom3d, wantsTerrain, addCustom3dBuildings, addTerrainAndSky } from './mapboxSetup'
import { attachLocationMarker, type LocationMarkerHandle } from './locationMarkerMapbox'
@@ -73,6 +73,20 @@ interface RouteSegment {
drivingText?: string
}
+// Stable identities for the omitted collection props. An inline `= []` / `= {}`
+// default allocates a fresh object on every render, and these props sit in the
+// dependency arrays of the imperative reconcile effects below — so every render,
+// including one caused only by the hover tooltip's state, would tear down and
+// rebuild every marker. That is the "marker recreated under the cursor,
+// mouseleave never fires" case (#1404).
+const NO_PLACES: Place[] = []
+const NO_ROUTE_VIAS: RouteVia[] = []
+const NO_ROUTE_SEGMENTS: RouteSegment[] = []
+const NO_DAY_ORDER: Record<number, number[] | null> = {}
+const NO_RESERVATIONS: Reservation[] = []
+const NO_CONNECTION_IDS: number[] = []
+const NO_POIS: Poi[] = []
+
interface Props {
places: Place[]
dayPlaces?: Place[]
@@ -315,12 +329,12 @@ function createPoiMarkerElement(category: string): HTMLDivElement {
}
export function MapViewGL({
- places = [],
- dayPlaces = [],
+ places = NO_PLACES,
+ dayPlaces = NO_PLACES,
tripId,
- routeVias = [],
+ routeVias = NO_ROUTE_VIAS,
route = null,
- routeSegments = [],
+ routeSegments = NO_ROUTE_SEGMENTS,
selectedPlaceId = null,
hoverDisabled = false,
onMarkerClick,
@@ -329,17 +343,17 @@ export function MapViewGL({
center = DEFAULT_MAP_CENTER,
zoom = DEFAULT_MAP_ZOOM,
fitKey = 0,
- dayOrderMap = {},
+ dayOrderMap = NO_DAY_ORDER,
leftWidth = 0,
rightWidth = 0,
hasInspector = false,
hasDayDetail = false,
- reservations = [],
- visibleConnectionIds = [],
+ reservations = NO_RESERVATIONS,
+ visibleConnectionIds = NO_CONNECTION_IDS,
showTransitRoutes = true,
showReservationStats = false,
onReservationClick,
- pois = [],
+ pois = NO_POIS,
onPoiClick,
onViewportChange,
glProvider = 'mapbox-gl',
@@ -816,12 +830,12 @@ export function MapViewGL({
if (ev.touches.length !== 1) { cancelLongPress(); return }
if ((ev.target as HTMLElement).closest('.mapboxgl-marker, .maplibregl-marker')) return
const t = ev.touches[0]
- lpStart = { x: t.clientX, y: t.clientY }
+ const start = { x: t.clientX, y: t.clientY }
+ lpStart = start
lpTimer = window.setTimeout(() => {
lpTimer = null
- if (!lpStart) return
const rect = canvas.getBoundingClientRect()
- const lngLat = map.unproject([lpStart.x - rect.left, lpStart.y - rect.top])
+ const lngLat = map.unproject([start.x - rect.left, start.y - rect.top])
lpStart = null
// Only suppress the tap when OUR fire opened the form — if the native
// contextmenu beat us to it (dedupe), no click needs swallowing.
@@ -945,7 +959,7 @@ export function MapViewGL({
// photo for it (that request would 404 for OSM-only places and, worse, the
// fetched thumb would shadow the user's own image). (#1136)
if (isCustomPlaceImage(place.image_url)) continue
- const cacheKey = place.google_place_id || place.osm_id || `${place.lat},${place.lng}`
+ const cacheKey = photoCacheKey(place)
if (!cacheKey) continue
const cached = getCached(cacheKey)
if (cached?.thumbDataUrl) {
@@ -1002,7 +1016,7 @@ export function MapViewGL({
visiblePlaces.forEach(place => {
const orderNumbers = dayOrderMap[place.id] ?? null
- const pck = place.google_place_id || place.osm_id || `${place.lat},${place.lng}`
+ const pck = photoCacheKey(place)
// A custom image wins over the auto-fetched thumb; otherwise fall back to it.
const photoUrl = isCustomPlaceImage(place.image_url) ? place.image_url! : ((pck && photoUrls[pck]) || place.image_url || null)
const selected = place.id === selectedPlaceId
diff --git a/client/src/components/Map/PoiCategoryPill.test.tsx b/client/src/components/Map/PoiCategoryPill.test.tsx
new file mode 100644
index 000000000..94008a914
--- /dev/null
+++ b/client/src/components/Map/PoiCategoryPill.test.tsx
@@ -0,0 +1,60 @@
+// FE-COMP-POIPILL-001 to FE-COMP-POIPILL-006
+import React from 'react'
+import { describe, it, expect, vi } from 'vitest'
+import { render, screen } from '../../../tests/helpers/render'
+import { fireEvent } from '@testing-library/react'
+import PoiCategoryPill from './PoiCategoryPill'
+import { POI_CATEGORIES } from './poiCategories'
+
+const CAFE = POI_CATEGORIES.find(c => c.key === 'cafe')!
+const BAR = POI_CATEGORIES.find(c => c.key === 'bar')!
+
+function pill(props: Partial<React.ComponentProps<typeof PoiCategoryPill>> = {}) {
+ return render(
+ <PoiCategoryPill active={new Set()} onToggle={vi.fn()} {...props} />,
+ )
+}
+
+// The spinner replaces the category icon, so "is this segment spinning" reads as
+// "does its button hold an .animate-spin element".
+const spinning = () => screen.getAllByRole('button')
+ .filter(b => b.querySelector('.animate-spin'))
+ .map(b => b.getAttribute('aria-label'))
+
+describe('PoiCategoryPill', () => {
+ it('FE-COMP-POIPILL-001: renders one segment per category, none pressed', () => {
+ pill()
+ const buttons = screen.getAllByRole('button')
+ expect(buttons).toHaveLength(POI_CATEGORIES.length)
+ expect(buttons.every(b => b.getAttribute('aria-pressed') === 'false')).toBe(true)
+ })
+
+ it('FE-COMP-POIPILL-002: clicking a segment toggles its category', () => {
+ const onToggle = vi.fn()
+ pill({ onToggle })
+ fireEvent.click(screen.getAllByRole('button')[1])
+ expect(onToggle).toHaveBeenCalledWith(POI_CATEGORIES[1].key)
+ })
+
+ it('FE-COMP-POIPILL-003: the active category spins while its fetch is in flight', () => {
+ pill({ active: new Set([CAFE.key]), loadingKeys: new Set([CAFE.key]) })
+ expect(spinning()).toEqual(['Cafés'])
+ })
+
+ it('FE-COMP-POIPILL-004: a deselected category never spins, even with a lingering loading key', () => {
+ pill({ active: new Set([BAR.key]), loadingKeys: new Set([CAFE.key, BAR.key]) })
+ expect(spinning()).toEqual(['Bars & nightlife'])
+ })
+
+ it('FE-COMP-POIPILL-005: a failed category offers a retry', () => {
+ pill({ active: new Set([CAFE.key]), errorKeys: new Set([CAFE.key]) })
+ expect(screen.getByText('Search this area')).toBeInTheDocument()
+ })
+
+ it('FE-COMP-POIPILL-006: "search this area" reports the moved viewport', () => {
+ const onSearchArea = vi.fn()
+ pill({ active: new Set([CAFE.key]), moved: true, onSearchArea })
+ fireEvent.click(screen.getByText('Search this area'))
+ expect(onSearchArea).toHaveBeenCalled()
+ })
+})
diff --git a/client/src/components/Map/PoiCategoryPill.tsx b/client/src/components/Map/PoiCategoryPill.tsx
index 2eaf4c0e2..2c544d134 100644
--- a/client/src/components/Map/PoiCategoryPill.tsx
+++ b/client/src/components/Map/PoiCategoryPill.tsx
@@ -33,7 +33,9 @@ export default function PoiCategoryPill({ active, onToggle, loadingKeys, errorKe
<div style={{ display: 'inline-flex', alignItems: 'center', gap: 2, padding: 4, borderRadius: 999, pointerEvents: 'auto', ...frosted }}>
{POI_CATEGORIES.map(cat => {
const on = active.has(cat.key)
- const loading = loadingKeys?.has(cat.key)
+ // Only an active category can be loading — a deselected one whose fetch
+ // is still winding down must not keep spinning.
+ const loading = on && !!loadingKeys?.has(cat.key)
return (
<Tooltip key={cat.key} label={t(cat.labelKey)} placement="bottom">
<button
diff --git a/client/src/components/Map/ReservationOverlay.tsx b/client/src/components/Map/ReservationOverlay.tsx
index aff4154e6..ca616ef0e 100644
--- a/client/src/components/Map/ReservationOverlay.tsx
+++ b/client/src/components/Map/ReservationOverlay.tsx
@@ -1,4 +1,4 @@
-import { Fragment, createElement, useEffect, useMemo, useRef, useState } from 'react'
+import { Fragment, createElement, useMemo, useState } from 'react'
import { renderToStaticMarkup } from 'react-dom/server'
import { Marker, Polyline, Tooltip, useMap, useMapEvents } from 'react-leaflet'
import L from 'leaflet'
@@ -10,8 +10,6 @@ import { useSettingsStore } from '../../store/settingsStore'
import type { Reservation, ReservationEndpoint } from '../../types'
const ENDPOINT_PANE = 'reservation-endpoints'
-const AIRPORT_BADGE_HALF_PX = 16
-const BADGE_GAP_PX = 5
type TransportType = 'flight' | 'train' | 'cruise' | 'car' | 'bus' | 'taxi' | 'bicycle' | 'ferry' | 'transit' | 'transport_other'
const TRANSPORT_TYPES: TransportType[] = ['flight', 'train', 'cruise', 'car', 'bus', 'taxi', 'bicycle', 'ferry', 'transit', 'transport_other']
@@ -46,7 +44,7 @@ function useEndpointPane() {
function endpointIcon(type: TransportType, label: string | null): L.DivIcon {
const { icon: IconCmp, color } = TYPE_META[type]
const svg = renderToStaticMarkup(createElement(IconCmp, { size: 13, color: 'white', strokeWidth: 2.5 }))
- const labelHtml = label ? `<span>${escapeHtml(label)}</span>` : ''
+ const labelHtml = label ? `<span style="display:inline-flex;align-items:center;line-height:1">${escapeHtml(label)}</span>` : ''
const estWidth = label ? Math.max(40, label.length * 6 + 28) : 26
return L.divIcon({
className: 'trek-endpoint-marker',
@@ -57,7 +55,7 @@ function endpointIcon(type: TransportType, label: string | null): L.DivIcon {
border:1.5px solid #fff;color:#fff;
font-family:var(--font-system);font-size:11px;font-weight:600;letter-spacing:0.3px;line-height:1;
box-sizing:border-box;height:22px;white-space:nowrap;
- "><span style="display:inline-flex;align-items:center;">${svg}</span>${labelHtml ? `<span style="display:inline-flex;align-items:center;line-height:1">${escapeHtml(label)}</span>` : ''}</div>`,
+ "><span style="display:inline-flex;align-items:center;">${svg}</span>${labelHtml}</div>`,
iconSize: [estWidth, 22],
iconAnchor: [estWidth / 2, 11],
popupAnchor: [0, -11],
@@ -135,182 +133,18 @@ interface TransportItem {
type: TransportType
arcs: [number, number][][]
transitSegs: TransitMapSegment[]
- primaryArc: [number, number][]
- fallback: [number, number]
+ // Route ("VIE → LHR") and duration/distance line. Computed on every update but
+ // not drawn since the stats badge was dropped; computeDuration still guards the
+ // non-finite date that used to blank the trip (#1620).
mainLabel: string | null
subLabel: string | null
}
-function buildStatsHtml(color: string, mainLabel: string | null, subLabel: string | null): { html: string; width: number; height: number } {
- const estWidth = Math.max(
- mainLabel ? mainLabel.length * 6.5 : 0,
- subLabel ? subLabel.length * 5.5 : 0,
- ) + 22
- const hasBoth = !!mainLabel && !!subLabel
- const height = hasBoth ? 36 : 22
- const main = mainLabel ? `<span style="font-size:12px;font-weight:700;line-height:1;display:block">${escapeHtml(mainLabel)}</span>` : ''
- const sub = subLabel ? `<span style="font-size:10px;font-weight:500;line-height:1;opacity:0.85;display:block${hasBoth ? ';margin-top:4px' : ''}">${escapeHtml(subLabel)}</span>` : ''
- const html = `<div class="trek-stats-inner" style="
- display:flex;flex-direction:column;align-items:center;justify-content:center;
- width:100%;height:100%;
- padding:0 11px;border-radius:999px;
- background:rgba(17,24,39,0.92);color:#fff;
- box-shadow:0 2px 6px rgba(0,0,0,0.25);
- border:1px solid ${color}aa;
- font-family:var(--font-system);
- white-space:nowrap;box-sizing:border-box;
- transform-origin:center;
- will-change:transform;
- ">${main}${sub}</div>`
- return { html, width: estWidth, height }
-}
-
-function StatsLabel({ item }: { item: TransportItem }) {
- const map = useMap()
- const markerRef = useRef<L.Marker | null>(null)
- const innerRef = useRef<HTMLElement | null>(null)
-
- const arc = item.primaryArc
- const color = TYPE_META[item.type].color
-
- const { html, width, height } = useMemo(() => buildStatsHtml(color, item.mainLabel, item.subLabel), [color, item.mainLabel, item.subLabel])
- const buffer = AIRPORT_BADGE_HALF_PX + width / 2 + BADGE_GAP_PX
-
- const compute = () => {
- if (arc.length < 2) return null
- const size = map.getSize()
- const pts = arc.map(p => map.latLngToContainerPoint(p as L.LatLngTuple))
- const cum: number[] = [0]
- let total = 0
- for (let i = 1; i < pts.length; i++) {
- total += pts[i].distanceTo(pts[i - 1])
- cum.push(total)
- }
- if (total <= 0) return null
-
- const fromPx = map.latLngToContainerPoint([item.from.lat, item.from.lng])
- const toPx = map.latLngToContainerPoint([item.to.lat, item.to.lng])
-
- const isIn = (p: L.Point) => {
- if (p.x < -40 || p.x > size.x + 40 || p.y < -40 || p.y > size.y + 40) return false
- if (p.distanceTo(fromPx) < buffer) return false
- if (p.distanceTo(toPx) < buffer) return false
- return true
- }
-
- let firstIdx = -1
- let lastIdx = -1
- for (let i = 0; i < pts.length; i++) {
- if (isIn(pts[i])) {
- if (firstIdx < 0) firstIdx = i
- lastIdx = i
- }
- }
- if (firstIdx < 0) {
- const target = total / 2
- let sIdx = 0
- while (sIdx < cum.length - 2 && cum[sIdx + 1] < target) sIdx++
- const span = cum[sIdx + 1] - cum[sIdx]
- const tm = span > 0 ? (target - cum[sIdx]) / span : 0
- const pA = pts[sIdx]
- const pB = pts[sIdx + 1]
- const mx = pA.x + (pB.x - pA.x) * tm
- const my = pA.y + (pB.y - pA.y) * tm
- const latlng = map.containerPointToLatLng([mx, my])
- let angle = Math.atan2(pB.y - pA.y, pB.x - pA.x) * 180 / Math.PI
- if (angle > 90) angle -= 180
- if (angle < -90) angle += 180
- return { point: [latlng.lat, latlng.lng] as [number, number], angle }
- }
-
- const bisectFraction = (a: L.Point, b: L.Point) => {
- let lo = 0, hi = 1
- for (let k = 0; k < 10; k++) {
- const mid = (lo + hi) / 2
- const mp = L.point(a.x + (b.x - a.x) * mid, a.y + (b.y - a.y) * mid)
- if (isIn(mp)) hi = mid
- else lo = mid
- }
- return (lo + hi) / 2
- }
-
- let lowCum = cum[firstIdx]
- if (firstIdx > 0) {
- const t = bisectFraction(pts[firstIdx - 1], pts[firstIdx])
- lowCum = cum[firstIdx - 1] + (cum[firstIdx] - cum[firstIdx - 1]) * t
- }
- let highCum = cum[lastIdx]
- if (lastIdx < pts.length - 1) {
- const t = bisectFraction(pts[lastIdx + 1], pts[lastIdx])
- highCum = cum[lastIdx] + (cum[lastIdx + 1] - cum[lastIdx]) * (1 - t)
- }
-
- const targetLen = (lowCum + highCum) / 2
-
- let segIdx = 0
- while (segIdx < cum.length - 2 && cum[segIdx + 1] < targetLen) segIdx++
- const segSpan = cum[segIdx + 1] - cum[segIdx]
- const t = segSpan > 0 ? (targetLen - cum[segIdx]) / segSpan : 0
- const pA = pts[segIdx]
- const pB = pts[segIdx + 1]
- const px = pA.x + (pB.x - pA.x) * t
- const py = pA.y + (pB.y - pA.y) * t
- const latlng = map.containerPointToLatLng([px, py])
-
- let angle = Math.atan2(pB.y - pA.y, pB.x - pA.x) * 180 / Math.PI
- if (angle > 90) angle -= 180
- if (angle < -90) angle += 180
-
- return { point: [latlng.lat, latlng.lng] as [number, number], angle }
- }
-
- const apply = () => {
- const pose = compute()
- const marker = markerRef.current
- if (!marker) return
- const el = marker.getElement() as HTMLElement | null
- if (!pose) {
- if (el) el.style.display = 'none'
- return
- }
- if (el) el.style.display = ''
- marker.setLatLng(pose.point as L.LatLngTuple)
- if (!innerRef.current && el) innerRef.current = el.querySelector('.trek-stats-inner') as HTMLElement | null
- if (innerRef.current) innerRef.current.style.transform = `rotate(${pose.angle}deg)`
- }
-
- useEffect(() => {
- const icon = L.divIcon({
- className: 'trek-endpoint-stats',
- html,
- iconSize: [width, height],
- iconAnchor: [width / 2, height / 2],
- })
- const marker = L.marker([0, 0], { icon, pane: ENDPOINT_PANE, interactive: false, keyboard: false })
- marker.addTo(map)
- markerRef.current = marker
- innerRef.current = null
- apply()
- return () => {
- marker.remove()
- markerRef.current = null
- innerRef.current = null
- }
- }, [map, html, width, height])
-
- useMapEvents({
- move: apply,
- zoom: apply,
- viewreset: apply,
- resize: apply,
- })
-
- return null
-}
-
interface Props {
reservations: Reservation[]
showConnections: boolean
+ // Accepted for call-site compatibility only: the floating route/duration badge
+ // on the arc is no longer drawn, so nothing is gated on this.
showStats: boolean
onEndpointClick?: (reservationId: number) => void
// Real road-network geometry for car/bus/taxi/bicycle bookings, keyed by
@@ -318,7 +152,7 @@ interface Props {
roadRoutes?: Map<number, [number, number][]>
}
-export default function ReservationOverlay({ reservations, showConnections, showStats, onEndpointClick, roadRoutes }: Props) {
+export default function ReservationOverlay({ reservations, showConnections, onEndpointClick, roadRoutes }: Props) {
useEndpointPane()
const map = useMap()
const [zoom, setZoom] = useState(() => map.getZoom())
@@ -354,12 +188,6 @@ export default function ReservationOverlay({ reservations, showConnections, show
arcs.push(...segArcs)
distanceKm += haversineKm([a.lat, a.lng], [b.lat, b.lng])
}
- const primaryIdx = arcs.reduce((best, seg, idx, all) => seg.length > all[best].length ? idx : best, 0)
- const primaryArc = arcs[primaryIdx] ?? []
- const fallback: [number, number] = primaryArc.length > 0
- ? (primaryArc[Math.floor(primaryArc.length / 2)] ?? [(from.lat + to.lat) / 2, (from.lng + to.lng) / 2])
- : [(from.lat + to.lat) / 2, (from.lng + to.lng) / 2]
-
const duration = computeDuration(from, to, r.reservation_time || null, r.reservation_end_time || null)
const distance = `${Math.round(distanceKm)} km`
// Show the full route (FRA → BER → HND) when every waypoint has a code.
@@ -369,7 +197,7 @@ export default function ReservationOverlay({ reservations, showConnections, show
const subParts = [duration, distance].filter(Boolean) as string[]
const subLabel = subParts.length > 0 ? subParts.join(' · ') : null
- out.push({ res: r, from, to, waypoints, type, arcs, transitSegs: type === 'transit' ? getTransitMapSegments(r) : [], primaryArc, fallback, mainLabel, subLabel })
+ out.push({ res: r, from, to, waypoints, type, arcs, transitSegs: type === 'transit' ? getTransitMapSegments(r) : [], mainLabel, subLabel })
}
return out
}, [reservations])
diff --git a/client/src/components/Map/placePhoto.ts b/client/src/components/Map/placePhoto.ts
index a57294624..71874b82c 100644
--- a/client/src/components/Map/placePhoto.ts
+++ b/client/src/components/Map/placePhoto.ts
@@ -8,3 +8,21 @@
export function isCustomPlaceImage(url: string | null | undefined): boolean {
return !!url && (url.startsWith('/uploads/') || url.startsWith('data:'))
}
+
+/**
+ * Cache key under which a place's auto-fetched thumbnail is stored: the provider
+ * id when there is one, otherwise the coordinates. A place with neither has no
+ * identity to cache under, so it gets the empty string — callers skip it rather
+ * than filing every coordinate-less place under one shared entry.
+ */
+export function photoCacheKey(place: {
+ google_place_id?: string | null
+ osm_id?: string | null
+ lat?: number | null
+ lng?: number | null
+}): string {
+ if (place.google_place_id) return place.google_place_id
+ if (place.osm_id) return place.osm_id
+ if (place.lat == null || place.lng == null) return ''
+ return `${place.lat},${place.lng}`
+}
diff --git a/client/src/components/Map/reservationsMapbox.test.ts b/client/src/components/Map/reservationsMapbox.test.ts
index ce02a60bb..2a7a9f39f 100644
--- a/client/src/components/Map/reservationsMapbox.test.ts
+++ b/client/src/components/Map/reservationsMapbox.test.ts
@@ -264,7 +264,6 @@ describe('ReservationMapboxOverlay lifecycle', () => {
expect(glMarkers.every(m => m.remove.mock.calls.length > 0)).toBe(true)
expect(map.listeners('zoomend')).toBe(0)
expect(map.listeners('moveend')).toBe(0)
- expect(map.listeners('render')).toBe(0)
expect(map.removeLayer).toHaveBeenCalledWith(RESERVATION_LINE_LAYER_ID)
expect(map.removeSource).toHaveBeenCalledWith(RESERVATION_SOURCE_ID)
})
@@ -287,20 +286,18 @@ describe('ReservationMapboxOverlay lifecycle', () => {
expect(features(map)).toHaveLength(1)
})
- it('FE-COMP-RESGL-006: the redraw and rotation handlers are inert once the overlay is destroyed', () => {
+ it('FE-COMP-RESGL-006: the redraw handler is inert once the overlay is destroyed', () => {
const map = freshMap()
const overlay = attach(map)
const handlerFor = (event: string) =>
map.on.mock.calls.find(c => c[0] === event)?.[1] as Handler
const rerender = handlerFor('moveend')
- const rotate = handlerFor('render')
overlay.update([booking()], opts)
const drawsBefore = map._sources.get(RESERVATION_SOURCE_ID)!.setData.mock.calls.length
overlay.destroy()
rerender()
- rotate()
expect(map._sources.get(RESERVATION_SOURCE_ID)).toBeUndefined()
expect(drawsBefore).toBeGreaterThan(0)
})
@@ -700,7 +697,7 @@ describe('ReservationMapboxOverlay transit styling', () => {
})
describe('ReservationMapboxOverlay frame handler', () => {
- it('FE-COMP-RESGL-042: a paint frame rotates only — it does not redraw the overlay', () => {
+ it('FE-COMP-RESGL-042: the overlay does not subscribe to paint frames — only camera events redraw it', () => {
const map = freshMap()
const overlay = attach(map)
overlay.update([booking()], opts)
@@ -708,6 +705,7 @@ describe('ReservationMapboxOverlay frame handler', () => {
map.fire('render')
+ expect(map.listeners('render')).toBe(0)
expect(map._sources.get(RESERVATION_SOURCE_ID)!.setData.mock.calls).toHaveLength(drawsBefore)
expect(glMarkers).toHaveLength(2)
expect(glMarkers.every(m => m.remove.mock.calls.length === 0)).toBe(true)
diff --git a/client/src/components/Map/reservationsMapbox.ts b/client/src/components/Map/reservationsMapbox.ts
index bd5c849ee..91b73e960 100644
--- a/client/src/components/Map/reservationsMapbox.ts
+++ b/client/src/components/Map/reservationsMapbox.ts
@@ -102,7 +102,9 @@ interface TransportItem {
waypoints: ReservationEndpoint[]
type: TransportType
arcs: [number, number][][]
- primaryArc: [number, number][]
+ // Route ("VIE → LHR") and duration/distance line. Computed on every update but
+ // not drawn since the stats badge was dropped; computeDuration still guards the
+ // non-finite date that used to blank the trip (#1620).
mainLabel: string | null
subLabel: string | null
}
@@ -136,8 +138,6 @@ function buildItems(reservations: Reservation[]): TransportItem[] {
arcs.push(...segArcs)
distanceKm += haversineKm([a.lat, a.lng], [b.lat, b.lng])
}
- const primaryIdx = arcs.reduce((best, seg, idx, all) => seg.length > all[best].length ? idx : best, 0)
- const primaryArc = arcs[primaryIdx] ?? []
const duration = computeDuration(from, to, r.reservation_time || null, r.reservation_end_time || null)
const distance = `${Math.round(distanceKm)} km`
const mainLabel = waypoints.every(w => w.code)
@@ -145,7 +145,7 @@ function buildItems(reservations: Reservation[]): TransportItem[] {
: (from.code && to.code ? `${from.code} → ${to.code}` : null)
const subParts = [duration, distance].filter(Boolean) as string[]
const subLabel = subParts.length > 0 ? subParts.join(' · ') : null
- out.push({ res: r, from, to, waypoints, type, arcs, primaryArc, mainLabel, subLabel })
+ out.push({ res: r, from, to, waypoints, type, arcs, mainLabel, subLabel })
}
return out
}
@@ -165,32 +165,11 @@ function endpointMarkerHtml(type: TransportType, label: string | null): string {
"><span style="display:inline-flex;align-items:center;">${svg}</span>${labelHtml}</div>`
}
-function buildStatsHtml(mainLabel: string | null, subLabel: string | null): { html: string; width: number; height: number } {
- const estWidth = Math.max(
- mainLabel ? mainLabel.length * 6.5 : 0,
- subLabel ? subLabel.length * 5.5 : 0,
- ) + 22
- const hasBoth = !!mainLabel && !!subLabel
- const height = hasBoth ? 36 : 22
- const main = mainLabel ? `<span style="font-size:12px;font-weight:700;line-height:1;display:block">${escapeHtml(mainLabel)}</span>` : ''
- const sub = subLabel ? `<span style="font-size:10px;font-weight:500;line-height:1;opacity:0.85;display:block${hasBoth ? ';margin-top:4px' : ''}">${escapeHtml(subLabel)}</span>` : ''
- const html = `<div class="trek-stats-inner" style="
- display:flex;flex-direction:column;align-items:center;justify-content:center;
- width:100%;height:100%;
- padding:0 11px;border-radius:999px;
- background:rgba(17,24,39,0.92);color:#fff;
- box-shadow:0 2px 6px rgba(0,0,0,0.25);
- border:1px solid ${TRANSPORT_COLOR}aa;
- font-family:var(--font-system);
- white-space:nowrap;box-sizing:border-box;pointer-events:none;
- transform-origin:center;will-change:transform;
- ">${main}${sub}</div>`
- return { html, width: estWidth, height }
-}
-
// ── overlay manager ──────────────────────────────────────────────────────
export interface ReservationOverlayOptions {
showConnections: boolean
+ // Accepted for call-site compatibility only: the floating route/duration badge
+ // on the arc is no longer drawn, so nothing is gated on this.
showStats: boolean
showEndpointLabels: boolean
onEndpointClick?: (reservationId: number) => void
@@ -212,7 +191,6 @@ export class ReservationMapboxOverlay {
private opts: ReservationOverlayOptions
private MarkerCtor: MarkerConstructor
private endpointMarkers: GlMarker[] = []
- private statsMarkers: { marker: GlMarker; arc: [number, number][] }[] = []
private rerender: () => void
private destroyed = false
@@ -224,7 +202,6 @@ export class ReservationMapboxOverlay {
this.setupLayer()
map.on('zoomend', this.rerender)
map.on('moveend', this.rerender)
- map.on('render', this.updateStatsRotation)
}
update(reservations: Reservation[], opts: ReservationOverlayOptions, roadRoutes?: Map<number, [number, number][]>) {
@@ -238,11 +215,8 @@ export class ReservationMapboxOverlay {
this.destroyed = true
this.map.off('zoomend', this.rerender)
this.map.off('moveend', this.rerender)
- this.map.off('render', this.updateStatsRotation)
this.endpointMarkers.forEach(m => m.remove())
this.endpointMarkers = []
- this.statsMarkers.forEach(s => s.marker.remove())
- this.statsMarkers = []
try {
if (this.map.getLayer(RESERVATION_LINE_LAYER_ID)) this.map.removeLayer(RESERVATION_LINE_LAYER_ID)
if (this.map.getSource(RESERVATION_SOURCE_ID)) this.map.removeSource(RESERVATION_SOURCE_ID)
@@ -386,34 +360,7 @@ export class ReservationMapboxOverlay {
}
}
- // Stats badge removed — the floating route/duration label on the arc is no
- // longer drawn; only the connection line and the airport markers remain.
- this.statsMarkers.forEach(s => s.marker.remove())
- this.statsMarkers = []
- }
-
- // Match the Leaflet overlay's "rotate the label along the arc" look.
- // We pick a short segment straddling the arc midpoint, measure the
- // screen angle between those two projected points, and clamp it to
- // [-90°, 90°] so text never renders upside-down.
- private updateStatsRotation = () => {
- if (this.destroyed) return
- for (const entry of this.statsMarkers) {
- const { marker, arc } = entry
- if (arc.length < 2) continue
- const midIdx = Math.floor(arc.length / 2)
- const a = arc[Math.max(0, midIdx - 2)]!
- const b = arc[Math.min(arc.length - 1, midIdx + 2)]!
- try {
- const pa = this.map.project([a[1], a[0]])
- const pb = this.map.project([b[1], b[0]])
- let angle = Math.atan2(pb.y - pa.y, pb.x - pa.x) * 180 / Math.PI
- if (angle > 90) angle -= 180
- if (angle < -90) angle += 180
- const el = marker.getElement()
- const inner = el.querySelector('.trek-stats-inner') as HTMLElement | null
- if (inner) inner.style.transform = `rotate(${angle}deg)`
- } catch { /* map not ready / projection failure */ }
- }
+ // No stats badge: the floating route/duration label on the arc was removed,
+ // so a rendered overlay is the connection lines plus the airport markers.
}
}
diff --git a/client/src/components/Map/usePoiExplore.test.tsx b/client/src/components/Map/usePoiExplore.test.tsx
index 741ed9169..66d0346d5 100644
--- a/client/src/components/Map/usePoiExplore.test.tsx
+++ b/client/src/components/Map/usePoiExplore.test.tsx
@@ -1,4 +1,4 @@
-// FE-COMP-POIEXPLORE-001 to FE-COMP-POIEXPLORE-016
+// FE-COMP-POIEXPLORE-001 to FE-COMP-POIEXPLORE-018
import React from 'react'
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'
import { act, renderHook, waitFor } from '@testing-library/react'
@@ -240,4 +240,34 @@ describe('usePoiExplore', () => {
expect(result.current.errorKeys.size).toBe(0)
expect(result.current.pois[0].osm_id).toBe('node/9')
})
+
+ it('FE-COMP-POIEXPLORE-017: the abandoned category stops loading when the selection moves on', async () => {
+ const first = deferred<PoiResponse>()
+ pois.mockReturnValueOnce(first.promise)
+ const { result } = setup()
+ act(() => { result.current.onViewportChange(BBOX) })
+ act(() => { result.current.toggle('cafe') })
+ expect(result.current.loadingKeys.has('cafe')).toBe(true)
+
+ pois.mockResolvedValue(response([poi({ osm_id: 'node/9', category: 'bar' })]))
+ act(() => { result.current.toggle('bar') })
+
+ await act(async () => { first.reject(Object.assign(new Error('canceled'), { name: 'CanceledError' })) })
+
+ await waitFor(() => expect(result.current.loadingKeys.has('cafe')).toBe(false))
+ expect(result.current.loadingKeys.has('bar')).toBe(false)
+ })
+
+ it('FE-COMP-POIEXPLORE-018: turning the category off stops its spinner as well', async () => {
+ const d = deferred<PoiResponse>()
+ pois.mockReturnValue(d.promise)
+ const { result } = setup()
+ act(() => { result.current.onViewportChange(BBOX) })
+ act(() => { result.current.toggle('cafe') })
+ act(() => { result.current.toggle('cafe') })
+
+ await act(async () => { d.reject(Object.assign(new Error('canceled'), { name: 'CanceledError' })) })
+
+ await waitFor(() => expect(result.current.loadingKeys.size).toBe(0))
+ })
})
diff --git a/client/src/components/Map/usePoiExplore.ts b/client/src/components/Map/usePoiExplore.ts
index 710adc757..335f3afaa 100644
--- a/client/src/components/Map/usePoiExplore.ts
+++ b/client/src/components/Map/usePoiExplore.ts
@@ -74,6 +74,11 @@ export function usePoiExplore() {
if (abortRef.current[key] === ctrl) {
setLoading(key, false)
delete abortRef.current[key]
+ } else if (!abortRef.current[key]) {
+ // Cancelled with nothing taking over (toggle switched the category, or
+ // turned it off) — no later request will clear this key, so do it here
+ // instead of leaving the pill spinning forever.
+ setLoading(key, false)
}
}
}, [setLoading, setError, locale])
diff --git a/client/src/components/PDF/TripPDF.test.ts b/client/src/components/PDF/TripPDF.test.ts
index 3c4350e8f..ce03819e9 100644
--- a/client/src/components/PDF/TripPDF.test.ts
+++ b/client/src/components/PDF/TripPDF.test.ts
@@ -899,4 +899,16 @@ describe('downloadTripPDF defaults', () => {
expect(endSection).toContain('reservations.span.end: Overnight Bus')
expect(endSection).not.toContain('22:00')
})
+
+ it('FE-W5PDF-027: an export without a locale still renders, with lang="en"', async () => {
+ await downloadTripPDF({ ...minimalArgs, locale: '' })
+
+ expect(srcdoc()).toContain('<html lang="en">')
+ })
+
+ it('FE-W5PDF-028: an export without assignments renders the days as empty', async () => {
+ await downloadTripPDF({ ...minimalArgs, assignments: undefined as any })
+
+ expect(srcdoc()).toContain('Day 1')
+ })
})
diff --git a/client/src/components/PDF/TripPDF.tsx b/client/src/components/PDF/TripPDF.tsx
index c3d084a38..a39515fb6 100644
--- a/client/src/components/PDF/TripPDF.tsx
+++ b/client/src/components/PDF/TripPDF.tsx
@@ -146,7 +146,9 @@ interface downloadTripPDFProps {
locale: string
}
-export async function downloadTripPDF({ trip, days, places, assignments, categories, dayNotes, reservations = [], t: _t, locale: _locale }: downloadTripPDFProps) {
+// `assignments` is normalised here once — every read below (and fetchPlacePhotos)
+// relies on it being an object.
+export async function downloadTripPDF({ trip, days, places, assignments = {}, categories, dayNotes, reservations = [], t: _t, locale: _locale }: downloadTripPDFProps) {
await ensureRenderer()
const loc = _locale || undefined
const tr = _t || (k => k)
@@ -165,7 +167,7 @@ export async function downloadTripPDF({ trip, days, places, assignments, categor
const photoMap = await fetchPlacePhotos(assignments, places)
const totalAssigned = new Set(
- Object.values(assignments || {}).flatMap(a => a.map(x => x.place?.id)).filter(Boolean)
+ Object.values(assignments).flatMap(a => a.map(x => x.place?.id)).filter(Boolean)
).size
// The PDF is a trip-scoped, shareable document, so totals stay in the trip's
// own currency. Rates are resolved ONCE before any HTML is built so the cover
@@ -173,7 +175,7 @@ export async function downloadTripPDF({ trip, days, places, assignments, categor
// entirely (offline export keeps working), and a failed fetch degrades to
// per-currency breakdowns instead of mislabeled sums (#1561).
const tripCur = (trip?.currency || 'EUR').toUpperCase()
- const allCostEntries: MoneyEntry[] = Object.values(assignments || {})
+ const allCostEntries: MoneyEntry[] = Object.values(assignments)
.flatMap(a => a)
.map(a => ({ amount: Number(a.place?.price) || 0, currency: a.place?.currency || tripCur }))
const needsFx = allCostEntries.some(e => e.amount > 0 && e.currency.toUpperCase() !== tripCur)
@@ -433,7 +435,7 @@ export async function downloadTripPDF({ trip, days, places, assignments, categor
</div>`
const html = `<!DOCTYPE html>
-<html lang="${loc.split('-')[0]}">
+<html lang="${(loc || 'en').split('-')[0]}">
<head>
<meta charset="UTF-8">
<base href="${window.location.origin}/">
diff --git a/client/src/components/Packing/PackingListPanelCategoryGroup.test.tsx b/client/src/components/Packing/PackingListPanelCategoryGroup.test.tsx
index 7c5f701a8..ebc2edbb2 100644
--- a/client/src/components/Packing/PackingListPanelCategoryGroup.test.tsx
+++ b/client/src/components/Packing/PackingListPanelCategoryGroup.test.tsx
@@ -229,24 +229,28 @@ describe('KategorieGruppe — bulk actions', () => {
await waitFor(() => expect(puts).toEqual([1]))
})
- it('FE-W5CAT-012: a throwing toggle during Check All surfaces a save error', async () => {
- useTripStore.setState({ togglePackingItem: async () => { throw new Error('offline') } })
+ it('FE-W5CAT-012: a failing PUT during Check All is reported by the store, once', async () => {
+ server.use(http.put('/api/trips/1/packing/:itemId', () => new HttpResponse(null, { status: 500 })))
+ seedStore(useTripStore, { packingItems: [buildPackingItem({ id: 1, name: 'Tent', checked: 0 })] })
const { container } = setup({ items: [buildPackingItem({ id: 1, name: 'Tent', checked: 0 })] })
openCategoryMenu(container)
fireEvent.click(screen.getByText('Check All'))
- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))
+ await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Error updating item', 'error', undefined))
+ expect(toastSpy).toHaveBeenCalledTimes(1)
})
- it('FE-W5CAT-013: a throwing toggle during Uncheck All surfaces a save error', async () => {
- useTripStore.setState({ togglePackingItem: async () => { throw new Error('offline') } })
+ it('FE-W5CAT-013: a failing PUT during Uncheck All is reported by the store, once', async () => {
+ server.use(http.put('/api/trips/1/packing/:itemId', () => new HttpResponse(null, { status: 500 })))
+ seedStore(useTripStore, { packingItems: [buildPackingItem({ id: 1, name: 'Tent', checked: 1 })] })
const { container } = setup({ items: [buildPackingItem({ id: 1, name: 'Tent', checked: 1 })] })
openCategoryMenu(container)
fireEvent.click(screen.getByText('Uncheck All'))
- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))
+ await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Error updating item', 'error', undefined))
+ expect(toastSpy).toHaveBeenCalledTimes(1)
})
it('FE-W5CAT-014: Delete List hands the whole category to the panel and closes the menu', async () => {
diff --git a/client/src/components/Packing/PackingListPanelCategoryGroup.tsx b/client/src/components/Packing/PackingListPanelCategoryGroup.tsx
index 66145b21f..5579f0955 100644
--- a/client/src/components/Packing/PackingListPanelCategoryGroup.tsx
+++ b/client/src/components/Packing/PackingListPanelCategoryGroup.tsx
@@ -98,19 +98,17 @@ export function KategorieGruppe({ kategorie, items, tripId, allCategories, onRen
catch { toast.error(t('packing.toast.renameError')) }
}
+ // togglePackingItem rolls its own optimistic update back and reports the
+ // failure itself, so the bulk actions just drive it item by item.
const handleCheckAll = async () => {
- try {
- for (const item of Array.from(items)) {
- if (!item.checked) await togglePackingItem(tripId, item.id, true)
- }
- } catch { toast.error(t('packing.toast.saveError')) }
+ for (const item of Array.from(items)) {
+ if (!item.checked) await togglePackingItem(tripId, item.id, true)
+ }
}
const handleUncheckAll = async () => {
- try {
- for (const item of Array.from(items)) {
- if (item.checked) await togglePackingItem(tripId, item.id, false)
- }
- } catch { toast.error(t('packing.toast.saveError')) }
+ for (const item of Array.from(items)) {
+ if (item.checked) await togglePackingItem(tripId, item.id, false)
+ }
}
const handleDeleteAll = async () => {
await onDeleteAll(items)
@@ -304,7 +302,8 @@ export function KategorieGruppe({ kategorie, items, tripId, allCategories, onRen
placeholder={t('packing.addItemPlaceholder')}
style={{ flex: 1, padding: '6px 10px', borderRadius: 8, border: '1px solid var(--border-primary)', fontSize: 'calc(12.5px * var(--fs-scale-body, 1))', fontFamily: 'inherit', outline: 'none', color: 'var(--text-primary)', background: 'var(--bg-input)' }}
/>
- <button onClick={() => { if (newItemName.trim()) { onAddItem(kategorie, newItemName.trim()); setNewItemName(''); setTimeout(() => addItemRef.current?.focus(), 30) } }}
+ {/* disabled while the field is empty, so no extra guard here */}
+ <button onClick={() => { onAddItem(kategorie, newItemName.trim()); setNewItemName(''); setTimeout(() => addItemRef.current?.focus(), 30) }}
disabled={!newItemName.trim()}
style={{ padding: '5px 8px', borderRadius: 8, border: 'none', background: newItemName.trim() ? 'var(--text-primary)' : 'var(--border-primary)', color: 'var(--bg-primary)', cursor: newItemName.trim() ? 'pointer' : 'default', display: 'flex' }}>
<Plus size={14} />
diff --git a/client/src/components/Packing/PackingShareControl.tsx b/client/src/components/Packing/PackingShareControl.tsx
index d744a70d9..8389e4ff1 100644
--- a/client/src/components/Packing/PackingShareControl.tsx
+++ b/client/src/components/Packing/PackingShareControl.tsx
@@ -120,7 +120,7 @@ function Row({ icon, label, sub, active, onClick }: { icon: React.ReactNode; lab
<button onClick={onClick}
style={{ display: 'flex', alignItems: 'flex-start', gap: 8, width: '100%', padding: '7px 10px', borderRadius: 7, border: 'none', cursor: 'pointer', background: active ? 'var(--bg-tertiary)' : 'none', fontFamily: 'inherit', textAlign: 'left' }}
onMouseEnter={e => { if (!active) e.currentTarget.style.background = 'var(--bg-tertiary)' }}
- onMouseLeave={e => { if (!active) e.currentTarget.style.background = active ? 'var(--bg-tertiary)' : 'none' }}>
+ onMouseLeave={e => { if (!active) e.currentTarget.style.background = 'none' }}>
<span style={{ color: active ? 'var(--accent)' : 'var(--text-muted)', marginTop: 1 }}>{icon}</span>
<span style={{ flex: 1, minWidth: 0 }}>
<span style={{ display: 'block', fontSize: 'calc(12.5px * var(--fs-scale-body, 1))', fontWeight: 600, color: 'var(--text-primary)' }}>{label}</span>
diff --git a/client/src/components/Planner/AddressInput.tsx b/client/src/components/Planner/AddressInput.tsx
index dc7230f02..07c51f0f3 100644
--- a/client/src/components/Planner/AddressInput.tsx
+++ b/client/src/components/Planner/AddressInput.tsx
@@ -101,7 +101,7 @@ export default function AddressInput({ value, onChange, placeholder, className }
<MapPin size={12} className="text-content-faint" style={{ marginTop: 2, flexShrink: 0 }} />
<span style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontSize: 'calc(13px * var(--fs-scale-body, 1))', fontWeight: 500, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{r.name || r.address}</div>
- {r.address && r.name !== r.address && (
+ {r.address && r.name && r.name !== r.address && (
<div className="text-content-faint" style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{r.address}</div>
)}
</span>
diff --git a/client/src/components/Planner/AirportSelect.tsx b/client/src/components/Planner/AirportSelect.tsx
index 00720fa5b..42ea3c9b8 100644
--- a/client/src/components/Planner/AirportSelect.tsx
+++ b/client/src/components/Planner/AirportSelect.tsx
@@ -71,8 +71,9 @@ export default function AirportSelect({ value, onChange, placeholder, style }: P
const data = await airportsApi.search(trimmed, controller.signal)
setResults(Array.isArray(data) ? data : [])
setHighlight(-1)
- } catch (err: any) {
- if (err?.name !== 'AbortError' && err?.name !== 'CanceledError') {
+ } catch (err) {
+ const name = (err as { name?: string } | null)?.name
+ if (name !== 'AbortError' && name !== 'CanceledError') {
setResults([])
}
} finally {
diff --git a/client/src/components/Planner/DayDetailPanel.tsx b/client/src/components/Planner/DayDetailPanel.tsx
index ecec60c62..e98ab3d54 100644
--- a/client/src/components/Planner/DayDetailPanel.tsx
+++ b/client/src/components/Planner/DayDetailPanel.tsx
@@ -378,66 +378,6 @@ function Chip({ icon: Icon, value }: ChipProps) {
)
}
-interface InfoChipProps {
- icon: React.ComponentType<{ size?: number; style?: React.CSSProperties }>
- label: string
- value: string
- placeholder: string
- onEdit: (value: string) => void
- type: 'text' | 'time'
-}
-
-function InfoChip({ icon: Icon, label, value, placeholder, onEdit, type }: InfoChipProps) {
- const [editing, setEditing] = React.useState(false)
- const [val, setVal] = React.useState(value || '')
- const inputRef = React.useRef(null)
-
- React.useEffect(() => { setVal(value || '') }, [value])
- React.useEffect(() => { if (editing && inputRef.current) inputRef.current.focus() }, [editing])
-
- const save = () => {
- setEditing(false)
- if (val !== (value || '')) onEdit(val)
- }
-
- return (
- <div
- onClick={() => setEditing(true)}
- style={{
- display: 'flex', alignItems: 'center', gap: 5, padding: '5px 9px', borderRadius: 8,
- background: 'var(--bg-card)', border: '1px solid var(--border-faint)',
- cursor: 'pointer', minWidth: 0, flex: type === 'text' ? 1 : undefined,
- }}
- >
- <Icon size={11} style={{ color: 'var(--text-faint)', flexShrink: 0 }} />
- <div style={{ minWidth: 0 }}>
- <div style={{ fontSize: 'calc(8px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)', fontWeight: 600, textTransform: 'uppercase', letterSpacing: '0.04em', lineHeight: 1 }}>{label}</div>
- {editing ? (
- <input
- ref={inputRef}
- type={type}
- value={val}
- onChange={e => setVal(e.target.value)}
- onBlur={save}
- onKeyDown={e => { if (e.key === 'Enter') save(); if (e.key === 'Escape') { setVal(value || ''); setEditing(false) } }}
- onClick={e => e.stopPropagation()}
- style={{
- border: 'none', outline: 'none', background: 'none', padding: 0, margin: 0,
- fontSize: 'calc(11px * var(--fs-scale-caption, 1))', fontWeight: 600, color: 'var(--text-primary)', fontFamily: 'inherit',
- width: type === 'time' ? 50 : '100%', lineHeight: 1.3,
- }}
- />
- ) : (
- <div style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))', fontWeight: 600, color: value ? 'var(--text-primary)' : 'var(--text-faint)', lineHeight: 1.3, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
- {value || placeholder}
- </div>
- )}
- </div>
- </div>
- )
-}
-
-
function AccommodationList({ dayAccommodations, day, reservations, canEditDays, fmtTime, blurCodes, t,
setAccommodation, setHotelForm, setHotelDayRange, setShowHotelPicker, handleRemoveAccommodation }: any) {
return (
diff --git a/client/src/components/Planner/DayPlanSidebar.test.tsx b/client/src/components/Planner/DayPlanSidebar.test.tsx
index ea4996623..db6aab5c9 100644
--- a/client/src/components/Planner/DayPlanSidebar.test.tsx
+++ b/client/src/components/Planner/DayPlanSidebar.test.tsx
@@ -3486,9 +3486,10 @@ describe('DayPlanSidebar', () => {
await user.click(screen.getByRole('button', { name: /confirm/i }))
await waitFor(() => expect(vi.mocked(assignmentsApi.updateTime)).toHaveBeenCalledWith(1, 12, { place_time: null, end_time: null }))
await waitFor(() => expect(onReorder).toHaveBeenCalledWith(10, [11, 12]))
- // The non-place rows keep their relative slot while the places are rewritten.
+ // The stop really moves past the booking: the bus lands behind both places
+ // instead of keeping its old slot between them.
await waitFor(() => expect(vi.mocked(reservationsApi.updatePositions)).toHaveBeenCalledWith(
- 1, [{ id: 541, day_plan_position: expect.any(Number) }], 10,
+ 1, [{ id: 541, day_plan_position: 1.5 }], 10,
))
})
@@ -3706,6 +3707,16 @@ describe('DayPlanSidebar remaining branches', () => {
expect(row).not.toHaveTextContent('4B')
})
+ it('FE-W5DPS-004: metadata that is not valid JSON leaves the row standing', async () => {
+ renderWith([buildReservation({
+ id: 604, type: 'bus', title: 'Night bus', day_id: 10,
+ reservation_time: '2025-06-01T09:00:00', metadata: '{not json',
+ }) as Reservation])
+
+ // The parse used to throw during render and took the whole sidebar with it.
+ expect(await screen.findByText('Night bus')).toBeInTheDocument()
+ })
+
it('FE-W5DPS-005: the place menu offers Save to collection only with the addon on', async () => {
const user = userEvent.setup()
const place = buildPlace({ id: 1, name: 'Louvre' })
diff --git a/client/src/components/Planner/DayPlanSidebar.tsx b/client/src/components/Planner/DayPlanSidebar.tsx
index 4b91d40d7..35aceafd7 100644
--- a/client/src/components/Planner/DayPlanSidebar.tsx
+++ b/client/src/components/Planner/DayPlanSidebar.tsx
@@ -6,7 +6,7 @@ import React, { useState, useEffect, useLayoutEffect, useRef, useMemo } from 're
import { avatarSrc } from '../../utils/avatarSrc'
import { ChevronDown, ChevronRight, ChevronUp, Navigation, RotateCcw, ExternalLink, Clock, Pencil, GripVertical, Ticket, Plus, FileText, Trash2, Car, Lock, Hotel, Footprints, Route as RouteIcon, Bookmark, TramFront, Zap } from 'lucide-react'
import { assignmentsApi, reservationsApi, daysApi } from '../../api/client'
-import { calculateRoute, calculateRouteWithLegs, optimizeRoute, generateGoogleMapsUrl } from '../Map/RouteCalculator'
+import { calculateRouteWithLegs, optimizeRoute, generateGoogleMapsUrl } from '../Map/RouteCalculator'
import PlaceAvatar from '../shared/PlaceAvatar'
import ConfirmDialog from '../shared/ConfirmDialog'
import { useContextMenu, ContextMenu } from '../shared/ContextMenu'
@@ -62,7 +62,9 @@ interface DayPlanSidebarProps {
onReorder: (dayId: number, orderedIds: number[]) => void
onReorderDays?: (orderedIds: number[]) => void
onAddDay?: (position?: number) => void
+ /** Renaming lives in the day-detail panel (#1065); the sidebar only forwards the prop. */
onUpdateDayTitle: (dayId: number, title: string) => void
+ /** The day route is computed by the planner page itself; kept for the existing call sites. */
onRouteCalculated: (route: RouteResult | null) => void
onAssignToDay: (placeId: number, dayId: number, position?: number) => void
onRemoveAssignment: (dayId: number, assignmentId: number) => void
@@ -121,7 +123,7 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
trip, days, places, categories, assignments,
selectedDayId, selectedPlaceId, selectedAssignmentId,
onSelectDay, onPlaceClick, onDayDetail, accommodations = [],
- onReorder, onReorderDays, onAddDay, onUpdateDayTitle, onRouteCalculated,
+ onReorder, onReorderDays, onAddDay,
onAssignToDay, onRemoveAssignment, onEditPlace, onDeletePlace,
reservations = [],
visibleConnectionIds = [],
@@ -175,10 +177,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
return new Set<number>(days.map(d => d.id))
})
useEffect(() => { onExpandedDaysChange?.(expandedDays) }, [expandedDays])
- const [editingDayId, setEditingDayId] = useState(null)
- const [editTitle, setEditTitle] = useState('')
- const [isCalculating, setIsCalculating] = useState(false)
- const [routeInfo, setRouteInfo] = useState(null)
// Per-segment legs keyed by day id, then by the start place's assignment id (or the
// transport's reservation id). Nested per day so several Route-toggled mobile days
// can't collide in one flat map — assignment ids and reservation ids come from
@@ -220,12 +218,10 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
}, [externalTransportDetail, onExternalTransportDetailHandled])
const [timeConfirm, setTimeConfirm] = useState<{
dayId: number; fromId: number; time: string;
- // For drag & drop reorder
+ // Target slot of the pending move — drag & drop and the arrow buttons both
+ // describe it as "put fromId before/after this merged row".
fromType?: string; toType?: string; toId?: number; insertAfter?: boolean; toLegIndex?: number | null;
- // For arrow reorder
- reorderIds?: number[];
} | null>(null)
- const inputRef = useRef(null)
const dragDataRef = useRef(null)
const scrollContainerRef = useRef<HTMLDivElement | null>(null)
useLayoutEffect(() => {
@@ -289,10 +285,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
prevDayCount.current = days.length
}, [days.length, tripId])
- useEffect(() => {
- if (editingDayId && inputRef.current) inputRef.current.focus()
- }, [editingDayId])
-
// Globaler Aufräum-Listener: wenn ein Drag endet ohne Drop, alles zurücksetzen
useEffect(() => {
const cleanup = () => {
@@ -582,41 +574,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
})
}
- // Check if a proposed reorder of place IDs would break chronological order
- // of ALL timed items (places with time + transport bookings)
- const wouldBreakChronology = (dayId: number, newPlaceIds: number[]) => {
- const da = getDayAssignments(dayId)
- const transport = getTransportForDay(dayId)
-
- // Simulate the merged list with places in new order + transports at their positions
- // Places get sequential integer positions
- const simItems: { pos: number; minutes: number }[] = []
- newPlaceIds.forEach((id, idx) => {
- const a = da.find(x => x.id === id)
- const m = parseTimeToMinutes(a?.place?.place_time)
- if (m !== null) simItems.push({ pos: idx, minutes: m })
- })
-
- // Transports: compute where they'd go with the new place order
- for (const r of transport) {
- const rMin = parseTimeToMinutes(r.reservation_time)
- if (rMin === null) continue
- // Find the last place (in new order) with time <= transport time
- let afterIdx = -1
- newPlaceIds.forEach((id, idx) => {
- const a = da.find(x => x.id === id)
- const pm = parseTimeToMinutes(a?.place?.place_time)
- if (pm !== null && pm <= rMin) afterIdx = idx
- })
- const pos = afterIdx >= 0 ? afterIdx + 0.5 : newPlaceIds.length + 0.5
- simItems.push({ pos, minutes: rMin })
- }
-
- // Sort by position and check chronological order
- simItems.sort((a, b) => a.pos - b.pos)
- return !simItems.every((item, i) => i === 0 || item.minutes >= simItems[i - 1].minutes)
- }
-
const openEditNote = (dayId: number, note: DayNote, e?: React.MouseEvent) => {
e?.stopPropagation()
_openEditNote(dayId, note)
@@ -793,7 +750,7 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
const confirmTimeRemoval = async () => {
if (!timeConfirm) return
const saved = { ...timeConfirm }
- const { dayId, fromId, reorderIds, fromType, toType, toId, insertAfter, toLegIndex } = saved
+ const { dayId, fromId, fromType, toType, toId, insertAfter, toLegIndex } = saved
setTimeConfirm(null)
// Remove time from assignment
@@ -812,29 +769,9 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
return
}
- // Build new merged order from either arrow reorderIds or drag & drop params
+ // Re-apply the pending move against the current merged list
const m = getMergedItems(dayId)
- if (reorderIds) {
- // Arrow reorder: rebuild merged list with places in the new order,
- // keeping transports and notes at their relative positions
- const newMerged: typeof m = []
- let rIdx = 0
- for (const item of m) {
- if (item.type === 'place') {
- // Replace with the place from reorderIds at this position
- const nextId = reorderIds[rIdx++]
- const replacement = m.find(i => i.type === 'place' && i.data.id === nextId)
- if (replacement) newMerged.push(replacement)
- } else {
- newMerged.push(item)
- }
- }
- await applyMergedOrder(dayId, newMerged)
- return
- }
-
- // Drag & drop reorder
if (fromType && toType) {
const matchTo = (i: any) => i.type === toType && i.data.id === toId && (toLegIndex == null || i.data?.__leg?.index === toLegIndex)
const fromIdx = m.findIndex(i => i.type === fromType && i.data.id === fromId)
@@ -856,33 +793,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
await _moveNote(dayId, noteId, direction, getMergedItems)
}
- const startEditTitle = (day, e) => {
- e.stopPropagation()
- setEditTitle(day.title || '')
- setEditingDayId(day.id)
- }
-
- const saveTitle = async (dayId) => {
- setEditingDayId(null)
- await onUpdateDayTitle?.(dayId, editTitle.trim())
- }
-
- const handleCalculateRoute = async () => {
- if (!selectedDayId) return
- const da = getDayAssignments(selectedDayId)
- const waypoints = da.map(a => a.place).filter(p => p?.lat && p?.lng).map(p => ({ lat: p.lat, lng: p.lng }))
- if (waypoints.length < 2) { toast.error(t('dayplan.toast.needTwoPlaces')); return }
- setIsCalculating(true)
- try {
- const result = await calculateRoute(waypoints, 'walking')
- // Luftlinien zwischen Wegpunkten anzeigen
- const lineCoords = waypoints.map(p => [p.lat, p.lng] as [number, number])
- setRouteInfo({ distance: result.distanceText, duration: result.durationText })
- onRouteCalculated?.({ ...result, coordinates: lineCoords })
- } catch { toast.error(t('dayplan.toast.routeError')) }
- finally { setIsCalculating(false) }
- }
-
const toggleLock = (assignmentId) => {
const prevLocked = new Set(lockedIds)
setLockedIds(prev => {
@@ -894,8 +804,7 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
pushUndo?.(t('undo.lock'), () => { setLockedIds(prevLocked) })
}
- const handleOptimize = async (dayId: number | null = selectedDayId) => {
- if (!dayId) return
+ const handleOptimize = async (dayId: number) => {
const da = getDayAssignments(dayId)
if (da.length < 3) return
@@ -975,27 +884,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
window.__dragData = null
}
- const handleDropOnRow = (e, dayId, toIdx) => {
- e.preventDefault()
- e.stopPropagation()
- setDragOverDayId(null)
- const placeId = e.dataTransfer.getData('placeId')
- const fromAssignmentId = e.dataTransfer.getData('assignmentId')
-
- if (placeId) {
- onAssignToDay?.(parseInt(placeId), dayId)
- } else if (fromAssignmentId) {
- const da = getDayAssignments(dayId)
- const fromIdx = da.findIndex(a => String(a.id) === fromAssignmentId)
- if (fromIdx === -1 || fromIdx === toIdx) { setDraggingId(null); dragDataRef.current = null; return }
- const ids = da.map(a => a.id)
- const [removed] = ids.splice(fromIdx, 1)
- ids.splice(toIdx, 0, removed)
- onReorder(dayId, ids)
- }
- setDraggingId(null)
- }
-
const totalCostLabel = useMemo(() => {
const entries = days.flatMap(d => (assignments[String(d.id)] || []).map(a => ({
amount: Number(a.place?.price) || 0,
@@ -1025,8 +913,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
onReorder,
onReorderDays,
onAddDay,
- onUpdateDayTitle,
- onRouteCalculated,
onAssignToDay,
onRemoveAssignment,
onEditPlace,
@@ -1088,14 +974,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
moveNote,
expandedDays,
setExpandedDays,
- editingDayId,
- setEditingDayId,
- editTitle,
- setEditTitle,
- isCalculating,
- setIsCalculating,
- routeInfo,
- setRouteInfo,
routeLegs,
setRouteLegs,
hotelLegs,
@@ -1127,7 +1005,6 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
setTransportPosVersion,
timeConfirm,
setTimeConfirm,
- inputRef,
dragDataRef,
scrollContainerRef,
initedTransportIds,
@@ -1148,17 +1025,12 @@ function useDayPlanSidebar(props: DayPlanSidebarProps) {
initTransportPositions,
getMergedItems,
mergedItemsMap,
- wouldBreakChronology,
applyMergedOrder,
handleMergedDrop,
confirmTimeRemoval,
- startEditTitle,
- saveTitle,
- handleCalculateRoute,
toggleLock,
handleOptimize,
handleDropOnDay,
- handleDropOnRow,
totalCostLabel,
anyGeoAssignment,
anyGeoPlace,
@@ -1212,8 +1084,6 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
onReorder,
onReorderDays,
onAddDay,
- onUpdateDayTitle,
- onRouteCalculated,
onAssignToDay,
onRemoveAssignment,
onEditPlace,
@@ -1275,14 +1145,6 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
moveNote,
expandedDays,
setExpandedDays,
- editingDayId,
- setEditingDayId,
- editTitle,
- setEditTitle,
- isCalculating,
- setIsCalculating,
- routeInfo,
- setRouteInfo,
routeLegs,
setRouteLegs,
hotelLegs,
@@ -1314,7 +1176,6 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
setTransportPosVersion,
timeConfirm,
setTimeConfirm,
- inputRef,
dragDataRef,
scrollContainerRef,
initedTransportIds,
@@ -1335,17 +1196,12 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
initTransportPositions,
getMergedItems,
mergedItemsMap,
- wouldBreakChronology,
applyMergedOrder,
handleMergedDrop,
confirmTimeRemoval,
- startEditTitle,
- saveTitle,
- handleCalculateRoute,
toggleLock,
handleOptimize,
handleDropOnDay,
- handleDropOnRow,
totalCostLabel,
anyGeoAssignment,
anyGeoPlace,
@@ -1530,83 +1386,65 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
})()}
<div style={{ flex: 1, minWidth: 0 }}>
- {editingDayId === day.id ? (
- <input
- ref={inputRef}
- value={editTitle}
- onChange={e => setEditTitle(e.target.value)}
- onBlur={() => saveTitle(day.id)}
- onKeyDown={e => { if (e.key === 'Enter') saveTitle(day.id); if (e.key === 'Escape') setEditingDayId(null) }}
- onClick={e => e.stopPropagation()}
- style={{
- width: '100%', border: 'none', outline: 'none',
- fontSize: 'calc(13px * var(--fs-scale-body, 1))', fontWeight: 600, color: 'var(--text-primary)',
- background: 'transparent', padding: 0, fontFamily: 'inherit',
- borderBottom: '1.5px solid var(--text-primary)',
- }}
- />
- ) : (<>
- <div style={{ display: 'flex', alignItems: 'center', gap: 7, minWidth: 0 }}>
- <span style={{ fontSize: 'calc(14px * var(--fs-scale-body, 1))', fontWeight: 600, color: 'var(--text-primary)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', flexShrink: 1, minWidth: 0 }}>
- {day.title || t('dayplan.dayN', { n: index + 1 })}
- </span>
- {formattedDate && (
- <>
- <span style={{ flexShrink: 0, width: 1, height: 11, background: 'var(--border-primary)' }} />
- <span style={{ flexShrink: 0, fontSize: 'calc(11px * var(--fs-scale-caption, 1))', fontWeight: 400, color: 'var(--text-faint)', whiteSpace: 'nowrap' }}>
- {formattedDate}
- </span>
- </>
- )}
- </div>
+ <div style={{ display: 'flex', alignItems: 'center', gap: 7, minWidth: 0 }}>
+ <span style={{ fontSize: 'calc(14px * var(--fs-scale-body, 1))', fontWeight: 600, color: 'var(--text-primary)', overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', flexShrink: 1, minWidth: 0 }}>
+ {day.title || t('dayplan.dayN', { n: index + 1 })}
+ </span>
+ {formattedDate && (
+ <>
+ <span style={{ flexShrink: 0, width: 1, height: 11, background: 'var(--border-primary)' }} />
+ <span style={{ flexShrink: 0, fontSize: 'calc(11px * var(--fs-scale-caption, 1))', fontWeight: 400, color: 'var(--text-faint)', whiteSpace: 'nowrap' }}>
+ {formattedDate}
+ </span>
+ </>
+ )}
+ </div>
+ {(() => {
+ const hasAccs = accommodations.some(a => isDayInAccommodationRange(day, a.start_day_id, a.end_day_id, days))
+ const hasRentals = getActiveRentalsForDay(day.id).length > 0
+ if (!hasAccs && !hasRentals) return null
+ return <div style={{ height: 1, background: 'var(--border-faint)', margin: '5px 0 5px' }} />
+ })()}
+ <div style={{ display: 'flex', alignItems: 'center', gap: 5, flexWrap: 'nowrap', minWidth: 0 }}>
{(() => {
- const hasAccs = accommodations.some(a => isDayInAccommodationRange(day, a.start_day_id, a.end_day_id, days))
- const hasRentals = getActiveRentalsForDay(day.id).length > 0
- if (!hasAccs && !hasRentals) return null
- return <div style={{ height: 1, background: 'var(--border-faint)', margin: '5px 0 5px' }} />
- })()}
- <div style={{ display: 'flex', alignItems: 'center', gap: 5, flexWrap: 'nowrap', minWidth: 0 }}>
- {(() => {
- const dayAccs = accommodations.filter(a => isDayInAccommodationRange(day, a.start_day_id, a.end_day_id, days))
- // Sort: check-out first, then ongoing stays, then check-in last
- .sort((a, b) => {
- const aIsOut = a.end_day_id === day.id && a.start_day_id !== day.id
- const bIsOut = b.end_day_id === day.id && b.start_day_id !== day.id
- const aIsIn = a.start_day_id === day.id
- const bIsIn = b.start_day_id === day.id
- if (aIsOut && !bIsOut) return -1
- if (!aIsOut && bIsOut) return 1
- if (aIsIn && !bIsIn) return 1
- if (!aIsIn && bIsIn) return -1
- return 0
- })
- if (dayAccs.length === 0) return null
- return dayAccs.map(acc => {
- const isCheckIn = acc.start_day_id === day.id
- const isCheckOut = acc.end_day_id === day.id
- const iconColor = isCheckOut && !isCheckIn ? '#ef4444' : isCheckIn ? '#22c55e' : 'var(--text-faint)'
- return (
- <span key={acc.id} onClick={e => { e.stopPropagation(); if ((acc as any).place_id) onPlaceClick((acc as any).place_id) }} className="bg-surface-hover" style={{ display: 'inline-flex', alignItems: 'center', gap: 4, flexShrink: 1, minWidth: 0, cursor: (acc as any).place_id ? 'pointer' : 'default', borderRadius: 7, padding: '2px 7px 2px 6px' }}>
- <Hotel size={11} strokeWidth={1.8} style={{ color: iconColor, flexShrink: 0 }} />
- <span className="text-content-muted" style={{ fontSize: 'calc(10.5px * var(--fs-scale-caption, 1))', fontWeight: 400, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{(acc as any).place_name || (acc as any).reservation_title}</span>
- </span>
- )
+ const dayAccs = accommodations.filter(a => isDayInAccommodationRange(day, a.start_day_id, a.end_day_id, days))
+ // Sort: check-out first, then ongoing stays, then check-in last
+ .sort((a, b) => {
+ const aIsOut = a.end_day_id === day.id && a.start_day_id !== day.id
+ const bIsOut = b.end_day_id === day.id && b.start_day_id !== day.id
+ const aIsIn = a.start_day_id === day.id
+ const bIsIn = b.start_day_id === day.id
+ if (aIsOut && !bIsOut) return -1
+ if (!aIsOut && bIsOut) return 1
+ if (aIsIn && !bIsIn) return 1
+ if (!aIsIn && bIsIn) return -1
+ return 0
})
- })()}
- {/* Active rental car badges */}
- {(() => {
- const activeRentals = getActiveRentalsForDay(day.id)
- if (activeRentals.length === 0) return null
- return activeRentals.map(r => (
- <span key={`rental-${r.id}`} onClick={e => { e.stopPropagation(); setTransportDetail(r) }} className="bg-surface-hover" style={{ display: 'inline-flex', alignItems: 'center', gap: 4, flexShrink: 1, minWidth: 0, cursor: 'pointer', borderRadius: 7, padding: '2px 7px 2px 6px' }}>
- <Car size={11} strokeWidth={1.8} className="text-content-faint" style={{ flexShrink: 0 }} />
- <span className="text-content-muted" style={{ fontSize: 'calc(10.5px * var(--fs-scale-caption, 1))', fontWeight: 400, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{r.title}</span>
+ if (dayAccs.length === 0) return null
+ return dayAccs.map(acc => {
+ const isCheckIn = acc.start_day_id === day.id
+ const isCheckOut = acc.end_day_id === day.id
+ const iconColor = isCheckOut && !isCheckIn ? '#ef4444' : isCheckIn ? '#22c55e' : 'var(--text-faint)'
+ return (
+ <span key={acc.id} onClick={e => { e.stopPropagation(); if ((acc as any).place_id) onPlaceClick((acc as any).place_id) }} className="bg-surface-hover" style={{ display: 'inline-flex', alignItems: 'center', gap: 4, flexShrink: 1, minWidth: 0, cursor: (acc as any).place_id ? 'pointer' : 'default', borderRadius: 7, padding: '2px 7px 2px 6px' }}>
+ <Hotel size={11} strokeWidth={1.8} style={{ color: iconColor, flexShrink: 0 }} />
+ <span className="text-content-muted" style={{ fontSize: 'calc(10.5px * var(--fs-scale-caption, 1))', fontWeight: 400, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{(acc as any).place_name || (acc as any).reservation_title}</span>
</span>
- ))
- })()}
- </div>
- </>
- )}
+ )
+ })
+ })()}
+ {/* Active rental car badges */}
+ {(() => {
+ const activeRentals = getActiveRentalsForDay(day.id)
+ if (activeRentals.length === 0) return null
+ return activeRentals.map(r => (
+ <span key={`rental-${r.id}`} onClick={e => { e.stopPropagation(); setTransportDetail(r) }} className="bg-surface-hover" style={{ display: 'inline-flex', alignItems: 'center', gap: 4, flexShrink: 1, minWidth: 0, cursor: 'pointer', borderRadius: 7, padding: '2px 7px 2px 6px' }}>
+ <Car size={11} strokeWidth={1.8} className="text-content-faint" style={{ flexShrink: 0 }} />
+ <span className="text-content-muted" style={{ fontSize: 'calc(10.5px * var(--fs-scale-caption, 1))', fontWeight: 400, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{r.title}</span>
+ </span>
+ ))
+ })()}
+ </div>
{cost && (
<div style={{ marginTop: 2 }}>
<span className="text-[#059669]" style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))' }}>{cost}</span>
@@ -1767,8 +1605,16 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
const isChronological = timedInNewOrder.every((t, i) => i === 0 || t >= timedInNewOrder[i - 1])
if (!isChronological) {
const timeStr = placeTime.includes(':') ? placeTime.substring(0, 5) : placeTime
- // Store the new merged order for confirm action
- setTimeConfirm({ dayId: day.id, fromId: assignment.id, time: timeStr, reorderIds: newOrder.filter(i => i.type === 'place').map(i => i.data.id) })
+ // Describe the swap by its neighbour so the confirm step can
+ // replay it against the merged list — a place-id projection
+ // would drop moves across a booking or note.
+ const neighbour = m[targetIdx]
+ setTimeConfirm({
+ dayId: day.id, fromId: assignment.id, time: timeStr,
+ fromType: 'place', toType: neighbour.type, toId: neighbour.data.id,
+ insertAfter: direction === 'down',
+ toLegIndex: neighbour.data?.__leg?.index ?? null,
+ })
return
}
}
@@ -1959,7 +1805,8 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
)
})()}
{(() => {
- const meta = typeof res.metadata === 'string' ? JSON.parse(res.metadata || '{}') : (res.metadata || {})
+ let meta: any = {}
+ try { meta = typeof res.metadata === 'string' ? JSON.parse(res.metadata || '{}') : (res.metadata || {}) } catch { meta = {} }
if (!meta) return null
if (meta.airline && meta.flight_number) return <span style={{ fontWeight: 400 }}>{meta.airline} {meta.flight_number}</span>
if (meta.flight_number) return <span style={{ fontWeight: 400 }}>{meta.flight_number}</span>
@@ -2088,7 +1935,8 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
const TransportIcon = RES_ICONS[res.type] || Ticket
const color = '#3b82f6'
- const meta = typeof res.metadata === 'string' ? JSON.parse(res.metadata || '{}') : (res.metadata || {})
+ let meta: any = {}
+ try { meta = typeof res.metadata === 'string' ? JSON.parse(res.metadata || '{}') : (res.metadata || {}) } catch { meta = {} }
// Subtitle aus Metadaten zusammensetzen
let subtitle = ''
@@ -2473,10 +2321,11 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
next.has(day.id) ? next.delete(day.id) : next.add(day.id)
return next
})
- } else if (isSelected) { onToggleRoute?.() }
- // Desktop: the route is computed for the globally selected day,
- // so tapping Route on another day first points the selection here.
- else { onSelectDay(day.id, true); if (!routeShown) onToggleRoute?.() }
+ } else {
+ // Desktop: the tools only render for the selected day, so the
+ // toggle always applies to it.
+ onToggleRoute?.()
+ }
}}
className={routeActive ? 'bg-accent text-accent-text' : 'bg-transparent text-content-secondary'}
style={{
@@ -2558,22 +2407,16 @@ const DayPlanSidebar = React.memo(function DayPlanSidebar(props: DayPlanSidebarP
})}
</div>
</div>
- {isSelected && (routeInfo || daySchedule.minutesByDay[day.id]) && (
+ {/* Time plugins contributed to this day (charging, buffers) — the
+ dayScheduleProvider minutes folded into the footer total. */}
+ {isSelected && daySchedule.minutesByDay[day.id] ? (
<div className="text-content-secondary bg-surface-hover" style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 12, fontSize: 'calc(12px * var(--fs-scale-body, 1))', borderRadius: 8, padding: '5px 10px' }}>
- {routeInfo && <span>{routeInfo.distance}</span>}
- {routeInfo && <span className="text-content-faint">·</span>}
- {routeInfo && <span>{routeInfo.duration}</span>}
- {/* Time plugins contributed to this day (charging, buffers) — the
- dayScheduleProvider minutes folded into the footer total. */}
- {daySchedule.minutesByDay[day.id] ? (
- <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4 }}>
- {routeInfo && <span className="text-content-faint">·</span>}
- <Zap size={11} strokeWidth={2} />
- +{formatScheduleMinutes(daySchedule.minutesByDay[day.id])}
- </span>
- ) : null}
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4 }}>
+ <Zap size={11} strokeWidth={2} />
+ +{formatScheduleMinutes(daySchedule.minutesByDay[day.id])}
+ </span>
</div>
- )}
+ ) : null}
</div>
)}
diff --git a/client/src/components/Planner/LocationSelect.test.tsx b/client/src/components/Planner/LocationSelect.test.tsx
index 6af8976ae..c83ca1204 100644
--- a/client/src/components/Planner/LocationSelect.test.tsx
+++ b/client/src/components/Planner/LocationSelect.test.tsx
@@ -116,10 +116,10 @@ describe('LocationSelect', () => {
render(<Host onPick={onPick} />);
await user.type(screen.getByRole('textbox'), 'Oberkampf');
- // The row falls back to the address for its title and still prints the
- // address line underneath, so the same text shows up twice.
+ // The row falls back to the address for its title and skips the address
+ // subtitle, so the text shows up once.
const rows = await screen.findAllByText('12 Rue Oberkampf');
- expect(rows).toHaveLength(2);
+ expect(rows).toHaveLength(1);
await user.click(rows[0]);
expect(onPick).toHaveBeenCalledWith(expect.objectContaining({ name: '12 Rue Oberkampf' }));
diff --git a/client/src/components/Planner/LocationSelect.tsx b/client/src/components/Planner/LocationSelect.tsx
index 49eb5e84d..7547ef356 100644
--- a/client/src/components/Planner/LocationSelect.tsx
+++ b/client/src/components/Planner/LocationSelect.tsx
@@ -128,7 +128,7 @@ export default function LocationSelect({ value, onChange, placeholder, style }:
<MapPin size={12} className="text-content-faint" style={{ marginTop: 2, flexShrink: 0 }} />
<span style={{ flex: 1, minWidth: 0 }}>
<div style={{ fontSize: 'calc(13px * var(--fs-scale-body, 1))', fontWeight: 500, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{r.name || r.address}</div>
- {r.address && r.name !== r.address && (
+ {r.address && r.name && r.name !== r.address && (
<div className="text-content-faint" style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>{r.address}</div>
)}
</span>
diff --git a/client/src/components/Planner/PlaceFormModal.test.tsx b/client/src/components/Planner/PlaceFormModal.test.tsx
index 92a262b70..351c47832 100644
--- a/client/src/components/Planner/PlaceFormModal.test.tsx
+++ b/client/src/components/Planner/PlaceFormModal.test.tsx
@@ -379,14 +379,35 @@ describe('PlaceFormModal', () => {
});
it('FE-PLANNER-PLACEFORM-024: onCategoryCreated is called when creating a category', async () => {
+ const user = userEvent.setup();
const onCategoryCreated = vi.fn().mockResolvedValue({ id: 99, name: 'Beaches', color: '#6366f1', icon: 'MapPin' });
- // Directly invoke handleCreateCategory by setting showNewCategory via the category name input
- // Since there's no UI trigger for showNewCategory, we test that the prop is accepted
- // and category creation works by checking the modal renders correctly
+
render(<PlaceFormModal {...defaultProps} onCategoryCreated={onCategoryCreated} />);
- expect(screen.getByText('Category')).toBeInTheDocument();
- // onCategoryCreated not called unless the new-category form is shown and submitted
expect(onCategoryCreated).not.toHaveBeenCalled();
+
+ // The plus next to the category select swaps in the inline name field.
+ await user.click(screen.getByRole('button', { name: 'New category' }));
+ await user.type(screen.getByPlaceholderText('Category name'), 'Beaches');
+ await user.click(screen.getByRole('button', { name: 'OK' }));
+
+ expect(onCategoryCreated).toHaveBeenCalledWith({ name: 'Beaches', color: '#6366f1', icon: 'MapPin' });
+ // The new category is selected and the inline field closes again.
+ await waitFor(() => expect(screen.queryByPlaceholderText('Category name')).not.toBeInTheDocument());
+ });
+
+ it('FE-PLANNER-PLACEFORM-024b: an empty category name does not call onCategoryCreated', async () => {
+ const user = userEvent.setup();
+ const onCategoryCreated = vi.fn();
+
+ render(<PlaceFormModal {...defaultProps} onCategoryCreated={onCategoryCreated} />);
+ await user.click(screen.getByRole('button', { name: 'New category' }));
+ await user.click(screen.getByRole('button', { name: 'OK' }));
+
+ expect(onCategoryCreated).not.toHaveBeenCalled();
+
+ const inlineRow = screen.getByPlaceholderText('Category name').parentElement!;
+ await user.click(within(inlineRow).getByRole('button', { name: 'Cancel' }));
+ expect(screen.queryByPlaceholderText('Category name')).not.toBeInTheDocument();
});
// ── Time section (edit mode only) ────────────────────────────────────────────
diff --git a/client/src/components/Planner/PlaceFormModal.tsx b/client/src/components/Planner/PlaceFormModal.tsx
index b50e7c67c..4b1d26eed 100644
--- a/client/src/components/Planner/PlaceFormModal.tsx
+++ b/client/src/components/Planner/PlaceFormModal.tsx
@@ -8,7 +8,7 @@ import { useTripStore } from '../../store/tripStore'
import { useAddonStore } from '../../store/addonStore'
import CollectionPicker from '../Collections/CollectionPicker'
import { useToast } from '../shared/Toast'
-import { Search, Paperclip, X, AlertTriangle, Loader2 } from 'lucide-react'
+import { Search, Paperclip, X, AlertTriangle, Loader2, Plus } from 'lucide-react'
import { useTranslation } from '../../i18n'
import CustomTimePicker from '../shared/CustomTimePicker'
import { DEFAULT_FORM, isGoogleMapsUrl, type PlaceFormData } from './PlaceFormModal.helpers'
@@ -747,6 +747,15 @@ export default function PlaceFormModal(props: PlaceFormModalProps) {
style={{ flex: 1 }}
size="sm"
/>
+ <button
+ type="button"
+ onClick={() => setShowNewCategory(true)}
+ aria-label={t('places.newCategory')}
+ title={t('places.newCategory')}
+ className="text-gray-500 px-2 hover:text-gray-700"
+ >
+ <Plus size={16} />
+ </button>
</div>
) : (
<div className="flex gap-2">
diff --git a/client/src/components/Planner/PlaceInspector.tsx b/client/src/components/Planner/PlaceInspector.tsx
index 191601a42..1b99364d9 100644
--- a/client/src/components/Planner/PlaceInspector.tsx
+++ b/client/src/components/Planner/PlaceInspector.tsx
@@ -497,20 +497,6 @@ function Chip({ icon, text, color = 'var(--text-secondary)', bg = 'var(--bg-hove
)
}
-interface RowProps {
- icon: React.ReactNode
- children: React.ReactNode
-}
-
-function Row({ icon, children }: RowProps) {
- return (
- <div style={{ display: 'flex', alignItems: 'center', gap: 8 }}>
- <div style={{ flexShrink: 0 }}>{icon}</div>
- <div style={{ flex: 1, minWidth: 0 }}>{children}</div>
- </div>
- )
-}
-
interface ActionButtonProps {
onClick: () => void
variant: 'primary' | 'ghost' | 'danger'
diff --git a/client/src/components/Planner/ReservationModal.tsx b/client/src/components/Planner/ReservationModal.tsx
index d1c1eed5f..8163dfde7 100644
--- a/client/src/components/Planner/ReservationModal.tsx
+++ b/client/src/components/Planner/ReservationModal.tsx
@@ -214,19 +214,6 @@ export function ReservationModal({ isOpen, onClose, onSave, reservation, days, p
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [reservation, prefill, isOpen, selectedDayId, defaultAssignmentId, days, places, accommodations])
- // Re-hydrate hotel day range when the accommodations prop arrives after the modal opens
- // (race: tripAccommodations fetch may complete after isOpen fires, leaving hotel fields empty)
- useEffect(() => {
- if (!isOpen || !reservation || reservation.type !== 'hotel' || !reservation.accommodation_id) return
- const acc = accommodations.find(a => a.id == reservation.accommodation_id)
- if (!acc) return
- setForm(prev => {
- if (prev.hotel_place_id !== '' || prev.hotel_start_day !== '' || prev.hotel_end_day !== '') return prev
- const accPlace = places.find(p => p.id == acc.place_id)
- return { ...prev, hotel_place_id: acc.place_id, hotel_start_day: acc.start_day_id, hotel_end_day: acc.end_day_id, hotel_address: accPlace?.address || prev.hotel_address }
- })
- }, [accommodations, isOpen, reservation, places])
-
const set = (field, value) => setForm(prev => ({ ...prev, [field]: value }))
const toggleTraveler = (id: number) => setTravelerIds(prev => {
@@ -807,7 +794,6 @@ export function ReservationModal({ isOpen, onClose, onSave, reservation, days, p
}
function formatDate(dateStr, locale) {
- if (!dateStr) return ''
const d = new Date(dateStr + 'T00:00:00Z')
return d.toLocaleDateString(locale || undefined, { day: 'numeric', month: 'short', timeZone: 'UTC' })
}
diff --git a/client/src/components/Planner/ReservationsPanel.tsx b/client/src/components/Planner/ReservationsPanel.tsx
index 340201735..1ce7e4f01 100644
--- a/client/src/components/Planner/ReservationsPanel.tsx
+++ b/client/src/components/Planner/ReservationsPanel.tsx
@@ -90,7 +90,6 @@ interface ReservationCardProps {
}
function ReservationCard({ r, tripId, onEdit, onDelete, files = [], onNavigateToFiles, assignmentLookup, canEdit, days = [], contributions = [], detailPlugins = [] }: ReservationCardProps) {
- const { toggleReservationStatus } = useTripStore()
const toast = useToast()
const { t, locale } = useTranslation()
const timeFormat = useSettingsStore(s => s.settings.time_format) || '24h'
@@ -117,10 +116,6 @@ function ReservationCard({ r, tripId, onEdit, onDelete, files = [], onNavigateTo
const linked = r.assignment_id ? assignmentLookup[r.assignment_id] : null
const [showDeleteConfirm, setShowDeleteConfirm] = useState(false)
- const handleToggle = async () => {
- try { await toggleReservationStatus(tripId, r.id) }
- catch { toast.error(t('reservations.toast.updateError')) }
- }
const handleDelete = async () => {
setShowDeleteConfirm(false)
try { await onDelete(r.id) } catch { toast.error(t('reservations.toast.deleteError')) }
diff --git a/client/src/components/Planner/TransitSearchPanel.test.tsx b/client/src/components/Planner/TransitSearchPanel.test.tsx
index a9c003afb..3f4bdde6c 100644
--- a/client/src/components/Planner/TransitSearchPanel.test.tsx
+++ b/client/src/components/Planner/TransitSearchPanel.test.tsx
@@ -456,7 +456,7 @@ describe('TransitSearchPanel', () => {
})
const mixed = {
...ITINERARY,
- legs: [leg('BUS', 'B1'), leg('TRAM', 'M4'), leg('FERRY', 'F10'), leg('FUNICULAR', 'FU'), leg('AERIAL_LIFT', 'AL'), leg('HIGHSPEED_RAIL', 'ICE 599')],
+ legs: [leg('BUS', 'B1'), leg('TRAM', 'M4'), leg('FERRY', 'F10'), leg('FUNICULAR', 'FU'), leg('AERIAL_LIFT', 'AL'), leg('SUBWAY', 'U2'), leg('HIGHSPEED_RAIL', 'ICE 599')],
}
transitApiMock.plan.mockResolvedValueOnce({ itineraries: [mixed] })
render(<TransitSearchPanel {...makeProps()} />)
@@ -469,9 +469,11 @@ describe('TransitSearchPanel', () => {
expect(icon('F10')).toContain('lucide-sailboat')
expect(icon('FU')).toContain('lucide-cable-car')
expect(icon('AL')).toContain('lucide-cable-car')
- // Anything else (rail and friends) falls through to lucide's `Train`, which
- // is an alias of TramFront — so rail and tram currently share a glyph.
- expect(icon('ICE 599')).toContain('lucide-tram-front')
+ expect(icon('U2')).toContain('lucide-train-front-tunnel')
+ // Anything else (rail and friends) falls through to TrainFront, which stays
+ // distinct from the tram glyph.
+ expect(icon('ICE 599')).toContain('lucide-train-front')
+ expect(icon('ICE 599')).not.toContain('tunnel')
})
it('FE-PLANNER-TRANSIT-026: a leg without a usable timestamp renders an empty time cell, not "Invalid Date"', async () => {
diff --git a/client/src/components/Planner/TransitSearchPanel.tsx b/client/src/components/Planner/TransitSearchPanel.tsx
index a1cfce9e1..f610935a1 100644
--- a/client/src/components/Planner/TransitSearchPanel.tsx
+++ b/client/src/components/Planner/TransitSearchPanel.tsx
@@ -1,6 +1,6 @@
import React, { useEffect, useMemo, useRef, useState } from 'react'
import tzlookup from 'tz-lookup'
-import { ArrowLeftRight, ArrowRight, Bus, CableCar, ChevronDown, ChevronUp, Clock, Footprints, MapPin, Sailboat, Search, Train, TramFront, TrainFront } from 'lucide-react'
+import { ArrowLeftRight, ArrowRight, Bus, CableCar, ChevronDown, ChevronUp, Clock, Footprints, MapPin, Sailboat, Search, TramFront, TrainFront, TrainFrontTunnel } from 'lucide-react'
import CustomTimePicker from '../shared/CustomTimePicker'
import { TransitMetaBadges } from './transitDisplay'
import { transitApi } from '../../api/client'
@@ -39,22 +39,24 @@ export interface PickedPlace { name: string; lat: number; lng: number }
// ── helpers ──────────────────────────────────────────────────────────────────
const MODE_GROUPS: { key: string; labelKey: string; Icon: React.ComponentType<{ size?: number; strokeWidth?: number }>; modes: string }[] = [
- { key: 'rail', labelKey: 'transit.mode.rail', Icon: Train, modes: 'HIGHSPEED_RAIL,LONG_DISTANCE,NIGHT_RAIL,REGIONAL_RAIL,SUBURBAN' },
- { key: 'subway', labelKey: 'transit.mode.subway', Icon: TrainFront, modes: 'SUBWAY' },
+ // lucide's `Train` is an alias of TramFront, so rail keeps TrainFront and the
+ // subway takes the tunnel variant — otherwise the chips share a glyph.
+ { key: 'rail', labelKey: 'transit.mode.rail', Icon: TrainFront, modes: 'HIGHSPEED_RAIL,LONG_DISTANCE,NIGHT_RAIL,REGIONAL_RAIL,SUBURBAN' },
+ { key: 'subway', labelKey: 'transit.mode.subway', Icon: TrainFrontTunnel, modes: 'SUBWAY' },
{ key: 'tram', labelKey: 'transit.mode.tram', Icon: TramFront, modes: 'TRAM' },
{ key: 'bus', labelKey: 'transit.mode.bus', Icon: Bus, modes: 'BUS,COACH' },
{ key: 'ferry', labelKey: 'transit.mode.ferry', Icon: Sailboat, modes: 'FERRY' },
{ key: 'cable', labelKey: 'transit.mode.cable', Icon: CableCar, modes: 'FUNICULAR,AERIAL_LIFT' },
]
+// Only called for non-WALK legs — walking renders its own Footprints inline.
function legIcon(mode: string) {
- if (mode === 'WALK') return Footprints
if (mode === 'BUS' || mode === 'COACH') return Bus
if (mode === 'TRAM') return TramFront
- if (mode === 'SUBWAY') return TrainFront
+ if (mode === 'SUBWAY') return TrainFrontTunnel
if (mode === 'FERRY') return Sailboat
if (mode === 'FUNICULAR' || mode === 'AERIAL_LIFT') return CableCar
- return Train
+ return TrainFront
}
function tzAt(lat: number, lng: number): string {
diff --git a/client/src/components/Planner/usePlacesSidebar.ts b/client/src/components/Planner/usePlacesSidebar.ts
index 6dbd04b41..65e904c3c 100644
--- a/client/src/components/Planner/usePlacesSidebar.ts
+++ b/client/src/components/Planner/usePlacesSidebar.ts
@@ -58,7 +58,6 @@ export function usePlacesSidebar(props: PlacesSidebarProps) {
const collectionsEnabled = useAddonStore((s) => s.isEnabled('collections'))
// Places-API enrichment (#886) needs a Google Maps key; gate the toggle on it.
const canEnrichImport = useAuthStore((s) => s.hasMapsKey)
- const isNaverListImportEnabled = true
const [fileImportOpen, setFileImportOpen] = useState(false)
const [sidebarDropFile, setSidebarDropFile] = useState<File | null>(null)
@@ -106,19 +105,13 @@ export function usePlacesSidebar(props: PlacesSidebarProps) {
const [listImportLoading, setListImportLoading] = useState(false)
const [listImportProvider, setListImportProvider] = useState<'google' | 'naver'>('google')
const [listImportEnrich, setListImportEnrich] = useState(false)
- const availableListImportProviders: Array<'google' | 'naver'> = isNaverListImportEnabled ? ['google', 'naver'] : ['google']
+ const availableListImportProviders: Array<'google' | 'naver'> = ['google', 'naver']
const hasMultipleListImportProviders = availableListImportProviders.length > 1
- useEffect(() => {
- if (!isNaverListImportEnabled && listImportProvider === 'naver') {
- setListImportProvider('google')
- }
- }, [isNaverListImportEnabled, listImportProvider])
-
const handleListImport = async () => {
if (!listImportUrl.trim()) return
setListImportLoading(true)
- const provider = listImportProvider === 'naver' && isNaverListImportEnabled ? 'naver' : 'google'
+ const provider = listImportProvider
try {
const enrich = listImportEnrich && canEnrichImport
const result = provider === 'google'
@@ -186,7 +179,7 @@ export function usePlacesSidebar(props: PlacesSidebarProps) {
if (next.has(catId)) next.delete(catId); else next.add(catId)
setCategoryFilters(next)
}
- const [dayPickerPlace, setDayPickerPlace] = useState(null)
+ const [dayPickerPlace, setDayPickerPlace] = useState<Place | null>(null)
const [catDropOpen, setCatDropOpen] = useState(false)
const [mobileShowDays, setMobileShowDays] = useState(false)
diff --git a/client/src/components/Settings/AccountTab.tsx b/client/src/components/Settings/AccountTab.tsx
index 84fc7d87d..59c601394 100644
--- a/client/src/components/Settings/AccountTab.tsx
+++ b/client/src/components/Settings/AccountTab.tsx
@@ -4,6 +4,7 @@ import { useNavigate, useSearchParams } from 'react-router-dom'
import { useTranslation } from '../../i18n'
import { useAuthStore } from '../../store/authStore'
import { useToast } from '../shared/Toast'
+import { escapeHtml } from '@trek/shared'
import { authApi, adminApi } from '../../api/client'
import { getApiErrorMessage } from '../../types'
import type { UserWithOidc } from '../../types'
@@ -106,7 +107,7 @@ export default function AccountTab(): React.ReactElement {
if (!backupCodesText) return
const html = `<!doctype html><html><head><meta charset="utf-8"/><title>TREK MFA Backup Codes</title>
<style>body{font-family:Arial,sans-serif;padding:32px}h1{font-size:20px}pre{font-size:16px;line-height:1.6}</style>
- </head><body><h1>TREK MFA Backup Codes</h1><p>${new Date().toLocaleString()}</p><pre>${backupCodesText}</pre></body></html>`
+ </head><body><h1>TREK MFA Backup Codes</h1><p>${escapeHtml(new Date().toLocaleString())}</p><pre>${escapeHtml(backupCodesText)}</pre></body></html>`
const w = window.open('', '_blank', 'width=900,height=700')
if (!w) return
w.document.open()
diff --git a/client/src/components/Settings/MapSettingsTab.tsx b/client/src/components/Settings/MapSettingsTab.tsx
index 36601e362..995014770 100644
--- a/client/src/components/Settings/MapSettingsTab.tsx
+++ b/client/src/components/Settings/MapSettingsTab.tsx
@@ -196,7 +196,6 @@ export default function MapSettingsTab(): React.ReactElement {
setSaving(true)
try {
const glStyle = provider === 'leaflet' ? mapboxStyle : normalizeStyleForProvider(provider, mapboxStyle)
- setMapboxStyle(glStyle)
// Save into the active provider's own slot so the other provider's style survives.
const stylePatch = provider === 'maplibre-gl' ? { maplibre_style: glStyle } : { mapbox_style: glStyle }
await updateSettings({
@@ -207,6 +206,8 @@ export default function MapSettingsTab(): React.ReactElement {
mapbox_3d_enabled: mapbox3d,
mapbox_quality_mode: mapboxQuality,
})
+ // Only mirror the normalized style into the form once it is actually persisted.
+ setMapboxStyle(glStyle)
toast.success(t('settings.toast.mapSaved'))
} catch (err: unknown) {
toast.error(err instanceof Error ? err.message : t('common.error'))
diff --git a/client/src/components/Settings/NotificationsTab.tsx b/client/src/components/Settings/NotificationsTab.tsx
index 7f6d7e80b..35f0d22f0 100644
--- a/client/src/components/Settings/NotificationsTab.tsx
+++ b/client/src/components/Settings/NotificationsTab.tsx
@@ -165,9 +165,9 @@ export default function NotificationsTab(): React.ReactElement {
await settingsApi.setBulk({
ntfy_topic: ntfyTopic,
ntfy_server: ntfyServer,
- ...(ntfyToken && ntfyToken !== '••••••••' ? { ntfy_token: ntfyToken } : {}),
+ ...(ntfyToken ? { ntfy_token: ntfyToken } : {}),
})
- if (ntfyToken && ntfyToken !== '••••••••') setNtfyTokenIsSet(true)
+ if (ntfyToken) setNtfyTokenIsSet(true)
toast.success(t('settings.ntfyUrl.saved'))
} catch {
toast.error(t('common.error'))
@@ -194,7 +194,9 @@ export default function NotificationsTab(): React.ReactElement {
const result = await notificationsApi.testNtfy({
topic: ntfyTopic,
server: ntfyServer || null,
- token: ntfyToken && ntfyToken !== '••••••••' ? ntfyToken : null,
+ // A stored token is only masked in the placeholder, never in state — sending
+ // null makes the server fall back to the saved one.
+ token: ntfyToken || null,
})
if (result.success) toast.success(t('settings.ntfyUrl.testSuccess'))
else toast.error(result.error || t('settings.ntfyUrl.testFailed'))
diff --git a/client/src/components/Settings/PasskeysSection.tsx b/client/src/components/Settings/PasskeysSection.tsx
index a221ab6dd..a6db0329b 100644
--- a/client/src/components/Settings/PasskeysSection.tsx
+++ b/client/src/components/Settings/PasskeysSection.tsx
@@ -63,8 +63,9 @@ export default function PasskeysSection({ demoMode }: { demoMode?: boolean }): R
const canAdd = enabled && configured
+ // Both step-up flows are gated by disabled={busy || !pwd} on their submit button,
+ // so the password is always present by the time these run.
const handleAdd = async () => {
- if (!addPwd) { toast.error(t('settings.passkey.passwordRequired')); return }
setBusy(true)
try {
const options = await authApi.passkey.registerOptions(addPwd)
@@ -94,7 +95,6 @@ export default function PasskeysSection({ demoMode }: { demoMode?: boolean }): R
}
const handleDelete = async (id: number) => {
- if (!deletePwd) { toast.error(t('settings.passkey.passwordRequired')); return }
setBusy(true)
try {
await authApi.passkey.delete(id, deletePwd)
diff --git a/client/src/components/Settings/PhotoProvidersSection.tsx b/client/src/components/Settings/PhotoProvidersSection.tsx
index bd1659a7a..c36fce449 100644
--- a/client/src/components/Settings/PhotoProvidersSection.tsx
+++ b/client/src/components/Settings/PhotoProvidersSection.tsx
@@ -192,8 +192,11 @@ export default function PhotoProvidersSection(): React.ReactElement {
if (!testPath) return
setProviderTesting(prev => ({ ...prev, [provider.id]: true }))
try {
- const payload = buildProviderPayload(provider)
- const res = cfg.test_post ? await apiClient.post(testPath, payload) : await apiClient.get(testPath)
+ // Only a POST probe carries the form values. A provider that declares just a
+ // GET (test_get / status_get) is probed against its saved credentials.
+ const res = cfg.test_post
+ ? await apiClient.post(testPath, buildProviderPayload(provider))
+ : await apiClient.get(testPath)
const ok = !!res.data?.connected
setProviderConnected(prev => ({ ...prev, [provider.id]: ok }))
if (ok) {
diff --git a/client/src/components/SystemNotices/SystemNoticeBanner.tsx b/client/src/components/SystemNotices/SystemNoticeBanner.tsx
index 36c3a8de4..5bfb41774 100644
--- a/client/src/components/SystemNotices/SystemNoticeBanner.tsx
+++ b/client/src/components/SystemNotices/SystemNoticeBanner.tsx
@@ -1,10 +1,9 @@
-import React, { useState, useEffect, useRef, useCallback } from 'react';
+import React, { useState, useEffect, useRef } from 'react';
import { useNavigate } from 'react-router-dom';
import { Info, AlertTriangle, AlertOctagon, X } from 'lucide-react';
import { useSystemNoticeStore } from '../../store/systemNoticeStore.js';
import type { SystemNoticeDTO } from '../../store/systemNoticeStore.js';
import { useTranslation } from '../../i18n/index.js';
-import { isRtlLanguage } from '../../i18n/index.js';
import { runNoticeAction } from './noticeActions.js';
const SEVERITY_ICONS: Record<string, React.ElementType> = {
@@ -43,39 +42,37 @@ const SEVERITY = {
interface BannerItemProps {
notice: SystemNoticeDTO;
onDismiss: () => void;
- language: string;
}
function CTALink({
notice,
+ cta,
label,
onDismiss,
}: {
notice: SystemNoticeDTO;
+ cta: NonNullable<SystemNoticeDTO['cta']>;
label: string;
onDismiss: () => void;
}) {
const navigate = useNavigate();
function handleClick() {
- if (!notice.cta) return;
- if (notice.cta.kind === 'nav') {
- navigate(notice.cta.href);
+ if (cta.kind === 'nav') {
+ navigate(cta.href);
if (notice.dismissible) onDismiss();
- } else if (notice.cta.kind === 'link') {
- window.open(notice.cta.href, '_blank', 'noopener,noreferrer');
+ } else if (cta.kind === 'link') {
+ window.open(cta.href, '_blank', 'noopener,noreferrer');
} else {
- runNoticeAction(notice.cta.actionId, { navigate });
- if (notice.cta.dismissOnAction !== false) onDismiss();
+ runNoticeAction(cta.actionId, { navigate });
+ if (cta.dismissOnAction !== false) onDismiss();
}
}
- if (!notice.cta) return null;
-
- if (notice.cta.kind === 'nav' || notice.cta.kind === 'link') {
+ if (cta.kind === 'nav' || cta.kind === 'link') {
return (
<a
- href={notice.cta.href}
+ href={cta.href}
onClick={e => { e.preventDefault(); handleClick(); }}
className="underline hover:no-underline font-medium ml-3 shrink-0"
>
@@ -94,7 +91,7 @@ function CTALink({
);
}
-function BannerItem({ notice, onDismiss, language }: BannerItemProps) {
+function BannerItem({ notice, onDismiss }: BannerItemProps) {
const { t } = useTranslation();
const s = SEVERITY[notice.severity] ?? SEVERITY.info;
const title = t(notice.titleKey);
@@ -121,7 +118,7 @@ function BannerItem({ notice, onDismiss, language }: BannerItemProps) {
<span className="ml-2 opacity-80">{body}</span>
)}
{ctaLabel && notice.cta && (
- <CTALink notice={notice} label={ctaLabel} onDismiss={onDismiss} />
+ <CTALink notice={notice} cta={notice.cta} label={ctaLabel} onDismiss={onDismiss} />
)}
</div>
{notice.dismissible && (
@@ -140,10 +137,9 @@ function BannerItem({ notice, onDismiss, language }: BannerItemProps) {
interface AnimatedBannerItemProps {
notice: SystemNoticeDTO;
onDismiss: () => void;
- language: string;
}
-function AnimatedBannerItem({ notice, onDismiss, language }: AnimatedBannerItemProps) {
+function AnimatedBannerItem({ notice, onDismiss }: AnimatedBannerItemProps) {
const [mounted, setMounted] = useState(false);
const prefersReducedMotion =
typeof window !== 'undefined' &&
@@ -164,7 +160,7 @@ function AnimatedBannerItem({ notice, onDismiss, language }: AnimatedBannerItemP
return (
<div className={`${transition} ${state}`}>
- <BannerItem notice={notice} onDismiss={onDismiss} language={language} />
+ <BannerItem notice={notice} onDismiss={onDismiss} />
</div>
);
}
@@ -175,7 +171,6 @@ interface BannerRendererProps {
export function BannerRenderer({ notices }: BannerRendererProps) {
const { dismiss } = useSystemNoticeStore();
- const { language } = useTranslation();
const containerRef = useRef<HTMLDivElement>(null);
// Show at most 2 highest-priority banners
@@ -209,7 +204,6 @@ export function BannerRenderer({ notices }: BannerRendererProps) {
<AnimatedBannerItem
notice={notice}
onDismiss={() => dismiss(notice.id)}
- language={language}
/>
</React.Fragment>
))}
diff --git a/client/src/components/SystemNotices/SystemNoticeModal.test.tsx b/client/src/components/SystemNotices/SystemNoticeModal.test.tsx
index e301473a8..74ac18938 100644
--- a/client/src/components/SystemNotices/SystemNoticeModal.test.tsx
+++ b/client/src/components/SystemNotices/SystemNoticeModal.test.tsx
@@ -1326,7 +1326,7 @@ describe('ModalRenderer', () => {
expect(dismissSpy).not.toHaveBeenCalled();
});
- it('FE-SN-MODAL-056: pager buttons of the side slots cannot page past the ends', async () => {
+ it('FE-SN-MODAL-056: the side slots are inert previews, and their pagers cannot page past the ends', async () => {
stubMatchMedia({ mobile: true });
const notices = [
makeNotice({ id: 'n1', titleKey: 'Notice A' }),
@@ -1336,6 +1336,14 @@ describe('ModalRenderer', () => {
render(<ModalRenderer notices={notices} />);
await flushGraceDelay();
+ // the side slots carry a second copy of the pager and title, so they are
+ // kept out of the a11y tree and the tab order
+ const { prevSlot, nextSlot } = sheetParts();
+ expect(prevSlot.hasAttribute('inert')).toBe(true);
+ expect(prevSlot.getAttribute('aria-hidden')).toBe('true');
+ expect(nextSlot.hasAttribute('inert')).toBe(true);
+ expect(nextSlot.getAttribute('aria-hidden')).toBe('true');
+
// the next slot renders page 2's pager, whose "previous" button is enabled —
// pressing it must not move the sheet below the first page
const prevButtons = screen.getAllByLabelText('Previous notice') as HTMLButtonElement[];
diff --git a/client/src/components/SystemNotices/SystemNoticeModal.tsx b/client/src/components/SystemNotices/SystemNoticeModal.tsx
index a6c797eb4..293f247f2 100644
--- a/client/src/components/SystemNotices/SystemNoticeModal.tsx
+++ b/client/src/components/SystemNotices/SystemNoticeModal.tsx
@@ -77,7 +77,6 @@ interface ContentProps {
titleId: string;
bodyId: string;
isDark: boolean;
- onDismiss: () => void;
onDismissAll: () => void;
onCTA: () => void;
onSecondaryCTA: () => void;
@@ -90,7 +89,7 @@ interface ContentProps {
onGoto: (i: number) => void;
}
-function NoticeContent({ notice, title, body, ctaLabel, secondaryCtaLabel, titleId, bodyId, isDark, onDismiss, onDismissAll, onCTA, onSecondaryCTA, total, currentPage, canPage, onPrev, onNext, onGoto }: ContentProps) {
+function NoticeContent({ notice, title, body, ctaLabel, secondaryCtaLabel, titleId, bodyId, isDark, onDismissAll, onCTA, onSecondaryCTA, total, currentPage, canPage, onPrev, onNext, onGoto }: ContentProps) {
const { t } = useTranslation();
const isLastPage = total <= 1 || currentPage === total - 1;
@@ -383,9 +382,6 @@ function useSystemNoticeModal(notices: SystemNoticeDTO[]) {
// Sheet scroll offset at the moment the touch began — used to suppress dismiss-drag
// when the user is scrolled into content and pans down to scroll back up.
const scrollTopAtTouchStart = useRef(0);
- // Keep a ref to the current notice id so dismiss/CTA handlers see the latest value
- const noticeIdRef = useRef<string | null>(null);
- noticeIdRef.current = notice?.id ?? null;
// Page-slide animation refs.
// isPageNavRef: set to true just before a user-initiated page change so the
@@ -532,27 +528,13 @@ function useSystemNoticeModal(notices: SystemNoticeDTO[]) {
);
}
- // Dismiss current notice. The store removes it from the array, and the next
- // notice naturally shifts into notices[idx]. The clamp effect handles the
- // edge case where idx was pointing at the last item.
- function handleDismissById(id: string) {
- setVisible(false);
- dismiss(id);
- }
-
- function handleDismiss() {
- const id = noticeIdRef.current;
- if (id) handleDismissById(id);
- }
-
// Dismiss every notice in the current modal list — used by the X button and ESC.
function handleDismissAll() {
setVisible(false);
notices.forEach(n => dismiss(n.id));
}
- function runCta(cta: SystemNoticeDTO['cta']) {
- if (!cta) { handleDismissAll(); return; }
+ function runCta(cta: NonNullable<SystemNoticeDTO['cta']>) {
if (cta.kind === 'nav') {
navigate(cta.href);
if (notice?.dismissible !== false) handleDismissAll();
@@ -565,8 +547,9 @@ function useSystemNoticeModal(notices: SystemNoticeDTO[]) {
if (cta.dismissOnAction !== false) handleDismissAll();
}
}
- function handleCTA() { runCta(notice?.cta); }
- function handleSecondaryCTA() { runCta(notice?.secondaryCta); }
+ // Both buttons only render when the notice carries the matching cta.
+ function handleCTA() { runCta(notice!.cta!); }
+ function handleSecondaryCTA() { runCta(notice!.secondaryCta!); }
function animatedDismissAll() {
const sheet = sheetRef.current;
@@ -626,7 +609,7 @@ function useSystemNoticeModal(notices: SystemNoticeDTO[]) {
notice, canPage, isLastPage, language, t, dur, ease,
touchStartX, touchStartY, dragLockRef, scrollTopAtTouchStart, isPageNavRef,
stripRef, sheetRef, prevSlotRef, contentWrapperRef, nextSlotRef,
- announceIndex, handleDismiss, handleDismissAll, handleCTA, handleSecondaryCTA, animatedDismissAll,
+ announceIndex, handleDismissAll, handleCTA, handleSecondaryCTA, animatedDismissAll,
handlePrev, handleNext, handleGoto,
};
}
@@ -635,7 +618,7 @@ type NoticeState = ReturnType<typeof useSystemNoticeModal>;
// Build the NoticeContent props for a given notice + pager slot index.
function makeContentProps(S: NoticeState, n: SystemNoticeDTO, slotIdx: number): ContentProps {
- const { t, isDark, canPage, notices, handleDismiss, handleDismissAll, handleCTA, handleSecondaryCTA, handlePrev, handleNext, handleGoto } = S;
+ const { t, isDark, canPage, notices, handleDismissAll, handleCTA, handleSecondaryCTA, handlePrev, handleNext, handleGoto } = S;
const rawBody = t(n.bodyKey);
const body = n.bodyParams
? Object.entries(n.bodyParams).reduce(
@@ -652,7 +635,6 @@ function makeContentProps(S: NoticeState, n: SystemNoticeDTO, slotIdx: number):
titleId: `notice-title-${n.id}`,
bodyId: `notice-body-${n.id}`,
isDark,
- onDismiss: handleDismiss,
onDismissAll: handleDismissAll,
onCTA: handleCTA,
onSecondaryCTA: handleSecondaryCTA,
@@ -823,13 +805,16 @@ function MobileNoticeSheet(S: NoticeState) {
ref={stripRef}
style={{ display: 'flex', width: '300%', height: '100%', alignItems: 'stretch', transform: 'translateX(-33.333%)' }}
>
- <div ref={prevSlotRef} style={{ width: '33.333%', overflowY: 'auto', display: 'flex', flexDirection: 'column' }}>
+ {/* The side slots are drag previews only: their pager and CTA are a
+ second copy of the centre ones, so they stay out of the a11y tree
+ and the tab order until they become the centre slot. */}
+ <div ref={prevSlotRef} inert aria-hidden="true" style={{ width: '33.333%', overflowY: 'auto', display: 'flex', flexDirection: 'column' }}>
{prevNotice && <NoticeContent {...makeContentProps(S, prevNotice, idx - 1)} />}
</div>
<div ref={contentWrapperRef} style={{ width: '33.333%', overflowY: 'auto', display: 'flex', flexDirection: 'column' }}>
<NoticeContent {...makeContentProps(S, notice, idx)} />
</div>
- <div ref={nextSlotRef} style={{ width: '33.333%', overflowY: 'auto', display: 'flex', flexDirection: 'column' }}>
+ <div ref={nextSlotRef} inert aria-hidden="true" style={{ width: '33.333%', overflowY: 'auto', display: 'flex', flexDirection: 'column' }}>
{nextNotice && <NoticeContent {...makeContentProps(S, nextNotice, idx + 1)} />}
</div>
</div>
diff --git a/client/src/components/Todo/TodoListPanel.tsx b/client/src/components/Todo/TodoListPanel.tsx
index 482a14e9a..146526e77 100644
--- a/client/src/components/Todo/TodoListPanel.tsx
+++ b/client/src/components/Todo/TodoListPanel.tsx
@@ -22,6 +22,53 @@ import TodoRow from './TodoRow'
import { usePluginViewContributions, PluginCardFooter } from '../Plugins/PluginContributions'
import EmptyState from '../shared/EmptyState'
+// Sidebar filter row. Declared at module level so React keeps the same component
+// type across renders — inline it and every re-render remounts the buttons,
+// which drops clicks that are already in flight.
+function SidebarItem({ id, icon: Icon, label, count, color, active, compact, onSelect }: {
+ id: string
+ icon: any
+ label: string
+ count: number
+ color?: string
+ active: boolean
+ compact: boolean
+ onSelect: (id: string) => void
+}) {
+ return (
+ <button onClick={() => onSelect(id)}
+ title={compact ? label : undefined}
+ style={{
+ display: 'flex', alignItems: 'center', justifyContent: compact ? 'center' : 'flex-start',
+ gap: compact ? 0 : 8, width: '100%', padding: compact ? '8px 0' : '7px 12px',
+ border: 'none', borderRadius: 8, cursor: 'pointer', fontFamily: 'inherit', fontSize: 'calc(13px * var(--fs-scale-body, 1))',
+ background: active ? 'var(--bg-hover)' : 'transparent',
+ color: active ? 'var(--text-primary)' : 'var(--text-secondary)',
+ fontWeight: active ? 600 : 400, transition: 'all 0.1s',
+ position: 'relative',
+ }}
+ onMouseEnter={e => { if (!active) e.currentTarget.style.background = 'var(--bg-hover)' }}
+ onMouseLeave={e => { if (!active) e.currentTarget.style.background = 'transparent' }}>
+ {color ? (
+ <span style={{ width: compact ? 12 : 10, height: compact ? 12 : 10, borderRadius: '50%', background: color, flexShrink: 0 }} />
+ ) : (
+ <Icon size={compact ? 18 : 15} style={{ flexShrink: 0, opacity: 0.7 }} />
+ )}
+ {!compact && <span style={{ flex: 1, textAlign: 'left' }}>{label}</span>}
+ {!compact && count > 0 && (
+ <span style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)', background: 'var(--bg-hover)', borderRadius: 10, padding: '1px 7px', minWidth: 20, textAlign: 'center' }}>
+ {count}
+ </span>
+ )}
+ {compact && count > 0 && (
+ <span style={{ position: 'absolute', top: 2, right: 2, fontSize: 'calc(8px * var(--fs-scale-caption, 1))', fontWeight: 700, color: 'var(--bg-primary)', background: 'var(--text-faint)', borderRadius: '50%', width: 14, height: 14, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
+ {count}
+ </span>
+ )}
+ </button>
+ )
+}
+
export default function TodoListPanel({ tripId, items, addItemSignal = 0 }: { tripId: number; items: TodoItem[]; addItemSignal?: number }) {
// Layout component: state/effects/derived/handlers live in useTodoList.
const {
@@ -62,39 +109,7 @@ export default function TodoListPanel({ tripId, items, addItemSignal = 0 }: { tr
reorderTodoItems(tripId, globalIds)
}
- // Sidebar filter item
- const SidebarItem = ({ id, icon: Icon, label, count, color }: { id: string; icon: any; label: string; count: number; color?: string }) => (
- <button onClick={() => setFilter(id as FilterType)}
- title={isMobile ? label : undefined}
- style={{
- display: 'flex', alignItems: 'center', justifyContent: isMobile ? 'center' : 'flex-start',
- gap: isMobile ? 0 : 8, width: '100%', padding: isMobile ? '8px 0' : '7px 12px',
- border: 'none', borderRadius: 8, cursor: 'pointer', fontFamily: 'inherit', fontSize: 'calc(13px * var(--fs-scale-body, 1))',
- background: filter === id ? 'var(--bg-hover)' : 'transparent',
- color: filter === id ? 'var(--text-primary)' : 'var(--text-secondary)',
- fontWeight: filter === id ? 600 : 400, transition: 'all 0.1s',
- position: 'relative',
- }}
- onMouseEnter={e => { if (filter !== id) e.currentTarget.style.background = 'var(--bg-hover)' }}
- onMouseLeave={e => { if (filter !== id) e.currentTarget.style.background = 'transparent' }}>
- {color ? (
- <span style={{ width: isMobile ? 12 : 10, height: isMobile ? 12 : 10, borderRadius: '50%', background: color, flexShrink: 0 }} />
- ) : (
- <Icon size={isMobile ? 18 : 15} style={{ flexShrink: 0, opacity: 0.7 }} />
- )}
- {!isMobile && <span style={{ flex: 1, textAlign: 'left' }}>{label}</span>}
- {!isMobile && count > 0 && (
- <span style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)', background: 'var(--bg-hover)', borderRadius: 10, padding: '1px 7px', minWidth: 20, textAlign: 'center' }}>
- {count}
- </span>
- )}
- {isMobile && count > 0 && (
- <span style={{ position: 'absolute', top: 2, right: 2, fontSize: 'calc(8px * var(--fs-scale-caption, 1))', fontWeight: 700, color: 'var(--bg-primary)', background: 'var(--text-faint)', borderRadius: '50%', width: 14, height: 14, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
- {count}
- </span>
- )}
- </button>
- )
+ const selectFilter = (id: string) => setFilter(id as FilterType)
// Filter title
const filterTitle = (() => {
@@ -138,10 +153,10 @@ export default function TodoListPanel({ tripId, items, addItemSignal = 0 }: { tr
{!isMobile && <div style={{ fontSize: 'calc(10px * var(--fs-scale-caption, 1))', fontWeight: 600, color: 'var(--text-faint)', padding: '8px 12px 4px', textTransform: 'uppercase', letterSpacing: '0.05em' }}>
{t('todo.sidebar.tasks')}
</div>}
- <SidebarItem id="all" icon={Inbox} label={t('todo.filter.all')} count={items.filter(i => !i.checked).length} />
- <SidebarItem id="my" icon={User} label={t('todo.filter.my')} count={myCount} />
- <SidebarItem id="overdue" icon={AlertCircle} label={t('todo.filter.overdue')} count={overdueCount} />
- <SidebarItem id="done" icon={CheckCheck} label={t('todo.filter.done')} count={doneCount} />
+ <SidebarItem id="all" icon={Inbox} label={t('todo.filter.all')} count={items.filter(i => !i.checked).length} active={filter === 'all'} compact={isMobile} onSelect={selectFilter} />
+ <SidebarItem id="my" icon={User} label={t('todo.filter.my')} count={myCount} active={filter === 'my'} compact={isMobile} onSelect={selectFilter} />
+ <SidebarItem id="overdue" icon={AlertCircle} label={t('todo.filter.overdue')} count={overdueCount} active={filter === 'overdue'} compact={isMobile} onSelect={selectFilter} />
+ <SidebarItem id="done" icon={CheckCheck} label={t('todo.filter.done')} count={doneCount} active={filter === 'done'} compact={isMobile} onSelect={selectFilter} />
{/* Sort by */}
{!isMobile && <div style={{ fontSize: 'calc(10px * var(--fs-scale-caption, 1))', fontWeight: 600, color: 'var(--text-faint)', padding: '16px 12px 4px', textTransform: 'uppercase', letterSpacing: '0.05em' }}>
@@ -169,7 +184,7 @@ export default function TodoListPanel({ tripId, items, addItemSignal = 0 }: { tr
</div>}
{isMobile && <div style={{ height: 1, background: 'var(--border-faint)', margin: '8px 4px' }} />}
{categories.map(cat => (
- <SidebarItem key={cat} id={cat} icon={null} label={cat} count={catCount(cat)} color={katColor(cat, categories)} />
+ <SidebarItem key={cat} id={cat} icon={null} label={cat} count={catCount(cat)} color={katColor(cat, categories)} active={filter === cat} compact={isMobile} onSelect={selectFilter} />
))}
{canEdit && (
diff --git a/client/src/components/Todo/useTodoList.ts b/client/src/components/Todo/useTodoList.ts
index 1ccd1f7c0..afda45b4b 100644
--- a/client/src/components/Todo/useTodoList.ts
+++ b/client/src/components/Todo/useTodoList.ts
@@ -71,7 +71,8 @@ export function useTodoList(tripId: number, items: TodoItem[], addItemSignal: nu
let result: TodoItem[]
if (filter === 'all') result = items.filter(i => !i.checked)
else if (filter === 'done') result = items.filter(i => !!i.checked)
- else if (filter === 'my') result = items.filter(i => !i.checked && i.assigned_user_id === currentUserId)
+ // No resolved user means nothing is "mine" — matching the myCount badge.
+ else if (filter === 'my') result = currentUserId ? items.filter(i => !i.checked && i.assigned_user_id === currentUserId) : []
else if (filter === 'overdue') result = items.filter(i => !i.checked && i.due_date && i.due_date < today)
else result = items.filter(i => i.category === filter)
if (sortByPrio) result = [...result].sort((a, b) => {
diff --git a/client/src/components/Trips/TripFormModal.tsx b/client/src/components/Trips/TripFormModal.tsx
index 641df712b..fa28e3447 100644
--- a/client/src/components/Trips/TripFormModal.tsx
+++ b/client/src/components/Trips/TripFormModal.tsx
@@ -37,7 +37,7 @@ interface CoverSearchPhoto {
export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUpdate }: TripFormModalProps) {
const isEditing = !!trip
- const fileRef = useRef(null)
+ const fileRef = useRef<HTMLInputElement>(null)
const coverSearchSeq = useRef(0)
const toast = useToast()
const { t } = useTranslation()
@@ -202,7 +202,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
}
}
- const handleCoverSelect = async (file) => {
+ const handleCoverSelect = async (file: File | null | undefined) => {
if (!file) return
// HEIC/HEIF from iOS can't be rendered or stored as-is — convert to JPEG first
const normalized = await normalizeImageFile(file)
@@ -217,12 +217,12 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
}
}
- const handleCoverChange = (e) => {
- handleCoverSelect((e.target as HTMLInputElement).files?.[0])
+ const handleCoverChange = (e: React.ChangeEvent<HTMLInputElement>) => {
+ handleCoverSelect(e.target.files?.[0])
e.target.value = ''
}
- const uploadCoverNow = async (file) => {
+ const uploadCoverNow = async (file: File) => {
setUploadingCover(true)
try {
const fd = new FormData()
@@ -291,7 +291,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
setCoverPreview(null)
return
}
- if (!trip?.id) return
+ // Nothing pending left, so the preview is a saved trip's stored cover.
try {
await tripsApi.update(trip.id, { cover_image: null })
setCoverPreview(null)
@@ -613,8 +613,7 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
{selectedMembers.length > 0 && (
<div style={{ display: 'flex', flexWrap: 'wrap', gap: 6, marginBottom: 8 }}>
{selectedMembers.map(uid => {
- const user = allUsers.find(u => u.id === uid)
- if (!user) return null
+ const user = allUsers.find(u => u.id === uid)!
return (
<span key={uid} onClick={() => setSelectedMembers(prev => prev.filter(id => id !== uid))}
className="bg-surface-secondary text-content border border-edge cursor-pointer"
@@ -633,7 +632,6 @@ export default function TripFormModal({ isOpen, onClose, onSave, trip, onCoverUp
<CustomSelect
value={memberSelectValue}
onChange={async value => {
- if (!value) return
if (isEditing && trip?.id) {
const user = allUsers.find(u => u.id === Number(value))
if (user) {
diff --git a/client/src/components/Trips/TripMembersModal.test.tsx b/client/src/components/Trips/TripMembersModal.test.tsx
index 0e8042e8d..47db5a5c9 100644
--- a/client/src/components/Trips/TripMembersModal.test.tsx
+++ b/client/src/components/Trips/TripMembersModal.test.tsx
@@ -869,6 +869,23 @@ describe('TripMembersModal', () => {
await waitFor(() => expect(screen.queryByDisplayValue('Granny')).not.toBeInTheDocument());
});
+ it('FE-COMP-MEMBERS-048b: Enter followed by a blur renames only once', async () => {
+ const user = userEvent.setup();
+ mockRoster([guestRow]);
+ let renames = 0;
+ server.use(http.put('/api/trips/1/guests/:userId', () => { renames++; return HttpResponse.json({ success: true }); }));
+ render(<TripMembersModal {...defaultProps} />);
+
+ await user.click(await screen.findByTitle('Rename'));
+ const input = screen.getByDisplayValue('Grandma');
+ fireEvent.change(input, { target: { value: 'Granny' } });
+ fireEvent.keyDown(input, { key: 'Enter' });
+ fireEvent.blur(input);
+
+ await waitFor(() => expect(screen.queryByDisplayValue('Granny')).not.toBeInTheDocument());
+ expect(renames).toBe(1);
+ });
+
it('FE-COMP-MEMBERS-049: Escape cancels a rename and a blank name saves nothing', async () => {
const user = userEvent.setup();
mockRoster([guestRow]);
diff --git a/client/src/components/Trips/TripMembersModal.tsx b/client/src/components/Trips/TripMembersModal.tsx
index d9c32d8bd..b834e2127 100644
--- a/client/src/components/Trips/TripMembersModal.tsx
+++ b/client/src/components/Trips/TripMembersModal.tsx
@@ -202,7 +202,6 @@ function TripInviteLinkSection({ tripId, t }: { tripId: number; t: (key: string,
}
const copy = () => {
- if (!inviteUrl) return
navigator.clipboard.writeText(inviteUrl)
setCopied(true)
if (copyTimerRef.current) clearTimeout(copyTimerRef.current)
@@ -324,7 +323,6 @@ export default function TripMembersModal({ isOpen, onClose, tripId, tripTitle, o
}
const handleAdd = async () => {
- if (!selectedUserId) return
setAdding(true)
try {
const target = allUsers.find(u => String(u.id) === String(selectedUserId))
@@ -370,7 +368,14 @@ export default function TripMembersModal({ isOpen, onClose, tripId, tripTitle, o
}
}
+ // Enter commits, and the blur that follows would send the same rename a second
+ // time. Only the first commit per editing session goes through; a failed one
+ // reopens the gate so the user can retry from the still-open input.
+ const renameCommittedRef = useRef(false)
+
const handleRenameGuest = async (userId) => {
+ if (renameCommittedRef.current) return
+ renameCommittedRef.current = true
const name = renameValue.trim()
if (!name) { setRenamingGuestId(null); return }
try {
@@ -378,6 +383,7 @@ export default function TripMembersModal({ isOpen, onClose, tripId, tripTitle, o
setRenamingGuestId(null)
await loadMembers(true)
} catch (err: unknown) {
+ renameCommittedRef.current = false
toast.error(getApiErrorMessage(err, t('members.guestRenameError')))
}
}
@@ -572,7 +578,7 @@ export default function TripMembersModal({ isOpen, onClose, tripId, tripTitle, o
autoFocus
value={renameValue}
onChange={e => setRenameValue(e.target.value)}
- onKeyDown={e => { if (e.key === 'Enter') handleRenameGuest(g.id); if (e.key === 'Escape') setRenamingGuestId(null) }}
+ onKeyDown={e => { if (e.key === 'Enter') handleRenameGuest(g.id); if (e.key === 'Escape') { renameCommittedRef.current = true; setRenamingGuestId(null) } }}
onBlur={() => handleRenameGuest(g.id)}
maxLength={50}
className="bg-surface border border-edge text-content"
@@ -589,7 +595,7 @@ export default function TripMembersModal({ isOpen, onClose, tripId, tripTitle, o
{isCurrentOwner && renamingGuestId !== g.id && (
<>
<button
- onClick={() => { setRenamingGuestId(g.id); setRenameValue(g.username) }}
+ onClick={() => { renameCommittedRef.current = false; setRenamingGuestId(g.id); setRenameValue(g.username) }}
title={t('common.rename')}
style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '4px', borderRadius: 6, display: 'flex', color: 'var(--text-faint)' }}
onMouseEnter={e => e.currentTarget.style.color = 'var(--text-secondary)'}
diff --git a/client/src/components/shared/ConfirmDialog.test.tsx b/client/src/components/shared/ConfirmDialog.test.tsx
index 592d5fa7f..85908be12 100644
--- a/client/src/components/shared/ConfirmDialog.test.tsx
+++ b/client/src/components/shared/ConfirmDialog.test.tsx
@@ -76,6 +76,21 @@ describe('ConfirmDialog', () => {
expect(onClose).toHaveBeenCalledOnce();
});
+ it('FE-COMP-CONFIRM-009: a rejecting async onConfirm does not escape as an unhandled rejection', async () => {
+ const unhandled = vi.fn();
+ process.on('unhandledRejection', unhandled);
+ const failing = vi.fn(() => Promise.reject(new Error('delete failed')));
+
+ render(<ConfirmDialog isOpen={true} onClose={onClose} onConfirm={failing} />);
+ fireEvent.click(screen.getByRole('button', { name: /delete/i }));
+ await new Promise(resolve => setTimeout(resolve, 0));
+
+ expect(failing).toHaveBeenCalledOnce();
+ expect(onClose).toHaveBeenCalledOnce();
+ expect(unhandled).not.toHaveBeenCalled();
+ process.off('unhandledRejection', unhandled);
+ });
+
it('FE-COMP-CONFIRM-008: clicking backdrop calls onClose', async () => {
const user = userEvent.setup();
render(<ConfirmDialog isOpen={true} onClose={onClose} onConfirm={onConfirm} message="msg" />);
diff --git a/client/src/components/shared/ConfirmDialog.tsx b/client/src/components/shared/ConfirmDialog.tsx
index d11ccc170..fbc3ba975 100644
--- a/client/src/components/shared/ConfirmDialog.tsx
+++ b/client/src/components/shared/ConfirmDialog.tsx
@@ -14,6 +14,16 @@ interface ConfirmDialogProps {
danger?: boolean
}
+// Callers commonly pass an async handler that reports its own failure and then
+// rethrows. The dialog has already closed at that point, so the rejection would
+// escape as an unhandled promise — absorb it here.
+function runConfirm(onConfirm: () => void): void {
+ const result = onConfirm() as unknown
+ if (result && typeof (result as PromiseLike<unknown>).then === 'function') {
+ void Promise.resolve(result).catch(() => {})
+ }
+}
+
export default function ConfirmDialog({
isOpen,
onClose,
@@ -73,7 +83,7 @@ export default function ConfirmDialog({
{cancelLabel || t('common.cancel')}
</button>
<button
- onClick={() => { onConfirm(); onClose() }}
+ onClick={() => { runConfirm(onConfirm); onClose() }}
className={`px-4 py-2 text-sm font-medium rounded-lg transition-colors text-white ${
danger ? 'bg-red-600 hover:bg-red-700' : 'bg-blue-600 hover:bg-blue-700'
}`}
diff --git a/client/src/db/offlineDb.ts b/client/src/db/offlineDb.ts
index 31c903be6..02328f250 100644
--- a/client/src/db/offlineDb.ts
+++ b/client/src/db/offlineDb.ts
@@ -59,6 +59,7 @@ export interface SyncMeta {
status: 'idle' | 'syncing' | 'error';
/** Bounding box [minLng, minLat, maxLng, maxLat] of pre-downloaded map tiles */
tilesBbox: [number, number, number, number] | null;
+ /** Non-photo files available offline for this trip after the last sync. */
filesCachedCount: number;
}
@@ -217,9 +218,13 @@ export async function reopenAnonymous(): Promise<void> {
* DB. Used on logout so no trace of the account's data remains on the device.
*/
export async function deleteCurrentUserDb(): Promise<void> {
- if (_db.name !== ANON_DB_NAME) {
- try { await _db.delete(); } catch { /* ignore — fall through to anon */ }
+ // Already anonymous: there is nothing to delete, and opening a second
+ // connection to the same name would leak the current handle for the session.
+ if (_db.name === ANON_DB_NAME) {
+ await switchTo(ANON_DB_NAME);
+ return;
}
+ try { await _db.delete(); } catch { /* ignore — fall through to anon */ }
_db = new TrekOfflineDb(ANON_DB_NAME);
await _db.open();
}
diff --git a/client/src/mobile/screens/admin/MAdminAuditLogPanel.tsx b/client/src/mobile/screens/admin/MAdminAuditLogPanel.tsx
index f7e4303ff..83a4e9024 100644
--- a/client/src/mobile/screens/admin/MAdminAuditLogPanel.tsx
+++ b/client/src/mobile/screens/admin/MAdminAuditLogPanel.tsx
@@ -1,4 +1,4 @@
-import React, { useCallback, useEffect, useState } from 'react'
+import React, { useCallback, useEffect, useRef, useState } from 'react'
import { RefreshCw, ClipboardList } from 'lucide-react'
import { adminApi } from '../../../api/client'
import { useTranslation } from '../../../i18n'
@@ -24,8 +24,10 @@ export default function MAdminAuditLogPanel({ serverTimezone }: AuditLogPanelPro
const { t, locale } = useTranslation()
const [entries, setEntries] = useState<AuditEntry[]>([])
const [total, setTotal] = useState(0)
- const [offset, setOffset] = useState(0)
const [loading, setLoading] = useState(true)
+ // Never rendered, only carried between pages — a ref keeps loadMore from
+ // capturing a page number that is already spent.
+ const offsetRef = useRef(0)
const limit = 100
const loadFirstPage = useCallback(async () => {
@@ -37,18 +39,18 @@ export default function MAdminAuditLogPanel({ serverTimezone }: AuditLogPanelPro
}
setEntries(data.entries || [])
setTotal(data.total ?? 0)
- setOffset(0)
+ offsetRef.current = 0
} catch {
setEntries([])
setTotal(0)
- setOffset(0)
+ offsetRef.current = 0
} finally {
setLoading(false)
}
}, [])
const loadMore = useCallback(async () => {
- const nextOffset = offset + limit
+ const nextOffset = offsetRef.current + limit
setLoading(true)
try {
const data = (await adminApi.auditLog({ limit, offset: nextOffset })) as {
@@ -57,13 +59,13 @@ export default function MAdminAuditLogPanel({ serverTimezone }: AuditLogPanelPro
}
setEntries((prev) => [...prev, ...(data.entries || [])])
setTotal(data.total ?? 0)
- setOffset(nextOffset)
+ offsetRef.current = nextOffset
} catch {
/* keep existing */
} finally {
setLoading(false)
}
- }, [offset])
+ }, [])
useEffect(() => {
loadFirstPage()
diff --git a/client/src/mobile/screens/admin/MAdminBackupPanel.tsx b/client/src/mobile/screens/admin/MAdminBackupPanel.tsx
index ca8d80584..e45493c26 100644
--- a/client/src/mobile/screens/admin/MAdminBackupPanel.tsx
+++ b/client/src/mobile/screens/admin/MAdminBackupPanel.tsx
@@ -85,7 +85,8 @@ export default function MAdminBackupPanel() {
const loadAutoSettings = async () => {
try {
const data = await backupApi.getAutoSettings()
- setAutoSettings(data.settings)
+ // A 200 without a settings block would blank the whole schedule form.
+ if (data.settings) setAutoSettings(data.settings)
if (data.timezone) setServerTimezone(data.timezone)
} catch {}
}
@@ -170,7 +171,7 @@ export default function MAdminBackupPanel() {
setAutoSettingsSaving(true)
try {
const data = await backupApi.setAutoSettings(autoSettings)
- setAutoSettings(data.settings)
+ if (data.settings) setAutoSettings(data.settings)
setAutoSettingsDirty(false)
toast.success(t('backup.toast.settingsSaved'))
} catch {
diff --git a/client/src/mobile/screens/admin/MAdminCategoryManager.tsx b/client/src/mobile/screens/admin/MAdminCategoryManager.tsx
index 8830efd40..5aa270229 100644
--- a/client/src/mobile/screens/admin/MAdminCategoryManager.tsx
+++ b/client/src/mobile/screens/admin/MAdminCategoryManager.tsx
@@ -61,7 +61,6 @@ export default function MAdminCategoryManager() {
}
const handleSave = async () => {
- if (!form.name.trim()) { toast.error(t('categories.toast.nameRequired')); return }
setIsSaving(true)
try {
if (editingId) {
diff --git a/client/src/mobile/screens/admin/MAdminDefaultUserSettings.tsx b/client/src/mobile/screens/admin/MAdminDefaultUserSettings.tsx
index d980b8795..36773d6d0 100644
--- a/client/src/mobile/screens/admin/MAdminDefaultUserSettings.tsx
+++ b/client/src/mobile/screens/admin/MAdminDefaultUserSettings.tsx
@@ -5,7 +5,7 @@ import { useTranslation } from '../../../i18n'
import { useToast } from '../../../components/shared/Toast'
import { MapView } from '../../../components/Map/MapView'
import { SYMBOLS, currenciesWith } from '../../../components/Budget/BudgetPanel.constants'
-import type { DistanceUnit, Place } from '../../../types'
+import { getApiErrorMessage, type DistanceUnit, type Place } from '../../../types'
import {
MAPBOX_DEFAULT_STYLE,
defaultStyleForProvider,
@@ -89,7 +89,7 @@ export default function MAdminDefaultUserSettings(): React.ReactElement {
setDefaults(updated)
toast.success(t('admin.defaultSettings.saved'))
} catch (err: unknown) {
- toast.error(err instanceof Error ? err.message : t('common.error'))
+ toast.error(getApiErrorMessage(err, t('common.error')))
}
}
@@ -105,7 +105,7 @@ export default function MAdminDefaultUserSettings(): React.ReactElement {
}
toast.success(t('admin.defaultSettings.reset'))
} catch (err: unknown) {
- toast.error(err instanceof Error ? err.message : t('common.error'))
+ toast.error(getApiErrorMessage(err, t('common.error')))
}
}
@@ -144,7 +144,7 @@ export default function MAdminDefaultUserSettings(): React.ReactElement {
transport_mode: null,
website: null,
phone: null,
- created_at: Date(),
+ created_at: new Date().toISOString(),
}], [])
if (!loaded) {
diff --git a/client/src/mobile/screens/admin/MAdminDevNotificationsPanel.tsx b/client/src/mobile/screens/admin/MAdminDevNotificationsPanel.tsx
index 40319952f..2e3a3960f 100644
--- a/client/src/mobile/screens/admin/MAdminDevNotificationsPanel.tsx
+++ b/client/src/mobile/screens/admin/MAdminDevNotificationsPanel.tsx
@@ -20,6 +20,42 @@ interface AppUser {
email: string
}
+const SELECT_CLASS =
+ 'mb-2 h-[42px] w-full rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-3 text-[0.84375rem] text-m-ink outline-none focus:border-[color:var(--m-faint)]'
+
+function Btn({
+ id, label, sub, icon: Icon, color, sending, onClick,
+}: {
+ id: string
+ label: string
+ sub: string
+ icon: LucideIcon
+ color: string
+ sending: string | null
+ onClick: () => void
+}) {
+ return (
+ <button
+ type="button"
+ onClick={onClick}
+ disabled={sending !== null}
+ className="flex w-full items-center gap-3 rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-3 py-[11px] text-left disabled:opacity-50"
+ >
+ <span
+ className="flex h-8 w-8 flex-none items-center justify-center rounded-[10px]"
+ style={{ background: `${color}20`, color }}
+ >
+ <Icon className="h-4 w-4" />
+ </span>
+ <div className="min-w-0 flex-1">
+ <p className="text-[0.8125rem] font-bold text-m-ink">{label}</p>
+ <p className="truncate font-geist text-[0.625rem] text-m-faint">{sub}</p>
+ </div>
+ {sending === id && <Loader2 size={14} className="flex-none animate-spin text-m-faint" />}
+ </button>
+ )
+}
+
// Dev-only notification testing panel, re-skinned to the mobile admin system.
// All state, fetches and fire() payloads are ported verbatim from the desktop
// DevNotificationsPanel — only the presentation layer changes.
@@ -50,8 +86,8 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
try {
await adminApi.sendTestNotification(payload)
toast.success(`Sent: ${label}`)
- } catch (err: any) {
- toast.error(err.message || 'Failed')
+ } catch (err: unknown) {
+ toast.error(err instanceof Error ? err.message : 'Failed')
} finally {
setSending(null)
}
@@ -62,53 +98,6 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
const username = user?.username || 'Admin'
const tripTitle = selectedTrip?.title || 'Test Trip'
- // ── Helpers ──────────────────────────────────────────────────────────────
-
- const Btn = ({
- id, label, sub, icon: Icon, color, onClick,
- }: {
- id: string; label: string; sub: string; icon: LucideIcon; color: string; onClick: () => void
- }) => (
- <button
- type="button"
- onClick={onClick}
- disabled={sending !== null}
- className="flex w-full items-center gap-3 rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-3 py-[11px] text-left disabled:opacity-50"
- >
- <span
- className="flex h-8 w-8 flex-none items-center justify-center rounded-[10px]"
- style={{ background: `${color}20`, color }}
- >
- <Icon className="h-4 w-4" />
- </span>
- <div className="min-w-0 flex-1">
- <p className="text-[0.8125rem] font-bold text-m-ink">{label}</p>
- <p className="truncate font-geist text-[0.625rem] text-m-faint">{sub}</p>
- </div>
- {sending === id && <Loader2 size={14} className="flex-none animate-spin text-m-faint" />}
- </button>
- )
-
- const TripSelector = () => (
- <select
- value={selectedTripId ?? ''}
- onChange={e => setSelectedTripId(Number(e.target.value))}
- className="mb-2 h-[42px] w-full rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-3 text-[0.84375rem] text-m-ink outline-none focus:border-[color:var(--m-faint)]"
- >
- {trips.map(trip => <option key={trip.id} value={trip.id}>{trip.title}</option>)}
- </select>
- )
-
- const UserSelector = () => (
- <select
- value={selectedUserId ?? ''}
- onChange={e => setSelectedUserId(Number(e.target.value))}
- className="mb-2 h-[42px] w-full rounded-xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-3 text-[0.84375rem] text-m-ink outline-none focus:border-[color:var(--m-faint)]"
- >
- {users.map(u => <option key={u.id} value={u.id}>{u.username} ({u.email})</option>)}
- </select>
- )
-
return (
<div className="space-y-3">
{/* Dev header */}
@@ -128,7 +117,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
hint="Test how each in-app notification type renders, sent to yourself."
/>
<div className="mt-2 grid grid-cols-1 gap-2">
- <Btn id="simple-me" label="Simple → Me" sub="test_simple · user" icon={Bell} color="#6366f1"
+ <Btn sending={sending} id="simple-me" label="Simple → Me" sub="test_simple · user" icon={Bell} color="#6366f1"
onClick={() => fire('simple-me', {
event: 'test_simple',
scope: 'user',
@@ -136,7 +125,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
params: {},
})}
/>
- <Btn id="boolean-me" label="Boolean → Me" sub="test_boolean · user" icon={CheckCircle} color="#10b981"
+ <Btn sending={sending} id="boolean-me" label="Boolean → Me" sub="test_boolean · user" icon={CheckCircle} color="#10b981"
onClick={() => fire('boolean-me', {
event: 'test_boolean',
scope: 'user',
@@ -149,7 +138,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
},
})}
/>
- <Btn id="navigate-me" label="Navigate → Me" sub="test_navigate · user" icon={Navigation} color="#f59e0b"
+ <Btn sending={sending} id="navigate-me" label="Navigate → Me" sub="test_navigate · user" icon={Navigation} color="#f59e0b"
onClick={() => fire('navigate-me', {
event: 'test_navigate',
scope: 'user',
@@ -157,7 +146,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
params: {},
})}
/>
- <Btn id="simple-admins" label="Simple → All Admins" sub="test_simple · admin" icon={Zap} color="#ef4444"
+ <Btn sending={sending} id="simple-admins" label="Simple → All Admins" sub="test_simple · admin" icon={Zap} color="#ef4444"
onClick={() => fire('simple-admins', {
event: 'test_simple',
scope: 'admin',
@@ -176,9 +165,15 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
hint="Fires each trip event to all members of the selected trip (excluding yourself)."
/>
<div className="mt-2">
- <TripSelector />
+ <select
+ value={selectedTripId ?? ''}
+ onChange={e => setSelectedTripId(Number(e.target.value))}
+ className={SELECT_CLASS}
+ >
+ {trips.map(trip => <option key={trip.id} value={trip.id}>{trip.title}</option>)}
+ </select>
<div className="grid grid-cols-1 gap-2">
- <Btn id="booking_change" label="booking_change" sub="navigate · trip" icon={Calendar} color="#6366f1"
+ <Btn sending={sending} id="booking_change" label="booking_change" sub="navigate · trip" icon={Calendar} color="#6366f1"
onClick={() => selectedTripId && fire('booking_change', {
event: 'booking_change',
scope: 'trip',
@@ -186,7 +181,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
params: { actor: username, trip: tripTitle, booking: 'Test Hotel', type: 'hotel', tripId: String(selectedTripId) },
})}
/>
- <Btn id="trip_reminder" label="trip_reminder" sub="navigate · trip" icon={Clock} color="#10b981"
+ <Btn sending={sending} id="trip_reminder" label="trip_reminder" sub="navigate · trip" icon={Clock} color="#10b981"
onClick={() => selectedTripId && fire('trip_reminder', {
event: 'trip_reminder',
scope: 'trip',
@@ -194,7 +189,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
params: { trip: tripTitle, tripId: String(selectedTripId) },
})}
/>
- <Btn id="photos_shared" label="photos_shared" sub="navigate · trip" icon={Image} color="#f59e0b"
+ <Btn sending={sending} id="photos_shared" label="photos_shared" sub="navigate · trip" icon={Image} color="#f59e0b"
onClick={() => selectedTripId && fire('photos_shared', {
event: 'photos_shared',
scope: 'trip',
@@ -202,7 +197,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
params: { actor: username, trip: tripTitle, count: '5', tripId: String(selectedTripId) },
})}
/>
- <Btn id="collab_message" label="collab_message" sub="navigate · trip" icon={MessageSquare} color="#8b5cf6"
+ <Btn sending={sending} id="collab_message" label="collab_message" sub="navigate · trip" icon={MessageSquare} color="#8b5cf6"
onClick={() => selectedTripId && fire('collab_message', {
event: 'collab_message',
scope: 'trip',
@@ -210,7 +205,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
params: { actor: username, trip: tripTitle, preview: 'This is a test message preview.', tripId: String(selectedTripId) },
})}
/>
- <Btn id="packing_tagged" label="packing_tagged" sub="navigate · trip" icon={Tag} color="#ec4899"
+ <Btn sending={sending} id="packing_tagged" label="packing_tagged" sub="navigate · trip" icon={Tag} color="#ec4899"
onClick={() => selectedTripId && fire('packing_tagged', {
event: 'packing_tagged',
scope: 'trip',
@@ -231,9 +226,16 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
hint="Fires each user event to the selected recipient."
/>
<div className="mt-2">
- <UserSelector />
+ <select
+ value={selectedUserId ?? ''}
+ onChange={e => setSelectedUserId(Number(e.target.value))}
+ className={SELECT_CLASS}
+ >
+ {users.map(u => <option key={u.id} value={u.id}>{u.username} ({u.email})</option>)}
+ </select>
<div className="grid grid-cols-1 gap-2">
<Btn
+ sending={sending}
id={`trip_invite-${selectedUserId}`}
label="trip_invite"
sub="navigate · user"
@@ -247,6 +249,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
})}
/>
<Btn
+ sending={sending}
id={`vacay_invite-${selectedUserId}`}
label="vacay_invite"
sub="navigate · user"
@@ -271,7 +274,7 @@ export default function MAdminDevNotificationsPanel(): React.ReactElement {
hint="Fires to all admin users."
/>
<div className="mt-2 grid grid-cols-1 gap-2">
- <Btn id="version_available" label="version_available" sub="navigate · admin" icon={Download} color="#64748b"
+ <Btn sending={sending} id="version_available" label="version_available" sub="navigate · admin" icon={Download} color="#64748b"
onClick={() => fire('version_available', {
event: 'version_available',
scope: 'admin',
diff --git a/client/src/mobile/screens/admin/MAdminGitHubPanel.tsx b/client/src/mobile/screens/admin/MAdminGitHubPanel.tsx
index 1b03a6ee4..034c0565d 100644
--- a/client/src/mobile/screens/admin/MAdminGitHubPanel.tsx
+++ b/client/src/mobile/screens/admin/MAdminGitHubPanel.tsx
@@ -6,6 +6,7 @@ import { MAdminButton, MAdminCard } from './MAdminUi'
const REPO = 'mauriceboe/TREK'
const PER_PAGE = 10
+const MAX_PAGES_PER_LOAD = 5
interface GithubRelease {
id: number
@@ -39,27 +40,49 @@ export default function MAdminGitHubPanel({ isPrerelease = false }: { isPrerelea
const [hasMore, setHasMore] = useState(true)
const [loadingMore, setLoadingMore] = useState(false)
- const fetchReleases = async (pageNum = 1, append = false) => {
+ const isShown = (release: GithubRelease) => isPrerelease || !release.prerelease
+
+ const fetchPage = async (pageNum: number) => {
try {
const res = await apiClient.get(`/admin/github-releases`, { params: { per_page: PER_PAGE, page: pageNum } })
- const data = Array.isArray(res.data) ? res.data : []
- setReleases(prev => append ? [...prev, ...data] : data)
- setHasMore(data.length === PER_PAGE)
+ return Array.isArray(res.data) ? res.data as GithubRelease[] : []
} catch (err: unknown) {
setError(err instanceof Error ? err.message : 'Unknown error')
+ return null
}
}
+ // Keep pulling pages until at least one release survives the prerelease filter,
+ // otherwise a page of nothing but prereleases leaves an empty timeline behind a
+ // "Load more" button. MAX_PAGES_PER_LOAD bounds the walk.
+ const loadFrom = async (startPage: number, append: boolean) => {
+ const collected: GithubRelease[] = []
+ let pageNum = startPage
+ let more = true
+
+ for (let i = 0; i < MAX_PAGES_PER_LOAD; i++) {
+ const data = await fetchPage(pageNum)
+ if (!data) return
+ collected.push(...data)
+ more = data.length === PER_PAGE
+ if (!more || collected.some(isShown)) break
+ pageNum += 1
+ }
+
+ setReleases(prev => append ? [...prev, ...collected] : collected)
+ setHasMore(more)
+ setPage(pageNum)
+ setError(null)
+ }
+
useEffect(() => {
setLoading(true)
- fetchReleases(1).finally(() => setLoading(false))
+ loadFrom(1, false).finally(() => setLoading(false))
}, [])
const handleLoadMore = async () => {
- const next = page + 1
setLoadingMore(true)
- await fetchReleases(next, true)
- setPage(next)
+ await loadFrom(page + 1, true)
setLoadingMore(false)
}
@@ -152,7 +175,7 @@ export default function MAdminGitHubPanel({ isPrerelease = false }: { isPrerelea
{ href: 'https://github.com/mauriceboe/TREK/wiki', color: '#6366f1', icon: <BookOpen size={18} className="text-[#6366f1]" />, title: 'Wiki', sub: t('settings.about.wikiHint') },
]
- const shownReleases = isPrerelease ? releases : releases.filter(r => !r.prerelease)
+ const shownReleases = releases.filter(isShown)
return (
<div className="space-y-3">
@@ -188,7 +211,7 @@ export default function MAdminGitHubPanel({ isPrerelease = false }: { isPrerelea
<Loader2 className="h-6 w-6 animate-spin text-m-muted" />
</div>
</MAdminCard>
- ) : error ? (
+ ) : error && releases.length === 0 ? (
<MAdminCard>
<div className="py-4 text-center">
<p className="text-[0.8125rem] text-m-muted">{t('admin.github.error')}</p>
@@ -301,6 +324,13 @@ export default function MAdminGitHubPanel({ isPrerelease = false }: { isPrerelea
</div>
</div>
+ {/* A failed "Load more" keeps the timeline and stays retryable */}
+ {error && (
+ <p className="pb-1 text-center font-geist text-[0.625rem] text-m-faint">
+ {t('admin.github.error')} — {error}
+ </p>
+ )}
+
{/* Load more */}
{hasMore && (
<div className="pt-1 text-center">
diff --git a/client/src/mobile/screens/admin/MAdminMcpTokensPanel.tsx b/client/src/mobile/screens/admin/MAdminMcpTokensPanel.tsx
index 0c35dca5b..f08873d5f 100644
--- a/client/src/mobile/screens/admin/MAdminMcpTokensPanel.tsx
+++ b/client/src/mobile/screens/admin/MAdminMcpTokensPanel.tsx
@@ -1,4 +1,4 @@
-import { useState, useEffect } from 'react'
+import { useState, useEffect, useRef } from 'react'
import { Key, Trash2, User, Loader2, Shield } from 'lucide-react'
import { adminApi } from '../../../api/client'
import { useToast } from '../../../components/shared/Toast'
@@ -52,15 +52,20 @@ export default function MAdminMcpTokensPanel() {
const toast = useToast()
const { t, locale } = useTranslation()
+ // The loader runs once, but a language switch while the requests are in flight
+ // must still toast in the current locale — hence the ref instead of the closure.
+ const latest = useRef({ t, toast })
+ latest.current = { t, toast }
+
useEffect(() => {
adminApi.oauthSessions()
.then(d => setSessions(d.sessions || []))
- .catch(() => toast.error(t('admin.oauthSessions.loadError')))
+ .catch(() => latest.current.toast.error(latest.current.t('admin.oauthSessions.loadError')))
.finally(() => setSessionsLoading(false))
adminApi.mcpTokens()
.then(d => setTokens(d.tokens || []))
- .catch(() => toast.error(t('admin.mcpTokens.loadError')))
+ .catch(() => latest.current.toast.error(latest.current.t('admin.mcpTokens.loadError')))
.finally(() => setTokensLoading(false))
}, [])
diff --git a/client/src/mobile/screens/admin/MAdminNotificationsSection.tsx b/client/src/mobile/screens/admin/MAdminNotificationsSection.tsx
index 6abc10eba..9655bde49 100644
--- a/client/src/mobile/screens/admin/MAdminNotificationsSection.tsx
+++ b/client/src/mobile/screens/admin/MAdminNotificationsSection.tsx
@@ -119,7 +119,6 @@ export default function MAdminNotificationsSection({ admin, t }: MAdminNotificat
const testAdminWebhook = async () => {
const url = smtpValues.admin_webhook_url === '••••••••' ? undefined : smtpValues.admin_webhook_url
- if (!url && smtpValues.admin_webhook_url !== '••••••••') return
try {
if (url) await authApi.updateAppSettings({ admin_webhook_url: url }).catch(() => {})
const result = await notificationsApi.testWebhook(url)
diff --git a/client/src/mobile/screens/admin/MAdminNotifyMatrix.tsx b/client/src/mobile/screens/admin/MAdminNotifyMatrix.tsx
index 88cd93df5..091556361 100644
--- a/client/src/mobile/screens/admin/MAdminNotifyMatrix.tsx
+++ b/client/src/mobile/screens/admin/MAdminNotifyMatrix.tsx
@@ -77,16 +77,18 @@ export default function MAdminNotifyMatrix({ t, toast }: { t: TranslationFn; toa
key={ch}
className="w-[44px] flex-none text-center font-geist text-[0.5625rem] font-bold uppercase tracking-[0.04em] text-m-faint"
>
- {t(ADMIN_CHANNEL_LABEL_KEYS[ch]) || ch}
+ {t(ADMIN_CHANNEL_LABEL_KEYS[ch])}
</span>
))}
</div>
{matrix.event_types.map((eventType) => {
const implemented = matrix.implemented_combos[eventType] ?? []
+ // Only version_available has a label key so far; anything else keeps its raw id.
+ const labelKey = ADMIN_EVENT_LABEL_KEYS[eventType]
return (
<div key={eventType} className="flex items-center gap-1 border-b border-[color:var(--m-rowbr)] py-2">
<span className="min-w-0 flex-1 truncate text-[0.8125rem] text-m-ink">
- {t(ADMIN_EVENT_LABEL_KEYS[eventType]) || eventType}
+ {labelKey ? t(labelKey) : eventType}
</span>
{visibleChannels.map((ch) => (
<span key={ch} className="flex w-[44px] flex-none justify-center">
diff --git a/client/src/mobile/screens/admin/MAdminPackingTemplateManager.tsx b/client/src/mobile/screens/admin/MAdminPackingTemplateManager.tsx
index e33c59374..6b352827c 100644
--- a/client/src/mobile/screens/admin/MAdminPackingTemplateManager.tsx
+++ b/client/src/mobile/screens/admin/MAdminPackingTemplateManager.tsx
@@ -162,7 +162,7 @@ export default function MAdminPackingTemplateManager() {
await adminApi.deleteTemplateCategory(expandedId, catId)
setCategories(prev => prev.filter(c => c.id !== catId))
setItems(prev => prev.filter(i => i.category_id !== catId))
- } catch { toast.error(t('admin.packingTemplates.deleteError')) }
+ } catch { toast.error(t('admin.toast.deleteError')) }
}
// Item CRUD
@@ -190,7 +190,7 @@ export default function MAdminPackingTemplateManager() {
try {
await adminApi.deleteTemplateItem(expandedId, itemId)
setItems(prev => prev.filter(i => i.id !== itemId))
- } catch { toast.error(t('admin.packingTemplates.deleteError')) }
+ } catch { toast.error(t('admin.toast.deleteError')) }
}
return (
diff --git a/client/src/mobile/screens/admin/MAdminPluginsPanel.tsx b/client/src/mobile/screens/admin/MAdminPluginsPanel.tsx
index cac92beb1..bee362cb0 100644
--- a/client/src/mobile/screens/admin/MAdminPluginsPanel.tsx
+++ b/client/src/mobile/screens/admin/MAdminPluginsPanel.tsx
@@ -107,6 +107,8 @@ interface RegistryDetail extends RegistryItem {
icon: string | null
requiredAddons?: string[]
pluginDependencies?: PluginDep[]
+ /** Display slice of the manifest's capabilities — drives the same chips as an installed row. */
+ capabilities?: { widget?: { slot?: string }; tripPage?: { replaces?: string[] } }
} | null
}
@@ -309,13 +311,8 @@ const CHIP_PENDING = 'text-[color:var(--m-st-pending)] border-[color:color-mix(i
const PENDING_CARD = 'border-[color:color-mix(in_srgb,var(--m-st-pending)_28%,transparent)] bg-[color:color-mix(in_srgb,var(--m-st-pending)_10%,transparent)]'
const ACT_PILL = 'inline-flex flex-none items-center justify-center gap-[5px] whitespace-nowrap rounded-full px-3 py-[7px] text-[0.6875rem] font-bold bg-m-act text-m-actfg disabled:opacity-50'
-function ReviewedBadge({ t, compact }: { t: T; compact?: boolean }) {
- if (compact) return <ShieldCheck size={13} className="shrink-0 text-[color:var(--m-st-confirmed)]" aria-label={t('admin.plugins.reviewed')} />
- return (
- <span className="inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-semibold text-[color:var(--m-st-confirmed)] bg-[color:color-mix(in_srgb,var(--m-st-confirmed)_14%,transparent)]">
- <ShieldCheck size={11} /> {t('admin.plugins.reviewed')}
- </span>
- )
+function ReviewedBadge({ t }: { t: T }) {
+ return <ShieldCheck size={13} className="shrink-0 text-[color:var(--m-st-confirmed)]" aria-label={t('admin.plugins.reviewed')} />
}
/** Marks a manually-uploaded (sideloaded) plugin: no registry, unsigned, not reviewed. */
@@ -533,7 +530,12 @@ export default function MAdminPluginsPanel() {
if (!runtimeOn || !Array.from(e.dataTransfer.types).includes('Files')) return
e.preventDefault(); dragDepth.current++; setDragActive(true)
}
- const onDragLeave = () => { if (--dragDepth.current <= 0) { dragDepth.current = 0; setDragActive(false) } }
+ // Mirrors onDragEnter: a leave that had no matching enter (a non-file drag) is ignored
+ // instead of driving the depth counter negative.
+ const onDragLeave = () => {
+ if (dragDepth.current === 0) return
+ if (--dragDepth.current === 0) setDragActive(false)
+ }
const onDrop = (e: DragEvent) => {
e.preventDefault(); dragDepth.current = 0; setDragActive(false)
if (!runtimeOn) return
@@ -1146,7 +1148,7 @@ function InstalledRow({ p, t, busy, hasUpdate, latestVer, blocked, onToggle, onU
<div className="flex flex-wrap items-center gap-2">
<span className="text-[0.90625rem] font-bold tracking-[-.006em] text-m-ink">{p.name}</span>
{p.version && <span className="text-[11.5px] font-medium tabular-nums text-m-faint">v{p.version}</span>}
- {p.reviewed_at && <ReviewedBadge t={t} compact />}
+ {p.reviewed_at && <ReviewedBadge t={t} />}
{p.source_repo === 'local:upload' && <SideloadedBadge t={t} />}
{p.source_repo === 'local:link' && <DevLinkBadge t={t} />}
{/* Registry plugins only — a sideloaded/dev-linked plugin already says something
@@ -1395,7 +1397,7 @@ function PluginDetailSheet({ item, installed, busy, onInstall, onClose, t, local
}, [item.id])
const manifest = detail?.manifest ?? null
- const caps = manifest ? deriveCaps(manifest.permissions, {}, t) : []
+ const caps = manifest ? deriveCaps(manifest.permissions, manifest.capabilities ?? {}, t) : []
const repoUrl = `https://github.com/${item.repo}`
const homepage = item.homepage && /^https?:\/\//i.test(item.homepage) && item.homepage !== repoUrl ? item.homepage : null
const sizeKb = detail?.size ? Math.max(1, Math.round(detail.size / 1024)) : null
@@ -1421,7 +1423,7 @@ function PluginDetailSheet({ item, installed, busy, onInstall, onClose, t, local
<div className="min-w-0 flex-1 pt-8">
<div className="flex flex-wrap items-center gap-2">
<h3 className="text-lg font-bold tracking-tight text-m-ink">{item.name}</h3>
- {item.reviewedAt && <ReviewedBadge t={t} compact />}
+ {item.reviewedAt && <ReviewedBadge t={t} />}
</div>
<p className="mt-0.5 text-[12.5px] text-m-faint">{item.author}{item.latest ? ` · v${item.latest}` : ''}</p>
</div>
diff --git a/client/src/mobile/screens/admin/MAdminSheets.tsx b/client/src/mobile/screens/admin/MAdminSheets.tsx
index 8bb1bfbd4..e3e743d6d 100644
--- a/client/src/mobile/screens/admin/MAdminSheets.tsx
+++ b/client/src/mobile/screens/admin/MAdminSheets.tsx
@@ -210,7 +210,7 @@ export default function MAdminSheets({ admin, t }: MAdminSheetsProps) {
</p>
{updateInfo?.is_docker === false ? (
<a
- href="https://github.com/mauriceboe/TREK/wiki/Updating"
+ href="https://github.com/liketrek/TREK/wiki/Updating"
target="_blank"
rel="noopener noreferrer"
className="flex items-center gap-2 rounded-xl bg-[color:var(--m-ic)] px-3 py-3 text-[0.8125rem] font-bold text-m-ink underline"
diff --git a/client/src/mobile/screens/atlas/MAtlasCountryPopup.tsx b/client/src/mobile/screens/atlas/MAtlasCountryPopup.tsx
index fb7940dc1..26a491b5b 100644
--- a/client/src/mobile/screens/atlas/MAtlasCountryPopup.tsx
+++ b/client/src/mobile/screens/atlas/MAtlasCountryPopup.tsx
@@ -5,7 +5,6 @@ import apiClient from '../../../api/client'
import { continentForCountry } from '@trek/shared'
import { getApiErrorMessage } from '../../../types'
import { useToast } from '../../../components/shared/Toast'
-import { countryCodeToFlag } from '../../../pages/atlas/atlasModel'
import MSheet from '../../components/MSheet'
import type { AtlasController } from './atlasController'
@@ -134,12 +133,15 @@ export default function MAtlasCountryPopup({ atlas }: MAtlasCountryPopupProps) {
if (remaining.length === 0) delete next[countryCode]
return next
})
- // Drop the country too once no manually-marked region and no trip/place keeps it.
+ // Drop the country too once no visible region is left — how a region was
+ // derived does not matter, the server hides it either way. Countries with
+ // real place/trip data are never hidden server-side (#1490), so removing
+ // them here would only flash and reappear on the next load.
setData((prev) => {
if (!prev) return prev
const c = prev.countries.find((c) => c.code === countryCode)
if (!c || c.placeCount > 0 || c.tripCount > 0) return prev
- const remainingRegions = (visitedRegions[countryCode] || []).filter((r) => r.code !== regionCode && r.manuallyMarked)
+ const remainingRegions = (visitedRegions[countryCode] || []).filter((r) => r.code !== regionCode)
if (remainingRegions.length > 0) return prev
const cont = continentForCountry(countryCode)
return {
@@ -184,7 +186,10 @@ export default function MAtlasCountryPopup({ atlas }: MAtlasCountryPopupProps) {
className="h-[34px] w-12 rounded-[6px] object-cover shadow-[0_1px_3px_rgba(0,0,0,.25)]"
/>
) : (
- <span className="text-[2.25rem] leading-none">{countryCodeToFlag(a.code)}</span>
+ // flagcdn only serves alpha-2, so anything else gets a neutral placeholder.
+ <span className="flex h-[34px] w-12 items-center justify-center rounded-[6px] bg-[color:var(--m-ic)] text-m-faint">
+ <MapPin size={18} strokeWidth={2} />
+ </span>
)}
<div className="mt-3 text-[1.0625rem] font-extrabold text-m-ink">{a.name}</div>
{a.countryName && (a.type === 'choose-region' || a.type === 'unmark-region') && (
diff --git a/client/src/mobile/screens/collections/MCollAddSheet.tsx b/client/src/mobile/screens/collections/MCollAddSheet.tsx
index 88168383d..a571c2b40 100644
--- a/client/src/mobile/screens/collections/MCollAddSheet.tsx
+++ b/client/src/mobile/screens/collections/MCollAddSheet.tsx
@@ -6,7 +6,7 @@ import { mapsApi } from '../../../api/client'
import { collectionsApi } from '../../../api/collections'
import { useTranslation } from '../../../i18n'
import { useToast } from '../../../components/shared/Toast'
-import { getApiErrorMessage } from '../../../types'
+import { getApiErrorMessage } from '../../../utils/apiError'
import { STATUS_ORDER } from '../../../pages/collections/collectionsModel'
import MSheet from '../../components/MSheet'
import MCollCategoryPicker from './MCollCategoryPicker'
@@ -51,14 +51,18 @@ export default function MCollAddSheet({ open, collectionId, collectionName, list
useEffect(() => {
if (open) return
setQuery(''); setResults([]); setPicked(null); setName(''); setCategoryId(null); setStatus('idea'); setDescription('')
+ setTargetId(null)
}, [open])
// Opened from a specific list → target is fixed; from "All Saved" (no active
// list) → default to the sole list if there is one, else pick it in-sheet.
+ // The lists may still be loading when the sheet opens, so the default is
+ // applied again once they arrive — without overruling a pick already made.
useEffect(() => {
- if (open) setTargetId(collectionId ?? (lists.length === 1 ? lists[0].id : null))
- // eslint-disable-next-line react-hooks/exhaustive-deps
- }, [open, collectionId])
+ if (!open) return
+ if (collectionId != null) { setTargetId(collectionId); return }
+ setTargetId(prev => (prev != null && lists.some(l => l.id === prev) ? prev : (lists.length === 1 ? lists[0].id : null)))
+ }, [open, collectionId, lists])
const search = async () => {
if (!query.trim() || searching) return
diff --git a/client/src/mobile/screens/collections/MCollEditSheet.tsx b/client/src/mobile/screens/collections/MCollEditSheet.tsx
index aac236e13..3105c297c 100644
--- a/client/src/mobile/screens/collections/MCollEditSheet.tsx
+++ b/client/src/mobile/screens/collections/MCollEditSheet.tsx
@@ -5,7 +5,7 @@ import type { TranslationFn } from '../../../types'
import { tripsApi } from '../../../api/client'
import { useCollectionStore } from '../../../store/collectionStore'
import { useToast } from '../../../components/shared/Toast'
-import { getApiErrorMessage } from '../../../types'
+import { getApiErrorMessage } from '../../../utils/apiError'
import { normalizeLinkUrl } from '../../../pages/collections/collectionsModel'
import MSheet from '../../components/MSheet'
import MCollLinksEditor from './MCollLinksEditor'
@@ -91,6 +91,13 @@ export default function MCollEditSheet({ target, onClose, onCreated, onRequestDe
useEffect(() => () => dropObjectUrl(), [])
+ // A create that only failed at the cover step already produced the list —
+ // hand it over on the way out instead of leaving it behind unnoticed.
+ const close = () => {
+ if (createdId != null) onCreated(createdId)
+ onClose()
+ }
+
const pickCover = (file: File | undefined) => {
if (!file) return
dropObjectUrl()
@@ -164,13 +171,13 @@ export default function MCollEditSheet({ target, onClose, onCreated, onRequestDe
return (
<MSheet
open={target != null}
- onClose={onClose}
+ onClose={close}
material="opaque"
ariaLabel={editing ? t('collections.editListTitle') : t('collections.newList')}
>
<SheetHeader
title={editing ? t('collections.editListTitle') : t('collections.newList')}
- onClose={onClose}
+ onClose={close}
closeLabel={t('common.close')}
/>
<div className="min-h-0 flex-1 overflow-y-auto px-[18px] py-[14px]">
@@ -271,7 +278,7 @@ export default function MCollEditSheet({ target, onClose, onCreated, onRequestDe
<Trash2 size={13} strokeWidth={2} /> {t('collections.deleteList')}
</button>
)}
- <CancelPill className="ml-auto" onClick={onClose}>{t('common.cancel')}</CancelPill>
+ <CancelPill className="ml-auto" onClick={close}>{t('common.cancel')}</CancelPill>
<PrimaryPill onClick={save} disabled={!name.trim() || saving}>
{saving && <Loader2 size={14} className="animate-spin" />}
{editing ? t('common.save') : t('collections.create')}
diff --git a/client/src/mobile/screens/collections/MCollLabelsSheet.tsx b/client/src/mobile/screens/collections/MCollLabelsSheet.tsx
index 8032237e5..ecb94e73c 100644
--- a/client/src/mobile/screens/collections/MCollLabelsSheet.tsx
+++ b/client/src/mobile/screens/collections/MCollLabelsSheet.tsx
@@ -66,6 +66,16 @@ export default function MCollLabelsSheet({
}
}
+ const remove = async (labelId: number) => {
+ if (busy) return
+ setBusy(true)
+ try {
+ await onDelete(labelId)
+ } finally {
+ setBusy(false)
+ }
+ }
+
const assign = async () => {
if (checked.length === 0 || busy) return
setBusy(true)
@@ -160,9 +170,10 @@ export default function MCollLabelsSheet({
</button>
<button
type="button"
- onClick={() => onDelete(label.id)}
+ onClick={() => remove(label.id)}
+ disabled={busy}
aria-label={t('common.delete')}
- className="flex h-7 w-7 flex-none items-center justify-center rounded-full text-[color:var(--m-st-danger)] active:bg-[color:var(--m-ic)]"
+ className="flex h-7 w-7 flex-none items-center justify-center rounded-full text-[color:var(--m-st-danger)] active:bg-[color:var(--m-ic)] disabled:opacity-40"
>
<Trash2 size={13} strokeWidth={2.2} />
</button>
diff --git a/client/src/mobile/screens/collections/MCollListPickerSheet.tsx b/client/src/mobile/screens/collections/MCollListPickerSheet.tsx
index b006818fa..671025803 100644
--- a/client/src/mobile/screens/collections/MCollListPickerSheet.tsx
+++ b/client/src/mobile/screens/collections/MCollListPickerSheet.tsx
@@ -32,6 +32,8 @@ export default function MCollListPickerSheet({ mode, lists, count, onPick, onClo
setBusyId(id)
try {
await onPick(id)
+ } catch {
+ // The caller reports its own failures; the sheet only releases the row.
} finally {
setBusyId(null)
}
diff --git a/client/src/mobile/screens/collections/MCollListsDrawer.tsx b/client/src/mobile/screens/collections/MCollListsDrawer.tsx
deleted file mode 100644
index 23a10c383..000000000
--- a/client/src/mobile/screens/collections/MCollListsDrawer.tsx
+++ /dev/null
@@ -1,125 +0,0 @@
-import { Check, Layers, Plus, X } from 'lucide-react'
-import type { Collection } from '@trek/shared'
-import type { TranslationFn } from '../../../types'
-import type { ActiveCollectionId } from '../../../store/collectionStore'
-import type { IncomingCollectionInvite } from '../../../store/collectionStore'
-import { ALL_SAVED } from '../../../store/collectionStore'
-import MSheet from '../../components/MSheet'
-import { Eyebrow } from './MCollSheetKit'
-
-interface MCollListsDrawerProps {
- open: boolean
- onClose: () => void
- ownedLists: Collection[]
- sharedLists: Collection[]
- activeId: ActiveCollectionId
- incomingInvites: IncomingCollectionInvite[]
- onSelect: (id: ActiveCollectionId) => void
- onNewList: () => void
- onAcceptInvite: (collectionId: number) => void
- onDeclineInvite: (collectionId: number) => void
- t: TranslationFn
-}
-
-function ListRow({ list, active, onClick }: { list: Collection; active: boolean; onClick: () => void }) {
- return (
- <button
- type="button"
- onClick={onClick}
- className={`mb-1 flex w-full items-center gap-[10px] rounded-[13px] px-3 py-[11px] text-left ${active ? 'bg-[color:var(--m-ic)]' : ''}`}
- style={active ? { boxShadow: `inset 0 0 0 1.5px ${list.color || '#6366F1'}` } : undefined}
- >
- <span className="h-[9px] w-[9px] flex-none rounded-full" style={{ background: list.color || '#6366F1' }} />
- <span className="min-w-0 flex-1 truncate text-[0.84375rem] font-semibold text-m-ink">{list.name}</span>
- <span className="font-geist text-[0.6875rem] font-bold text-m-faint">{list.place_count ?? 0}</span>
- </button>
- )
-}
-
-/**
- * The left lists drawer: new list, the "All saved" union, the owned and shared
- * lists, and — when present — incoming share invites with accept/decline.
- */
-export default function MCollListsDrawer({
- open, onClose, ownedLists, sharedLists, activeId, incomingInvites,
- onSelect, onNewList, onAcceptInvite, onDeclineInvite, t,
-}: MCollListsDrawerProps) {
- return (
- <MSheet open={open} onClose={onClose} variant="drawer" material="opaque" ariaLabel={t('collections.title')}>
- <div className="flex h-full min-h-0 flex-col px-[18px] py-5">
- <div className="flex flex-none justify-end">
- <button
- type="button"
- onClick={onClose}
- aria-label={t('common.close')}
- className="flex h-8 w-8 items-center justify-center rounded-full bg-[color:var(--m-ic)] text-m-ink"
- >
- <X size={15} strokeWidth={2.2} />
- </button>
- </div>
- <button
- type="button"
- onClick={onNewList}
- className="mt-[6px] flex flex-none items-center gap-2 rounded-[14px] border border-dashed border-[color:var(--m-rowbr)] px-[14px] py-3 text-[0.8125rem] font-bold text-m-muted"
- >
- <Plus size={15} strokeWidth={2.2} /> {t('collections.newList')}
- </button>
- <button
- type="button"
- onClick={() => onSelect(ALL_SAVED)}
- className={`mt-[10px] flex flex-none items-center gap-[9px] rounded-[11px] px-[6px] py-[10px] text-[0.84375rem] font-semibold text-m-ink ${activeId === ALL_SAVED ? 'bg-[color:var(--m-ic)]' : ''}`}
- >
- <Layers size={16} strokeWidth={2} /> {t('collections.allSaved')}
- </button>
- <div className="my-2 h-px flex-none bg-[color:var(--m-rowbr)]" />
- <div className="min-h-0 flex-1 overflow-y-auto">
- {ownedLists.map(l => (
- <ListRow key={l.id} list={l} active={activeId === l.id} onClick={() => onSelect(l.id)} />
- ))}
- {sharedLists.length > 0 && (
- <>
- <Eyebrow className="mb-[6px] mt-3 px-1 uppercase">{t('collections.shared')}</Eyebrow>
- {sharedLists.map(l => (
- <ListRow key={l.id} list={l} active={activeId === l.id} onClick={() => onSelect(l.id)} />
- ))}
- </>
- )}
- {incomingInvites.length > 0 && (
- <>
- <Eyebrow className="mb-[6px] mt-3 px-1 uppercase">{t('collections.invites.title')}</Eyebrow>
- {incomingInvites.map(inv => (
- <div
- key={inv.collection_id}
- className="mb-1 flex items-center gap-[10px] rounded-[13px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-sheet)] px-3 py-[10px]"
- >
- <span className="min-w-0 flex-1">
- <span className="block truncate text-[0.8125rem] font-semibold text-m-ink">{inv.name}</span>
- <span className="block truncate font-geist text-[0.625rem] text-m-muted">
- {t('collections.invites.from')} {inv.from.username}
- </span>
- </span>
- <button
- type="button"
- onClick={() => onAcceptInvite(inv.collection_id)}
- aria-label={t('collections.invites.accept')}
- className="flex h-7 w-7 flex-none items-center justify-center rounded-full bg-m-act text-m-actfg"
- >
- <Check size={13} strokeWidth={2.6} />
- </button>
- <button
- type="button"
- onClick={() => onDeclineInvite(inv.collection_id)}
- aria-label={t('collections.invites.decline')}
- className="flex h-7 w-7 flex-none items-center justify-center rounded-full bg-[color:var(--m-ic)] text-m-ink"
- >
- <X size={13} strokeWidth={2.4} />
- </button>
- </div>
- ))}
- </>
- )}
- </div>
- </div>
- </MSheet>
- )
-}
diff --git a/client/src/mobile/screens/collections/MCollPlaceSheet.tsx b/client/src/mobile/screens/collections/MCollPlaceSheet.tsx
index 9533d7708..bc71b10e3 100644
--- a/client/src/mobile/screens/collections/MCollPlaceSheet.tsx
+++ b/client/src/mobile/screens/collections/MCollPlaceSheet.tsx
@@ -8,7 +8,7 @@ import type { Category, TranslationFn } from '../../../types'
import { mapsApi } from '../../../api/client'
import { useToast } from '../../../components/shared/Toast'
import { normalizeImageFile } from '../../../utils/convertHeic'
-import { getApiErrorMessage } from '../../../types'
+import { getApiErrorMessage } from '../../../utils/apiError'
import { normalizeLinkUrl, STATUS_ORDER } from '../../../pages/collections/collectionsModel'
import MSheet from '../../components/MSheet'
import PlaceRating from '../../../components/shared/StarRating'
diff --git a/client/src/mobile/screens/dashboard/MDashboard.tsx b/client/src/mobile/screens/dashboard/MDashboard.tsx
index b80fecd6e..829eab7bd 100644
--- a/client/src/mobile/screens/dashboard/MDashboard.tsx
+++ b/client/src/mobile/screens/dashboard/MDashboard.tsx
@@ -58,7 +58,7 @@ export default function MDashboard(): React.ReactElement {
spotlight, upcoming, gridTrips, isLoading, loadError, retryLoad,
tripFilter, setTripFilter, viewMode, toggleViewMode,
showForm, setShowForm, editingTrip, setEditingTrip,
- deleteTrip, setDeleteTrip, copyTrip, setCopyTrip, setTrips,
+ deleteTrip, setDeleteTrip, copyTrip, setCopyTrip, applyCoverUpdate,
handleCreate, handleUpdate, confirmDelete, handleArchive, handleUnarchive, confirmCopy,
} = useDashboard()
@@ -287,7 +287,7 @@ export default function MDashboard(): React.ReactElement {
trip={editingTrip}
onClose={() => { setShowForm(false); setEditingTrip(null) }}
onSave={editingTrip ? handleUpdate : handleCreate}
- onCoverUpdate={(tripId, coverUrl) => setTrips(prev => prev.map(tr => tr.id === tripId ? { ...tr, cover_image: coverUrl } : tr))}
+ onCoverUpdate={applyCoverUpdate}
onArchive={editingTrip
? () => (editingTrip.is_archived ? handleUnarchive(editingTrip.id) : handleArchive(editingTrip.id))
: undefined}
diff --git a/client/src/mobile/screens/dashboard/MNewTripSheet.tsx b/client/src/mobile/screens/dashboard/MNewTripSheet.tsx
index 6908d7c9a..f1c297a64 100644
--- a/client/src/mobile/screens/dashboard/MNewTripSheet.tsx
+++ b/client/src/mobile/screens/dashboard/MNewTripSheet.tsx
@@ -215,11 +215,12 @@ export default function MNewTripSheet({ open, trip, onClose, onSave, onCoverUpda
setCoverPreview(null)
return
}
- if (!trip?.id) return
+ // Anything else is a cover stored on the trip, so this is the edit sheet.
+ const id = trip!.id
try {
- await tripsApi.update(trip.id, { cover_image: null })
+ await tripsApi.update(id, { cover_image: null })
setCoverPreview(null)
- onCoverUpdate?.(trip.id, null)
+ onCoverUpdate?.(id, null)
} catch {
toast.error(t('dashboard.coverRemoveError'))
}
diff --git a/client/src/mobile/screens/journey/MJourneyDetail.tsx b/client/src/mobile/screens/journey/MJourneyDetail.tsx
index 1998b289d..d280967c6 100644
--- a/client/src/mobile/screens/journey/MJourneyDetail.tsx
+++ b/client/src/mobile/screens/journey/MJourneyDetail.tsx
@@ -1,4 +1,4 @@
-import { useCallback, useEffect, useRef, useState } from 'react'
+import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { ChevronLeft, MapPin, Grid3x3, Upload, MoreHorizontal, Play, Image, Camera } from 'lucide-react'
import JourneyMap from '../../../components/Journey/JourneyMapAuto'
import type { JourneyMapAutoHandle } from '../../../components/Journey/JourneyMapAuto'
@@ -47,7 +47,12 @@ export default function MJourneyDetail() {
const cardRefs = useRef<Map<number, HTMLDivElement>>(new Map())
const [activeIndex, setActiveIndex] = useState(0)
- const entries = (current?.entries || []).filter(e => !hideSkeletons || e.type !== 'skeleton')
+ // Stable identity: the scroll effect below re-attaches on every change and
+ // would otherwise drop the pending settle timer on any unrelated render.
+ const entries = useMemo(
+ () => (current?.entries || []).filter(e => !hideSkeletons || e.type !== 'skeleton'),
+ [current?.entries, hideSkeletons],
+ )
const syncMapToCard = useCallback((index: number) => {
const entry = entries[index]
diff --git a/client/src/mobile/screens/settings/MPhotoProvidersSection.tsx b/client/src/mobile/screens/settings/MPhotoProvidersSection.tsx
index 3c78fd416..a494e733c 100644
--- a/client/src/mobile/screens/settings/MPhotoProvidersSection.tsx
+++ b/client/src/mobile/screens/settings/MPhotoProvidersSection.tsx
@@ -149,7 +149,9 @@ export default function MPhotoProvidersSection(): React.ReactElement {
...prev,
[provider.id]: { ...(prev[provider.id] || {}), ...nextValues },
}))
- if (typeof res.data?.connected === 'boolean') {
+ // The status route owns the badge when there is one — otherwise the two
+ // responses would race and the later one would win.
+ if (!cfg.status_get && typeof res.data?.connected === 'boolean') {
setProviderConnected(prev => ({ ...prev, [provider.id]: !!res.data.connected }))
}
}).catch(() => { })
@@ -206,7 +208,8 @@ export default function MPhotoProvidersSection(): React.ReactElement {
if (ok) {
toast.success(t('memories.connectionSuccess', { provider_name: provider.name }))
} else {
- toast.error(`${t('memories.connectionError', { provider_name: provider.name })} ${res.data?.error ? `: ${String(res.data.error)}` : ''}`)
+ const detail = res.data?.error ? `: ${String(res.data.error)}` : ''
+ toast.error(`${t('memories.connectionError', { provider_name: provider.name })}${detail}`)
}
} catch {
toast.error(t('memories.connectionError', { provider_name: provider.name }))
diff --git a/client/src/mobile/screens/settings/MSettingsAccount.tsx b/client/src/mobile/screens/settings/MSettingsAccount.tsx
index 654dd7caf..2b14ed887 100644
--- a/client/src/mobile/screens/settings/MSettingsAccount.tsx
+++ b/client/src/mobile/screens/settings/MSettingsAccount.tsx
@@ -113,7 +113,6 @@ export default function MSettingsAccount() {
}
const copyBackupCodes = async () => {
- if (!backupCodesText) return
try {
await navigator.clipboard.writeText(backupCodesText)
toast.success(t('settings.mfa.backupCopied'))
@@ -123,7 +122,6 @@ export default function MSettingsAccount() {
}
const downloadBackupCodes = () => {
- if (!backupCodesText) return
const blob = new Blob([backupCodesText + '\n'], { type: 'text/plain;charset=utf-8' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
@@ -136,7 +134,6 @@ export default function MSettingsAccount() {
}
const printBackupCodes = () => {
- if (!backupCodesText) return
const html = `<!doctype html><html><head><meta charset="utf-8"/><title>TREK MFA Backup Codes</title>
<style>body{font-family:Arial,sans-serif;padding:32px}h1{font-size:20px}pre{font-size:16px;line-height:1.6}</style>
</head><body><h1>TREK MFA Backup Codes</h1><p>${new Date().toLocaleString()}</p><pre>${backupCodesText}</pre></body></html>`
@@ -166,7 +163,7 @@ export default function MSettingsAccount() {
await deleteAvatar()
toast.success(t('settings.avatarRemoved'))
} catch {
- toast.error(t('settings.avatarError'))
+ toast.error(t('settings.avatarRemoveError'))
}
}
@@ -565,10 +562,6 @@ function MPasskeysCard({ demoMode }: { demoMode?: boolean }): React.ReactElement
const canAdd = enabled && configured
const handleAdd = async () => {
- if (!addPwd) {
- toast.error(t('settings.passkey.passwordRequired'))
- return
- }
setBusy(true)
try {
const options = await authApi.passkey.registerOptions(addPwd)
@@ -603,10 +596,6 @@ function MPasskeysCard({ demoMode }: { demoMode?: boolean }): React.ReactElement
}
const handleDelete = async (id: number) => {
- if (!deletePwd) {
- toast.error(t('settings.passkey.passwordRequired'))
- return
- }
setBusy(true)
try {
await authApi.passkey.delete(id, deletePwd)
diff --git a/client/src/mobile/screens/settings/MSettingsMcp.tsx b/client/src/mobile/screens/settings/MSettingsMcp.tsx
index 871f39087..0e3e0ca2c 100644
--- a/client/src/mobile/screens/settings/MSettingsMcp.tsx
+++ b/client/src/mobile/screens/settings/MSettingsMcp.tsx
@@ -125,9 +125,12 @@ export default function MSettingsMcp() {
}
}, [])
+ // Re-read after create/rotate so the rows show what the server actually stored.
+ const reloadClients = () => oauthApi.clients.list().then((d) => setClients(d.clients || [])).catch(() => {})
+
useEffect(() => {
authApi.mcpTokens.list().then((d) => setTokens(d.tokens || [])).catch(() => {})
- oauthApi.clients.list().then((d) => setClients(d.clients || [])).catch(() => {})
+ reloadClients()
oauthApi.sessions.list().then((d) => setSessions(d.sessions || [])).catch(() => {})
}, [])
@@ -180,7 +183,7 @@ export default function MSettingsMcp() {
...(isMachine ? { allows_client_credentials: true } : {}),
})
setCreatedClient(d.client)
- setClients((prev) => [...prev, { ...d.client, client_secret: undefined }])
+ await reloadClients()
setNewName('')
setNewUris('')
setNewScopes([])
@@ -209,6 +212,7 @@ export default function MSettingsMcp() {
const d = await oauthApi.clients.rotate(id)
setRotatedSecret(d.client_secret)
setRotateId(null)
+ await reloadClients()
} catch {
toast.error(t('settings.oauth.toast.rotateError'))
} finally {
diff --git a/client/src/mobile/screens/settings/MSettingsPlugins.tsx b/client/src/mobile/screens/settings/MSettingsPlugins.tsx
index a9ea4a952..a6dc4efa6 100644
--- a/client/src/mobile/screens/settings/MSettingsPlugins.tsx
+++ b/client/src/mobile/screens/settings/MSettingsPlugins.tsx
@@ -150,14 +150,14 @@ function PluginSettingsForm({ id, name, icon }: { id: string; name: string; icon
}
}
- const pickerField = (fields ?? []).find(f => f.key === pickerKey && f.input_type === 'select' && !!f.options)
+ const pickerField = fields.find(f => f.key === pickerKey && f.input_type === 'select' && !!f.options)
return (
<>
<MSetCard title={name} icon={resolvePluginIcon(icon)}>
{hasFields && (
<div className="flex flex-col gap-[14px]">
- {(fields ?? []).map(f => {
+ {fields.map(f => {
const requiredMark = f.required ? <span className="text-[color:var(--m-st-danger)]"> *</span> : null
if (f.input_type === 'checkbox') {
return (
diff --git a/client/src/mobile/screens/trip/MTripLoadingSplash.tsx b/client/src/mobile/screens/trip/MTripLoadingSplash.tsx
index f128838f4..3eabc739a 100644
--- a/client/src/mobile/screens/trip/MTripLoadingSplash.tsx
+++ b/client/src/mobile/screens/trip/MTripLoadingSplash.tsx
@@ -20,11 +20,20 @@ const STEPS: { scene: TrekScene; key: string }[] = [
const STEP_MS = 1400
// Reduced motion parks on the paper-plane / "loading photos" beat.
const STILL_INDEX = 2
+const REDUCE_MOTION = '(prefers-reduced-motion: reduce)'
export default function MTripLoadingSplash({ title }: { title: string }) {
const { t } = useTranslation()
- const reduceMotion =
- typeof window !== 'undefined' && window.matchMedia?.('(prefers-reduced-motion: reduce)').matches
+ const [reduceMotion, setReduceMotion] = useState(() => window.matchMedia?.(REDUCE_MOTION)?.matches ?? false)
+ // The splash can be up long enough for the OS setting to be flipped under it.
+ useEffect(() => {
+ const mq = window.matchMedia?.(REDUCE_MOTION)
+ if (!mq) return
+ const sync = () => setReduceMotion(mq.matches)
+ sync()
+ mq.addEventListener('change', sync)
+ return () => mq.removeEventListener('change', sync)
+ }, [])
const [index, setIndex] = useState(0)
useEffect(() => {
diff --git a/client/src/mobile/screens/trip/MTripShell.tsx b/client/src/mobile/screens/trip/MTripShell.tsx
index 853ff6ebd..89755982d 100644
--- a/client/src/mobile/screens/trip/MTripShell.tsx
+++ b/client/src/mobile/screens/trip/MTripShell.tsx
@@ -298,7 +298,7 @@ export default function MTripShell({
{days.length > 0 && (
<div className="absolute left-4 right-4 z-[25] flex top-[calc(var(--m-safe-top,12px)+50px)]">
<div className="flex flex-1 items-center gap-[2px] overflow-x-auto rounded-full border border-[color:var(--m-gbr)] bg-[color:var(--m-glass)] p-[3px] backdrop-blur-[24px] backdrop-saturate-[1.7]">
- {days.map(day => {
+ {days.map((day, idx) => {
const active = day.id === planner.selectedDayId
return (
<button
@@ -310,7 +310,7 @@ export default function MTripShell({
active ? 'bg-m-act text-m-actfg shadow-[0_6px_16px_-6px_rgba(0,0,0,.4)]' : 'text-m-ink'
}`}
>
- {dayChipLabel(day, language, t('planner.dayN', { n: day.day_number ?? 0 }))}
+ {dayChipLabel(day, language, t('planner.dayN', { n: day.day_number ?? idx + 1 }))}
</button>
)
})}
diff --git a/client/src/mobile/screens/trip/places/MPlacesBrowser.tsx b/client/src/mobile/screens/trip/places/MPlacesBrowser.tsx
index 394d46549..7f65fdb7a 100644
--- a/client/src/mobile/screens/trip/places/MPlacesBrowser.tsx
+++ b/client/src/mobile/screens/trip/places/MPlacesBrowser.tsx
@@ -85,7 +85,9 @@ export default function MPlacesBrowser({ planner, shell }: MPlacesBrowserProps)
return next
})
- const allSelected = filtered.length > 0 && selectedIds.size === filtered.length
+ // Compare the ids, not just the counts: a place removed remotely while another
+ // one is selected keeps the sizes equal without the sets matching.
+ const allSelected = filtered.length > 0 && filtered.every(p => selectedIds.has(p.id))
const toggleAllVisible = () => {
if (allSelected) setSelectedIds(new Set())
else setSelectedIds(new Set(filtered.map(p => p.id)))
@@ -334,9 +336,12 @@ export default function MPlacesBrowser({ planner, shell }: MPlacesBrowserProps)
count={selectedIds.size}
categories={categories}
onClose={() => setCategoryPickerOpen(false)}
- onPick={categoryId => {
- planner.confirmChangeCategory([...selectedIds], categoryId)
+ onPick={async categoryId => {
+ const ids = [...selectedIds]
setCategoryPickerOpen(false)
+ // Drop the selection only once the bulk edit went through — a failed
+ // one has to stay retryable with the same set.
+ try { await planner.confirmChangeCategory(ids, categoryId) } catch { return }
exitSelectMode()
}}
/>
@@ -357,9 +362,10 @@ export default function MPlacesBrowser({ planner, shell }: MPlacesBrowserProps)
confirmLabel={t('common.delete')}
cancelLabel={t('common.cancel')}
danger
- onConfirm={() => {
- planner.confirmDeletePlaces([...selectedIds])
+ onConfirm={async () => {
+ const ids = [...selectedIds]
setConfirmDeleteOpen(false)
+ try { await planner.confirmDeletePlaces(ids) } catch { return }
exitSelectMode()
}}
/>
diff --git a/client/src/mobile/screens/trip/plan/MPlanTimeline.tsx b/client/src/mobile/screens/trip/plan/MPlanTimeline.tsx
index 3170cb590..ec3d7c714 100644
--- a/client/src/mobile/screens/trip/plan/MPlanTimeline.tsx
+++ b/client/src/mobile/screens/trip/plan/MPlanTimeline.tsx
@@ -46,7 +46,8 @@ export default function MPlanTimeline({ planner, shell }: MPlanTimelineProps) {
// Plugin time contributions in the day plan (dayScheduleProvider hook) —
// slotted under their anchor rows, same as the desktop sidebar.
const daySchedule = usePluginDaySchedule(planner.tripId)
- const dayId = tl.day?.id
+ const day = tl.day
+ const dayId = day?.id
const dayScheduleFor = (anchor: 'assignment' | 'reservation', id: number) =>
(dayId != null
? (anchor === 'assignment' ? daySchedule.byAssignment[dayId]?.[id] : daySchedule.byReservation[dayId]?.[id])
@@ -88,7 +89,7 @@ export default function MPlanTimeline({ planner, shell }: MPlanTimelineProps) {
style={{ top: `calc(var(--m-safe-top, 12px) + ${editing ? 140 : tl.upNext ? 216 : 102}px)` }}
>
{(tl.hotelChips.length > 0 || tl.weatherTemp != null) && (
- <TimelineHeader tl={tl} onOpenDay={() => tl.day && shell.openSheet('day', { dayId: tl.day.id })} />
+ <TimelineHeader tl={tl} onOpenDay={() => day && shell.openSheet('day', { dayId: day.id })} />
)}
{tl.hotelLegs.top && (
@@ -96,7 +97,7 @@ export default function MPlanTimeline({ planner, shell }: MPlanTimelineProps) {
)}
{dayId != null && daySchedule.byPosition[dayId]?.start.map(si => <PlanScheduleRow key={`${si.pluginId}:${si.id}`} item={si} />)}
- {tl.rows.map(row => {
+ {day && tl.rows.map(row => {
switch (row.kind) {
case 'place':
return (
@@ -119,7 +120,7 @@ export default function MPlanTimeline({ planner, shell }: MPlanTimelineProps) {
<Fragment key={row.key}>
<TransportRow
res={row.res}
- dayId={tl.day!.id}
+ dayId={day.id}
chrome={chrome}
reorder={reorderFor(row.item)}
onOpen={() => {
@@ -136,7 +137,7 @@ export default function MPlanTimeline({ planner, shell }: MPlanTimelineProps) {
<TransitRow
res={row.res}
transit={row.transit}
- dayId={tl.day!.id}
+ dayId={day.id}
open={tl.openTransitKeys.has(row.key)}
chrome={chrome}
reorder={reorderFor(row.item)}
@@ -153,11 +154,11 @@ export default function MPlanTimeline({ planner, shell }: MPlanTimelineProps) {
note={row.note}
chrome={chrome}
reorder={reorderFor(row.item)}
- onEdit={() => tl.day && shell.openSheet('note', { dayId: tl.day.id, note: row.note })}
+ onEdit={() => shell.openSheet('note', { dayId: day.id, note: row.note })}
/>
)
case 'conn':
- return <ConnRow key={row.key} seg={row.seg} onTap={canEdit && row.assignmentId != null ? e => openLegMenu(e, row.assignmentId!) : undefined} />
+ return <ConnRow key={row.key} seg={row.seg} onTap={editing && row.assignmentId != null ? e => openLegMenu(e, row.assignmentId!) : undefined} />
}
})}
@@ -179,7 +180,7 @@ export default function MPlanTimeline({ planner, shell }: MPlanTimelineProps) {
<PlanAction
icon={PencilLine}
label={t('mobileTrip.addNoteShort')}
- onClick={() => tl.day && shell.openSheet('note', { dayId: tl.day.id })}
+ onClick={() => day && shell.openSheet('note', { dayId: day.id })}
/>
<PlanAction icon={Ticket} label={t('mobileTrip.addBookingShort')} onClick={tl.addBooking} />
<PlanAction icon={TrainFront} label={t('mobileTrip.addTransportShort')} onClick={tl.addTransport} />
diff --git a/client/src/mobile/screens/trip/plan/MPlanTimelineRows.tsx b/client/src/mobile/screens/trip/plan/MPlanTimelineRows.tsx
index 746a5d40a..68cd71658 100644
--- a/client/src/mobile/screens/trip/plan/MPlanTimelineRows.tsx
+++ b/client/src/mobile/screens/trip/plan/MPlanTimelineRows.tsx
@@ -222,7 +222,9 @@ function LineBadge({ leg, className = '' }: { leg: TransitLegDisplay; className?
}
function TransitStrip({ legs }: { legs: TransitLegDisplay[] }) {
- const shown = legs.filter(l => l.mode !== 'WALK' || (l.duration || 0) >= 60)
+ // Sub-minute walks are noise; a walk without a duration is not — dropping it
+ // would make the strip disagree with the expanded leg list.
+ const shown = legs.filter(l => l.mode !== 'WALK' || l.duration == null || l.duration >= 60)
return (
<div className="mt-1.5 flex flex-wrap items-center gap-1 text-m-faint">
{shown.map((leg, i) => (
@@ -231,7 +233,7 @@ function TransitStrip({ legs }: { legs: TransitLegDisplay[] }) {
{leg.mode === 'WALK' ? (
<span className="inline-flex items-center gap-[2px] font-geist text-[0.625rem] font-bold">
<Footprints size={11} strokeWidth={2.2} />
- {Math.round((leg.duration || 0) / 60)}
+ {leg.duration != null ? Math.round(leg.duration / 60) : ''}
</span>
) : (
<LineBadge leg={leg} />
@@ -359,12 +361,12 @@ export function TransitRow({ res, transit, dayId, open, chrome, reorder, onToggl
// ── b4) Walk/drive connector between two located places ─────────────────────
-export function ConnRow({ seg, onTap }: { seg: RouteSegment; onTap?: (e: MouseEvent) => void }) {
- // The leg's chosen mode (#1281) drives the icon + duration; tap to change it.
+/** The connector line of a routed leg — the leg's own mode (#1281) picks icon and duration. */
+function TravelLine({ seg }: { seg: RouteSegment }) {
const mode = seg.mode
const Icon = mode === 'walking' ? Footprints : mode?.startsWith('plugin:') ? Zap : Car
const durationText = seg.durationText ?? (mode === 'walking' ? seg.walkingText : seg.drivingText)
- const inner = (
+ return (
<>
<span className="h-px flex-1 bg-[color:var(--m-rowbr)]" />
<span className="inline-flex items-center gap-[3px] whitespace-nowrap font-geist text-[0.59375rem] font-semibold text-m-faint">
@@ -384,6 +386,11 @@ export function ConnRow({ seg, onTap }: { seg: RouteSegment; onTap?: (e: MouseEv
<span className="h-px flex-1 bg-[color:var(--m-rowbr)]" />
</>
)
+}
+
+export function ConnRow({ seg, onTap }: { seg: RouteSegment; onTap?: (e: MouseEvent) => void }) {
+ // Tap to change the leg's mode (#1281).
+ const inner = <TravelLine seg={seg} />
const cls = 'mt-[5px] flex w-full items-center gap-2 py-px text-[color:var(--m-conn)]'
return onTap
? <button type="button" onClick={onTap} className={cls}>{inner}</button>
@@ -421,21 +428,11 @@ export function HotelConnRow({ seg, name, placement }: {
name: string
placement: 'top' | 'bottom'
}) {
+ // Same line as the connectors between two stops, so a bookend leg routed with a
+ // plugin profile or set to walking reads the same as the rest of the day (#1281).
const travel = (
<div className="flex items-center gap-2 py-px text-[color:var(--m-conn)]">
- <span className="h-px flex-1 bg-[color:var(--m-rowbr)]" />
- <span className="inline-flex items-center gap-[3px] whitespace-nowrap font-geist text-[0.59375rem] font-semibold text-m-faint">
- <Footprints size={10} strokeWidth={2} />
- {seg.walkingText}
- </span>
- <span className="whitespace-nowrap font-geist text-[0.59375rem] font-semibold text-m-faint">
- · {seg.distanceText} ·
- </span>
- <span className="inline-flex items-center gap-[3px] whitespace-nowrap font-geist text-[0.59375rem] font-semibold text-m-faint">
- <Car size={10} strokeWidth={2} />
- {seg.drivingText}
- </span>
- <span className="h-px flex-1 bg-[color:var(--m-rowbr)]" />
+ <TravelLine seg={seg} />
</div>
)
const hotel = (
diff --git a/client/src/mobile/screens/trip/plan/useMPlanTimeline.ts b/client/src/mobile/screens/trip/plan/useMPlanTimeline.ts
index fbb7254c8..5162187e6 100644
--- a/client/src/mobile/screens/trip/plan/useMPlanTimeline.ts
+++ b/client/src/mobile/screens/trip/plan/useMPlanTimeline.ts
@@ -203,6 +203,11 @@ export function useMPlanTimeline(planner: TripPlanner) {
updateRouteForDay(dayId)
} catch (err: unknown) {
toast.error(err instanceof Error ? err.message : t('trip.toast.reorderError'))
+ // The optimistic transport positions and leg metadata written above are
+ // not undone one by one — pull the server state back in so the timeline
+ // stops showing an order that was never accepted.
+ void tripActions.refreshDays(tripId)
+ void tripActions.loadReservations(tripId)
}
}, [dayAssignments, tripActions, tripId, pushUndo, updateRouteForDay, toast, t])
diff --git a/client/src/mobile/screens/trip/sheets/ImpFileStep.tsx b/client/src/mobile/screens/trip/sheets/ImpFileStep.tsx
index b1665ee42..a0d4e14b1 100644
--- a/client/src/mobile/screens/trip/sheets/ImpFileStep.tsx
+++ b/client/src/mobile/screens/trip/sheets/ImpFileStep.tsx
@@ -46,7 +46,6 @@ export default function ImpFileStep({ planner, onBack, onDone }: ImpFileStepProp
}
const selectFiles = (incoming: File[]) => {
- if (incoming.length === 0) return
const valid: File[] = []
let firstError: string | null = null
for (const f of incoming) {
@@ -65,28 +64,27 @@ export default function ImpFileStep({ planner, onBack, onDone }: ImpFileStepProp
setError('')
setSummary(null)
- let totalCreated = 0
+ // Counted per format so a mixed selection gets each half's own label.
+ let gpxCreated = 0
+ let kmlCreated = 0
let totalSkipped = 0
- const createdIds: number[] = []
+ const gpxIds: number[] = []
+ const kmlIds: number[] = []
const errors: string[] = []
let mergedSummary: ImportSummary | null = null
- let importedGpx = false
- let importedKml = false
for (const f of files) {
const ext = f.name.toLowerCase().split('.').pop()
try {
if (ext === 'gpx') {
- importedGpx = true
const result = await placesApi.importGpx(tripId, f, gpxOpts)
- totalCreated += result.count ?? 0
+ gpxCreated += result.count ?? 0
totalSkipped += result.skipped ?? 0
- if (result.places?.length > 0) createdIds.push(...result.places.map((p: { id: number }) => p.id))
+ if (result.places?.length > 0) gpxIds.push(...result.places.map((p: { id: number }) => p.id))
} else {
- importedKml = true
const result = await placesApi.importMapFile(tripId, f, kmlOpts)
- totalCreated += result.count ?? 0
- if (result.places?.length > 0) createdIds.push(...result.places.map((p: { id: number }) => p.id))
+ kmlCreated += result.count ?? 0
+ if (result.places?.length > 0) kmlIds.push(...result.places.map((p: { id: number }) => p.id))
const s = result.summary as ImportSummary | undefined
if (s) {
mergedSummary = mergedSummary
@@ -98,8 +96,9 @@ export default function ImpFileStep({ planner, onBack, onDone }: ImpFileStepProp
errors: [...mergedSummary.errors, ...(s.errors ?? [])],
}
: s
- totalSkipped += s.skippedCount ?? 0
}
+ // A response without a summary carries the count on the top level.
+ totalSkipped += s?.skippedCount ?? result.skipped ?? 0
}
} catch (err: unknown) {
const message =
@@ -110,8 +109,12 @@ export default function ImpFileStep({ planner, onBack, onDone }: ImpFileStepProp
await tripActions.loadTrip(tripId)
+ const createdIds = [...gpxIds, ...kmlIds]
if (createdIds.length > 0) {
- pushUndo(importedGpx && !importedKml ? t('undo.importGpx') : t('undo.importKeyholeMarkup'), async () => {
+ const undoLabel = gpxIds.length > 0 && kmlIds.length > 0
+ ? t('undo.importFiles')
+ : gpxIds.length > 0 ? t('undo.importGpx') : t('undo.importKeyholeMarkup')
+ pushUndo(undoLabel, async () => {
try {
await placesApi.bulkDelete(tripId, createdIds)
} catch {
@@ -121,10 +124,9 @@ export default function ImpFileStep({ planner, onBack, onDone }: ImpFileStepProp
})
}
- if (totalCreated > 0) {
- const key = importedKml && !importedGpx ? 'places.kmlKmzImported' : 'places.gpxImported'
- toast.success(t(key, { count: totalCreated }))
- } else if (totalSkipped > 0 && errors.length === 0) {
+ if (gpxCreated > 0) toast.success(t('places.gpxImported', { count: gpxCreated }))
+ if (kmlCreated > 0) toast.success(t('places.kmlKmzImported', { count: kmlCreated }))
+ if (gpxCreated === 0 && kmlCreated === 0 && totalSkipped > 0 && errors.length === 0) {
toast.warning(t('places.importAllSkipped'))
}
diff --git a/client/src/mobile/screens/trip/sheets/MAccommodationSheet.tsx b/client/src/mobile/screens/trip/sheets/MAccommodationSheet.tsx
index ae05612b4..8e24ed997 100644
--- a/client/src/mobile/screens/trip/sheets/MAccommodationSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MAccommodationSheet.tsx
@@ -20,10 +20,11 @@ interface HotelForm {
check_in_end: string
check_out: string
confirmation: string
- place_id: number | null
+ /** '' = nothing picked yet, which is what keeps the save button disabled. */
+ place_id: number | ''
}
-const EMPTY_FORM: HotelForm = { check_in: '', check_in_end: '', check_out: '', confirmation: '', place_id: null }
+const EMPTY_FORM: HotelForm = { check_in: '', check_in_end: '', check_out: '', confirmation: '', place_id: '' }
/**
* Add/edit accommodation sheet — the mobile counterpart of the desktop
@@ -60,7 +61,7 @@ export default function MAccommodationSheet({ planner, shell }: MTripSheetsProps
check_in_end: editing.check_in_end || '',
check_out: editing.check_out || '',
confirmation: editing.confirmation || '',
- place_id: editing.place_id ?? null,
+ place_id: editing.place_id ?? '',
})
} else {
const idx = days.findIndex(d => d.id === payload.dayId)
@@ -71,8 +72,10 @@ export default function MAccommodationSheet({ planner, shell }: MTripSheetsProps
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [open, payload.dayId, payload.accId])
- // Cancelling / saving returns to the day sheet it was opened from.
- const back = () => shell.openSheet('day', { dayId: payload.dayId })
+ // Cancelling / saving returns to the day sheet it was opened from — opened for
+ // an edit there is no dayId in the payload, so fall back to the stay's own
+ // start day instead of leaving the day sheet without one.
+ const back = () => shell.openSheet('day', { dayId: payload.dayId ?? editing?.start_day_id })
const firstId = days[0]?.id
const lastId = days[days.length - 1]?.id
@@ -89,27 +92,29 @@ export default function MAccommodationSheet({ planner, shell }: MTripSheetsProps
const filteredPlaces = categoryFilter != null ? places.filter(p => p.category_id === categoryFilter) : places
const save = async () => {
- if (!form.place_id || saving) return
setSaving(true)
+ const body = {
+ place_id: form.place_id,
+ start_day_id: range.start,
+ end_day_id: range.end,
+ check_in: form.check_in || null,
+ check_in_end: form.check_in_end || null,
+ check_out: form.check_out || null,
+ confirmation: form.confirmation || null,
+ }
+ // Only the write itself decides whether the save failed — a refresh that
+ // trips afterwards must not be reported as a failed save.
try {
- const body = {
- place_id: form.place_id,
- start_day_id: range.start,
- end_day_id: range.end,
- check_in: form.check_in || null,
- check_in_end: form.check_in_end || null,
- check_out: form.check_out || null,
- confirmation: form.confirmation || null,
- }
if (editing) await accommodationsApi.update(tripId, editing.id, body)
else await accommodationsApi.create(tripId, body)
- planner.loadAccommodations()
- back()
} catch {
planner.toast.error(t('common.error'))
+ return
} finally {
setSaving(false)
}
+ planner.loadAccommodations()
+ back()
}
return (
diff --git a/client/src/mobile/screens/trip/sheets/MBrowseActionsSheet.tsx b/client/src/mobile/screens/trip/sheets/MBrowseActionsSheet.tsx
index 366e5c733..c1cd48b99 100644
--- a/client/src/mobile/screens/trip/sheets/MBrowseActionsSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MBrowseActionsSheet.tsx
@@ -115,7 +115,8 @@ export default function MBrowseActionsSheet({ planner, shell }: MTripSheetsProps
className={`flex w-full items-center gap-2 px-3 py-[10px] text-left ${i > 0 ? 'border-t border-[color:var(--m-rowbr)]' : ''}`}
>
<span className="min-w-0 flex-1 truncate text-[0.78125rem] font-semibold">
- {d.title || t('planner.dayN', { n: (d.day_number ?? i + 1) || '?' })}
+ {/* A day_number of 0 is as unusable as a missing one — both take the row position. */}
+ {d.title || t('planner.dayN', { n: d.day_number || i + 1 })}
</span>
{d.date && (
<span className="flex-none font-geist text-[0.65625rem] font-medium text-m-muted">
diff --git a/client/src/mobile/screens/trip/sheets/MCostSheet.tsx b/client/src/mobile/screens/trip/sheets/MCostSheet.tsx
index 57271b486..d8281e903 100644
--- a/client/src/mobile/screens/trip/sheets/MCostSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MCostSheet.tsx
@@ -244,9 +244,12 @@ export default function MCostSheet({ tripId, base, people, me, editing, prefill,
const save = async () => {
if (!valid || saving) return
setSaving(true)
+ // A picked payer always goes out, even when nobody shares the expense: the
+ // server re-derives total_price from the payer sum (CostsPanel.helpers), so
+ // dropping the payer would store the entry with a total of 0.
const payerList = multiPayer
? [...payerIds].map(id => ({ user_id: id, amount: parseFloat(payerAmounts[id]) || 0 })).filter(p => p.amount > 0)
- : (payerId > 0 && participants.size > 0) ? [{ user_id: payerId, amount: totalNum }] : []
+ : payerId > 0 ? [{ user_id: payerId, amount: totalNum }] : []
const memberList = [...participants].map(id => ({
user_id: id,
amount: splitMode === 'custom'
diff --git a/client/src/mobile/screens/trip/sheets/MDaySheet.tsx b/client/src/mobile/screens/trip/sheets/MDaySheet.tsx
index cad107540..3c9122dac 100644
--- a/client/src/mobile/screens/trip/sheets/MDaySheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MDaySheet.tsx
@@ -193,7 +193,8 @@ export default function MDaySheet({ planner, shell }: MTripSheetsProps) {
weekday: 'long', day: 'numeric', month: 'long', timeZone: 'UTC',
})
: null
- const dayLabel = day?.title || t('planner.dayN', { n: (day?.day_number ?? dayIndex + 1) || '?' })
+ // A day_number of 0 is as unusable as a missing one — both fall back to the row position.
+ const dayLabel = day?.title || t('planner.dayN', { n: day ? day.day_number || dayIndex + 1 : '?' })
const WeatherIcon = weatherIconFor(weather?.main)
const stayBadge = (acc: (typeof dayAccommodations)[number]) => {
diff --git a/client/src/mobile/screens/trip/sheets/MExportSheet.tsx b/client/src/mobile/screens/trip/sheets/MExportSheet.tsx
index 44bb1f2e3..ec532e435 100644
--- a/client/src/mobile/screens/trip/sheets/MExportSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MExportSheet.tsx
@@ -21,6 +21,7 @@ export default function MExportSheet({ planner, shell }: MTripSheetsProps) {
const dayNotes = useTripStore(s => s.dayNotes)
const [subscribeOpen, setSubscribeOpen] = useState(false)
const [pdfBusy, setPdfBusy] = useState(false)
+ const [icsBusy, setIcsBusy] = useState(false)
const exportPdf = async () => {
if (!planner.trip || pdfBusy) return
@@ -48,6 +49,8 @@ export default function MExportSheet({ planner, shell }: MTripSheetsProps) {
}
const downloadIcs = async () => {
+ if (icsBusy) return
+ setIcsBusy(true)
try {
const res = await fetch(`/api/trips/${planner.tripId}/export.ics`, { credentials: 'include' })
if (!res.ok) throw new Error()
@@ -56,11 +59,16 @@ export default function MExportSheet({ planner, shell }: MTripSheetsProps) {
const a = document.createElement('a')
a.href = url
a.download = `${planner.trip?.title || 'trip'}.ics`
+ document.body.appendChild(a)
a.click()
- URL.revokeObjectURL(url)
+ // Firefox/Safari cancel the download when the object URL is revoked
+ // before they picked the blob up.
+ setTimeout(() => { URL.revokeObjectURL(url); a.remove() }, 100)
shell.closeSheet()
} catch {
planner.toast.error(t('planner.icsExportFailed'))
+ } finally {
+ setIcsBusy(false)
}
}
@@ -85,7 +93,7 @@ export default function MExportSheet({ planner, shell }: MTripSheetsProps) {
/>
<ExportRow
icon={FileDown}
- title={t('mobileTrip.icsDownload')}
+ title={icsBusy ? t('common.loading') : t('mobileTrip.icsDownload')}
sub={`${planner.trip?.title || 'trip'}.ics`}
onClick={() => void downloadIcs()}
/>
diff --git a/client/src/mobile/screens/trip/sheets/MNoteSheet.tsx b/client/src/mobile/screens/trip/sheets/MNoteSheet.tsx
index 439063e64..9b93e75d7 100644
--- a/client/src/mobile/screens/trip/sheets/MNoteSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MNoteSheet.tsx
@@ -38,13 +38,19 @@ export default function MNoteSheet({ planner, open, payload, onClose }: MNoteShe
// the sheet still shows through its exit animation.
const [sheetPayload, setSheetPayload] = useState<MNoteSheetPayload | undefined>(undefined)
+ // Keyed on what the payload points AT, not on its object identity — a caller
+ // that rebuilds the payload inline (or a store refresh of the note) must not
+ // reseed the fields under the user's fingers.
+ const payloadNoteId = payload?.note?.id
+ const payloadDayId = payload?.dayId
useEffect(() => {
if (!open) return
setSheetPayload(payload)
setIcon(payload?.note?.icon || 'FileText')
setTitle(payload?.note?.text || '')
setDetail(payload?.note?.time || '')
- }, [open, payload])
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [open, payloadNoteId, payloadDayId])
const note = sheetPayload?.note ?? null
const dayId = sheetPayload?.dayId ?? selectedDayId
diff --git a/client/src/mobile/screens/trip/sheets/MPlaceEditSheet.tsx b/client/src/mobile/screens/trip/sheets/MPlaceEditSheet.tsx
index 0fdf2f57d..3b97f8d30 100644
--- a/client/src/mobile/screens/trip/sheets/MPlaceEditSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MPlaceEditSheet.tsx
@@ -187,8 +187,10 @@ export default function MPlaceEditSheet({ planner }: MPlaceEditSheetProps) {
}
}
+ // End before start blocks the save — tied to the values, not to which entry
+ // point opened the sheet.
const hasTimeError = Boolean(
- sheetPlace && form.place_time && form.end_time &&
+ form.place_time && form.end_time &&
form.place_time.length >= 5 && form.end_time.length >= 5 &&
form.end_time <= form.place_time,
)
diff --git a/client/src/mobile/screens/trip/sheets/MPlaceSheet.tsx b/client/src/mobile/screens/trip/sheets/MPlaceSheet.tsx
index 001e63fa5..3d8cb10e6 100644
--- a/client/src/mobile/screens/trip/sheets/MPlaceSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MPlaceSheet.tsx
@@ -53,6 +53,7 @@ export default function MPlaceSheet({ planner, shell }: MTripSheetsProps) {
setFilesExpanded(false)
setDayPickerOpen(false)
setParticipantPickerOpen(false)
+ setColorPickerOpen(false)
}
const category = place?.category
@@ -150,7 +151,7 @@ export default function MPlaceSheet({ planner, shell }: MTripSheetsProps) {
try {
await planner.tripActions.updatePlace(planner.tripId, place.id, { image_url: null })
} catch (err: unknown) {
- planner.toast.error(translateApiError(t, err, 'places.imageUploadError'))
+ planner.toast.error(translateApiError(t, err, 'places.imageRemoveError'))
} finally {
setImgBusy(false)
}
diff --git a/client/src/mobile/screens/trip/sheets/MReservationSheet.tsx b/client/src/mobile/screens/trip/sheets/MReservationSheet.tsx
index ba93d006a..0d87cd84b 100644
--- a/client/src/mobile/screens/trip/sheets/MReservationSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MReservationSheet.tsx
@@ -157,8 +157,12 @@ export default function MReservationSheet({ planner, onOpenExpense }: MReservati
const isEndBeforeStart = (() => {
if (isHotel || !form.end_date || !form.reservation_time) return false
const sDate = form.reservation_time.split('T')[0]
- const sTime = form.reservation_time.split('T')[1] || '00:00'
- return `${form.end_date}T${form.reservation_end_time || '00:00'}` <= `${sDate}T${sTime}`
+ const sTime = form.reservation_time.split('T')[1] || ''
+ const eTime = form.reservation_end_time || ''
+ // Without a time on either side the booking is all-day, so an end on the
+ // start day is fine — only compare the dates there.
+ if (!sTime || !eTime) return form.end_date < sDate
+ return `${form.end_date}T${eTime}` <= `${sDate}T${sTime}`
})()
const startDate = (form.reservation_time || '').split('T')[0] || ''
@@ -188,7 +192,7 @@ export default function MReservationSheet({ planner, onOpenExpense }: MReservati
}
const handleSubmit = async () => {
- if (!form.title.trim() || isSaving) return
+ // Only the costs button reaches this without the footer's date check.
if (isEndBeforeStart) { toast.error(t('reservations.validation.endBeforeStart')); return }
const withExpense = expenseIntentRef.current
expenseIntentRef.current = false
diff --git a/client/src/mobile/screens/trip/sheets/MTransportFormSheet.tsx b/client/src/mobile/screens/trip/sheets/MTransportFormSheet.tsx
index b269982e6..7a6b83c28 100644
--- a/client/src/mobile/screens/trip/sheets/MTransportFormSheet.tsx
+++ b/client/src/mobile/screens/trip/sheets/MTransportFormSheet.tsx
@@ -194,6 +194,10 @@ export default function MTransportFormSheet({ planner, onOpenExpense }: MTranspo
// day drag, insertDay or a trip-date shift (mirrors TransportModal).
const endpointDayId = (ep?: { local_date?: string | null } | null) =>
editingTransport ? '' : resolveDayId(days, ep?.local_date)
+ // Origin and destination fall back to the reservation's own day columns. An
+ // intermediate stop has none, so when metadata.legs is missing (imported or
+ // MCP-created bookings) its local_date is the only day left to seed from.
+ const stopDayId = (ep?: { local_date?: string | null } | null) => resolveDayId(days, ep?.local_date)
if (type === 'flight') {
const orderedEps = orderedEndpoints(src)
@@ -206,11 +210,12 @@ export default function MTransportFormSheet({ planner, onOpenExpense }: MTranspo
const legOut = metaLegs[i]
const isFirst = i === 0
const isLast = i === orderedEps.length - 1
+ const stopDay = !isFirst && !isLast ? stopDayId(ep) : ''
return {
airport: airportFromEndpoint(ep),
- arrDayId: legInto?.arr_day_id ?? (endpointDayId(ep) || (isLast ? (src.end_day_id ?? '') : '')),
+ arrDayId: legInto?.arr_day_id ?? (endpointDayId(ep) || (isLast ? (src.end_day_id ?? '') : stopDay)),
arrTime: legInto?.arr_time ?? (!isFirst ? (ep.local_time ?? '') : ''),
- depDayId: legOut?.dep_day_id ?? (endpointDayId(ep) || (isFirst ? (src.day_id ?? '') : '')),
+ depDayId: legOut?.dep_day_id ?? (endpointDayId(ep) || (isFirst ? (src.day_id ?? '') : stopDay)),
depTime: legOut?.dep_time ?? (!isLast ? (ep.local_time ?? '') : ''),
airline: legOut?.airline ?? (isFirst ? (meta.airline ?? '') : ''),
flight_number: legOut?.flight_number ?? (isFirst ? (meta.flight_number ?? '') : ''),
@@ -243,11 +248,12 @@ export default function MTransportFormSheet({ planner, onOpenExpense }: MTranspo
const legOut = metaLegs[i]
const isFirst = i === 0
const isLast = i === orderedEps.length - 1
+ const stopDay = !isFirst && !isLast ? stopDayId(ep) : ''
return {
location: locationFromEndpoint(ep),
- arrDayId: legInto?.arr_day_id ?? (endpointDayId(ep) || (isLast ? (src.end_day_id ?? '') : '')),
+ arrDayId: legInto?.arr_day_id ?? (endpointDayId(ep) || (isLast ? (src.end_day_id ?? '') : stopDay)),
arrTime: legInto?.arr_time ?? (!isFirst ? (ep.local_time ?? '') : ''),
- depDayId: legOut?.dep_day_id ?? (endpointDayId(ep) || (isFirst ? (src.day_id ?? '') : '')),
+ depDayId: legOut?.dep_day_id ?? (endpointDayId(ep) || (isFirst ? (src.day_id ?? '') : stopDay)),
depTime: legOut?.dep_time ?? (!isLast ? (ep.local_time ?? '') : ''),
train_number: legOut?.train_number ?? (isFirst ? (meta.train_number ?? '') : ''),
platform: legOut?.platform ?? (isFirst ? (meta.platform ?? '') : ''),
@@ -357,9 +363,13 @@ export default function MTransportFormSheet({ planner, onOpenExpense }: MTranspo
const firstWp = flightWps[0]
const lastWp = flightWps[flightWps.length - 1]
const trainWps = form.type === 'train' ? trainWaypoints : []
- const firstTrainWp = trainWps[0]
- const lastTrainWp = trainWps[trainWps.length - 1]
- const trainStations = form.type === 'train' ? trainWaypoints.filter(w => w.location) : []
+ const trainStations = trainWps.filter(w => w.location)
+ // The day/time anchors have to be the rows that actually become endpoints
+ // (same as the flight path); only a train without a single picked station
+ // falls back to the raw rows so its day and time survive.
+ const trainAnchors = trainStations.length > 0 ? trainStations : trainWps
+ const firstTrainWp = trainAnchors[0]
+ const lastTrainWp = trainAnchors[trainAnchors.length - 1]
// Per-leg day-plan positions are owned by the day planner — keep them on re-save.
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const origLegs: any[] = res ? (parseReservationMetadata(res).legs || []) : []
diff --git a/client/src/mobile/screens/trip/sheets/PlPlaceSearch.tsx b/client/src/mobile/screens/trip/sheets/PlPlaceSearch.tsx
index 6b3f39f73..28529f955 100644
--- a/client/src/mobile/screens/trip/sheets/PlPlaceSearch.tsx
+++ b/client/src/mobile/screens/trip/sheets/PlPlaceSearch.tsx
@@ -85,7 +85,8 @@ export default function PlPlaceSearch({ planner, locationBias, onPick, onResolvi
const result = await mapsApi.autocomplete(input, language, locationBias, controller.signal)
setSuggestions(result.suggestions || [])
} catch (err: unknown) {
- if (err instanceof Error && (err.name === 'AbortError' || err.name === 'CanceledError')) return
+ // Superseded request — axios rejects an aborted call with CanceledError.
+ if (err instanceof Error && err.name === 'CanceledError') return
setSuggestions([])
}
},
diff --git a/client/src/mobile/screens/trip/tabs/MBookingsTab.tsx b/client/src/mobile/screens/trip/tabs/MBookingsTab.tsx
index a226209ea..ee92692ac 100644
--- a/client/src/mobile/screens/trip/tabs/MBookingsTab.tsx
+++ b/client/src/mobile/screens/trip/tabs/MBookingsTab.tsx
@@ -7,7 +7,7 @@ import { openFile } from '../../../../utils/fileDownload'
import { useTranslation } from '../../../../i18n'
import type { Reservation } from '../../../../types'
import MConfirmSheet from '../../settings/MConfirmSheet'
-import { CountPill, Field, SectionHeader, StatusDot, TabScroller, TravelerAvatars, TravelerFilterRow } from './tabChrome'
+import { ConfirmationCode, CountPill, Field, SectionHeader, StatusDot, TabScroller, TravelerAvatars, TravelerFilterRow } from './tabChrome'
import { STATUS_COLOR, type MTabScreenProps } from './tabModel'
import { groupTransports, orderedEndpoints, parseTransportMeta } from './transportsModel'
import { BOOKING_TYPE_COLOR } from './bookingsModel'
@@ -183,73 +183,71 @@ function BookingCard({ res, planner, canEdit, compact }: {
)}
</div>
- {/* Body */}
+ {/* Body — split around the booking code so the reveal can be its own
+ control instead of a click handler buried inside the card button. */}
{!compact && (
- <button type="button" onClick={openEdit} className="block w-full px-3 pb-3 pt-[9px] text-left">
- <div className="flex gap-2">
- <Field label={t('reservations.date')} className="flex-[1.4]">{dayValue}</Field>
- <Field label={t('reservations.time')} className="flex-1" tabular>{timeValue}</Field>
- </div>
-
- {res.confirmation_number && (
- <div className="mt-2">
- <div className="mb-[3px] font-geist text-[0.5625rem] font-bold uppercase tracking-[.08em] text-m-faint">
- {t('reservations.confirmationCode')}
- </div>
- <div
- onClick={e => { if (blurCodes) { e.stopPropagation(); setCodeRevealed(v => !v) } }}
- className={`overflow-hidden text-ellipsis whitespace-nowrap rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px] text-center font-geist text-[0.71875rem] font-semibold tabular-nums text-m-ink ${
- blurCodes && !codeRevealed ? 'blur-[4px] select-none' : ''
- }`}
- >
- {res.confirmation_number}
- </div>
+ <div className="px-3 pb-3 pt-[9px]">
+ <button type="button" onClick={openEdit} className="block w-full text-left">
+ <div className="flex gap-2">
+ <Field label={t('reservations.date')} className="flex-[1.4]">{dayValue}</Field>
+ <Field label={t('reservations.time')} className="flex-1" tabular>{timeValue}</Field>
</div>
- )}
+ </button>
- {metaCells.length > 0 && (
- <div className="mt-2 flex gap-2">
- {metaCells.slice(0, 3).map((c, i) => (
- <Field key={i} label={c.label} className="flex-1">{c.value}</Field>
- ))}
- </div>
+ {res.confirmation_number && (
+ <ConfirmationCode
+ code={res.confirmation_number}
+ label={t('reservations.confirmationCode')}
+ blurred={!!blurCodes && !codeRevealed}
+ onToggle={blurCodes ? () => setCodeRevealed(v => !v) : undefined}
+ />
)}
- <TravelerAvatars travelers={res.travelers || []} label={t('reservations.travelers.label')} />
+ <button type="button" onClick={openEdit} className="block w-full text-left">
+ {metaCells.length > 0 && (
+ <div className="mt-2 flex gap-2">
+ {metaCells.slice(0, 3).map((c, i) => (
+ <Field key={i} label={c.label} className="flex-1">{c.value}</Field>
+ ))}
+ </div>
+ )}
- {res.location && (
- <div className="mt-2 flex items-center gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px]">
- <MapPin size={12} strokeWidth={2} className="flex-none text-m-muted" />
- <span className="truncate text-[0.71875rem] font-semibold text-m-ink">{res.location}</span>
- </div>
- )}
+ <TravelerAvatars travelers={res.travelers || []} label={t('reservations.travelers.label')} />
- {res.notes && (
- <div className="mt-2 rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-2">
- <p className="whitespace-pre-wrap font-geist text-[0.6875rem] leading-[1.5] text-m-muted">{res.notes}</p>
- </div>
- )}
+ {res.location && (
+ <div className="mt-2 flex items-center gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px]">
+ <MapPin size={12} strokeWidth={2} className="flex-none text-m-muted" />
+ <span className="truncate text-[0.71875rem] font-semibold text-m-ink">{res.location}</span>
+ </div>
+ )}
- {files.length > 0 && (
- <div className="mt-2">
- <div className="mb-[3px] font-geist text-[0.5625rem] font-bold uppercase tracking-[.08em] text-m-faint">
- {t('files.title')}
+ {res.notes && (
+ <div className="mt-2 rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-2">
+ <p className="whitespace-pre-wrap font-geist text-[0.6875rem] leading-[1.5] text-m-muted">{res.notes}</p>
</div>
- <div className="flex flex-col gap-1">
- {files.map(f => (
- <span
- key={f.id}
- onClick={e => { e.stopPropagation(); openFile(f.url, f.original_name) }}
- className="flex items-center gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px]"
- >
- <FileText size={12} strokeWidth={2} className="flex-none text-m-muted" />
- <span className="truncate font-geist text-[0.65625rem] font-semibold text-m-muted">{f.original_name}</span>
- </span>
- ))}
+ )}
+
+ {files.length > 0 && (
+ <div className="mt-2">
+ <div className="mb-[3px] font-geist text-[0.5625rem] font-bold uppercase tracking-[.08em] text-m-faint">
+ {t('files.title')}
+ </div>
+ <div className="flex flex-col gap-1">
+ {files.map(f => (
+ <span
+ key={f.id}
+ onClick={e => { e.stopPropagation(); openFile(f.url, f.original_name) }}
+ className="flex items-center gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px]"
+ >
+ <FileText size={12} strokeWidth={2} className="flex-none text-m-muted" />
+ <span className="truncate font-geist text-[0.65625rem] font-semibold text-m-muted">{f.original_name}</span>
+ </span>
+ ))}
+ </div>
</div>
- </div>
- )}
- </button>
+ )}
+ </button>
+ </div>
)}
<MConfirmSheet
diff --git a/client/src/mobile/screens/trip/tabs/MCollabChat.tsx b/client/src/mobile/screens/trip/tabs/MCollabChat.tsx
index fd1188e19..467218341 100644
--- a/client/src/mobile/screens/trip/tabs/MCollabChat.tsx
+++ b/client/src/mobile/screens/trip/tabs/MCollabChat.tsx
@@ -24,6 +24,12 @@ const PAGE_SIZE = 100
const LONG_PRESS_MS = 500
const DOUBLE_TAP_MS = 300
const MOVE_CANCEL_PX = 10
+const POPOVER_WIDTH = 224
+// Emoji grid + reply row, plus the delete row when it is shown — used to keep
+// the popover inside the viewport.
+const POPOVER_HEIGHT = 150
+const POPOVER_DELETE_ROW = 37
+const POPOVER_MARGIN = 8
interface MCollabChatProps {
planner: TripPlanner
@@ -383,7 +389,9 @@ function ChatBubbleRow({ msg, own, showHeader, isLastInGroup, marginTop, is12h,
}
const bigEmoji = isEmojiOnlyText(msg.text)
- const hasReply = !!(msg.reply_text || msg.reply_to)
+ // A reply to a since-deleted message keeps reply_to but loses the quoted
+ // text — no quote box then instead of an empty one.
+ const hasReply = !!msg.reply_text
const initial = (msg.username || '?')[0]?.toUpperCase() || '?'
return (
@@ -431,7 +439,7 @@ function ChatBubbleRow({ msg, own, showHeader, isLastInGroup, marginTop, is12h,
{hasReply && (
<div className="mb-1 rounded-[10px] bg-[color:var(--m-card)] px-[10px] py-[5px]">
<div className="font-geist text-[0.625rem] font-bold opacity-70">{msg.reply_username}</div>
- <div className="truncate text-[0.71875rem] opacity-80">{(msg.reply_text || '').slice(0, 80)}</div>
+ <div className="truncate text-[0.71875rem] opacity-80">{msg.reply_text?.slice(0, 80)}</div>
</div>
)}
<span className="whitespace-pre-wrap break-words">{msg.text}</span>
@@ -485,9 +493,10 @@ function MessageActionsPopover({ x, y, canDeleteOwn, t, onReact, onReply, onDele
return () => document.removeEventListener('pointerdown', close)
}, [onClose])
- const width = 224
- const left = Math.max(width / 2 + 8, Math.min(x, window.innerWidth - width / 2 - 8))
- const top = Math.max(64, y - 96)
+ const width = POPOVER_WIDTH
+ const left = Math.max(width / 2 + POPOVER_MARGIN, Math.min(x, window.innerWidth - width / 2 - POPOVER_MARGIN))
+ const height = POPOVER_HEIGHT + (canDeleteOwn ? POPOVER_DELETE_ROW : 0)
+ const top = Math.max(64, Math.min(y - 96, window.innerHeight - height - POPOVER_MARGIN))
return ReactDOM.createPortal(
<div className="m-root fixed inset-0 z-[55]">
diff --git a/client/src/mobile/screens/trip/tabs/MCollabNotes.tsx b/client/src/mobile/screens/trip/tabs/MCollabNotes.tsx
index 3ce3ea8b9..6288cda79 100644
--- a/client/src/mobile/screens/trip/tabs/MCollabNotes.tsx
+++ b/client/src/mobile/screens/trip/tabs/MCollabNotes.tsx
@@ -151,11 +151,18 @@ export default function MCollabNotes({ planner }: MCollabNotesProps) {
}
}, [tripId, toast, t])
+ // Returns whether the file is really gone — the form sheet only drops the
+ // chip once the server confirmed it.
const handleDeleteFile = useCallback(async (noteId: number, fileId: number) => {
try {
await collabApi.deleteNoteFile(tripId, noteId, fileId)
+ setNotes(prev => prev.map(n => (
+ n.id === noteId ? { ...n, attachments: n.attachments.filter(f => f.id !== fileId) } : n
+ )))
+ return true
} catch {
toast.error(t('common.error'))
+ return false
}
}, [tripId, toast, t])
@@ -357,7 +364,7 @@ function NoteFormSheet({ open, target, categories, colorMap, canUploadFiles, onC
canUploadFiles: boolean
onClose: () => void
onSubmit: (data: NoteFormSubmitData) => Promise<void>
- onDeleteExistingFile: (noteId: number, fileId: number) => void
+ onDeleteExistingFile: (noteId: number, fileId: number) => Promise<boolean>
t: TripPlanner['t']
}) {
const note = target && target !== 'new' ? target : null
@@ -432,7 +439,7 @@ function NoteFormSheet({ open, target, categories, colorMap, canUploadFiles, onC
className={FIELD_CLS}
/>
- <Eyebrow className="mb-[5px] mt-3 uppercase">{t('collab.notes.contentPlaceholder')}</Eyebrow>
+ <Eyebrow className="mb-[5px] mt-3 uppercase">{t('collab.notes.content')}</Eyebrow>
<textarea
value={content}
onChange={e => setContent(e.target.value)}
@@ -515,11 +522,12 @@ function NoteFormSheet({ open, target, categories, colorMap, canUploadFiles, onC
{f.original_name.length > 20 ? `${f.original_name.slice(0, 17)}...` : f.original_name}
<button
type="button"
- onClick={() => {
- if (note) onDeleteExistingFile(note.id, f.id)
- setExistingFiles(prev => prev.filter(x => x.id !== f.id))
+ onClick={async () => {
+ if (!note) return
+ const removed = await onDeleteExistingFile(note.id, f.id)
+ if (removed) setExistingFiles(prev => prev.filter(x => x.id !== f.id))
}}
- aria-label={t('collab.notes.delete')}
+ aria-label={t('collab.notes.removeFile', { name: f.original_name })}
className="text-[color:var(--m-st-danger)]"
>
<X size={10} strokeWidth={2.4} />
@@ -535,7 +543,7 @@ function NoteFormSheet({ open, target, categories, colorMap, canUploadFiles, onC
<button
type="button"
onClick={() => setPendingFiles(prev => prev.filter((_, j) => j !== i))}
- aria-label={t('collab.notes.delete')}
+ aria-label={t('collab.notes.removeFile', { name: f.name })}
className="text-m-faint"
>
<X size={10} strokeWidth={2.4} />
diff --git a/client/src/mobile/screens/trip/tabs/MCollabPolls.tsx b/client/src/mobile/screens/trip/tabs/MCollabPolls.tsx
index fd4dc280e..0d9bdb19b 100644
--- a/client/src/mobile/screens/trip/tabs/MCollabPolls.tsx
+++ b/client/src/mobile/screens/trip/tabs/MCollabPolls.tsx
@@ -113,7 +113,8 @@ export default function MCollabPolls({ planner }: MCollabPollsProps) {
const handleVote = useCallback(async (pollId: number, optionIndex: number) => {
try {
const res = (await collabApi.votePoll(tripId, pollId, optionIndex)) as PollResponse
- setPolls(prev => prev.map(p => (p.id === res.poll.id ? res.poll : p)))
+ // Reconcile against the poll we asked about, like handleClosePoll does.
+ setPolls(prev => prev.map(p => (p.id === pollId ? res.poll : p)))
} catch {
toast.error(t('common.error'))
}
diff --git a/client/src/mobile/screens/trip/tabs/MCostsTab.tsx b/client/src/mobile/screens/trip/tabs/MCostsTab.tsx
index 75072a996..360cf8af9 100644
--- a/client/src/mobile/screens/trip/tabs/MCostsTab.tsx
+++ b/client/src/mobile/screens/trip/tabs/MCostsTab.tsx
@@ -9,6 +9,7 @@ import { useSettingsStore } from '../../../../store/settingsStore'
import { useExchangeRates } from '../../../../hooks/useExchangeRates'
import { useTranslation } from '../../../../i18n'
import { formatMoney } from '../../../../utils/formatters'
+import { downloadBlob } from '../../../../utils/fileDownload'
import { budgetApi } from '../../../../api/client'
import MCostSheet from '../sheets/MCostSheet'
import { catMeta, COST_CAT_META } from '../../../../components/Budget/costsCategories'
@@ -113,12 +114,7 @@ export default function MCostsTab({ planner, shell }: MTabScreenProps) {
const handleExportCsv = useCallback(() => {
const { filename, content } = buildCostsCsv(budgetItems, { base, ctx, locale, tripTitle: trip?.title, t })
const blob = new Blob(['' + content], { type: 'text/csv;charset=utf-8;' })
- const url = URL.createObjectURL(blob)
- const a = document.createElement('a')
- a.href = url
- a.download = filename
- a.click()
- URL.revokeObjectURL(url)
+ downloadBlob(blob, filename)
}, [budgetItems, base, ctx, locale, trip?.title, t])
// Header intent signals (spec 03 §3.8 addExpense/csvGo) — increment-only
@@ -215,40 +211,32 @@ export default function MCostsTab({ planner, shell }: MTabScreenProps) {
{/* Settle up (spec §3.4) */}
<div className="mt-2 rounded-2xl border border-[color:var(--m-rowbr)] bg-m-card p-[13px]">
- <div
- role="button"
- tabIndex={0}
- aria-expanded={settleOpen}
- onClick={() => setSettleOpen(v => !v)}
- onKeyDown={e => {
- if (e.key === 'Enter' || e.key === ' ') {
- e.preventDefault()
- setSettleOpen(v => !v)
- }
- }}
- className="flex w-full cursor-pointer items-center gap-[7px]"
- >
- <span className="text-[0.875rem] font-extrabold text-m-ink">{t('costs.settleUp')}</span>
- <CountPill>{flows.length}</CountPill>
- {canEdit ? (
+ {/* Toggle and "Add payment" are siblings, not nested: a control inside a
+ control reads as one element to a screen reader. */}
+ <div className="flex w-full items-center gap-[7px]">
+ <button
+ type="button"
+ aria-expanded={settleOpen}
+ onClick={() => setSettleOpen(v => !v)}
+ className="flex min-w-0 flex-1 items-center gap-[7px] text-left"
+ >
+ <span className="text-[0.875rem] font-extrabold text-m-ink">{t('costs.settleUp')}</span>
+ <CountPill>{flows.length}</CountPill>
+ {settleOpen ? (
+ <ChevronUp size={14} strokeWidth={2} className="ml-auto flex-none text-m-faint" />
+ ) : (
+ <ChevronDown size={14} strokeWidth={2} className="ml-auto flex-none text-m-faint" />
+ )}
+ </button>
+ {canEdit && (
<button
type="button"
- onClick={e => {
- e.stopPropagation()
- setAddPaymentOpen(true)
- }}
- className="ml-auto flex flex-none items-center gap-[5px] rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-[11px] py-[6px] font-[inherit] text-[0.71875rem] font-semibold text-m-muted"
+ onClick={() => setAddPaymentOpen(true)}
+ className="flex flex-none items-center gap-[5px] rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-[11px] py-[6px] font-[inherit] text-[0.71875rem] font-semibold text-m-muted"
>
<Plus size={11} strokeWidth={2.2} />
{t('costs.addPayment')}
</button>
- ) : (
- <span className="ml-auto" />
- )}
- {settleOpen ? (
- <ChevronUp size={14} strokeWidth={2} className="flex-none text-m-faint" />
- ) : (
- <ChevronDown size={14} strokeWidth={2} className="flex-none text-m-faint" />
)}
</div>
diff --git a/client/src/mobile/screens/trip/tabs/MFileLightbox.tsx b/client/src/mobile/screens/trip/tabs/MFileLightbox.tsx
index 873600def..78e940420 100644
--- a/client/src/mobile/screens/trip/tabs/MFileLightbox.tsx
+++ b/client/src/mobile/screens/trip/tabs/MFileLightbox.tsx
@@ -108,7 +108,15 @@ export default function MFileLightbox({ files, index, onIndexChange, onClose, t
</div>
{/* Media + nav */}
- <div className="relative flex min-h-0 flex-1 items-center justify-center" onClick={e => { if (e.target === e.currentTarget) onClose() }}>
+ <div
+ className="relative flex min-h-0 flex-1 items-center justify-center"
+ onClick={e => {
+ if (e.target !== e.currentTarget) return
+ // Without this the click also reaches the overlay handler above.
+ e.stopPropagation()
+ onClose()
+ }}
+ >
{hasPrev && (
<button
type="button"
diff --git a/client/src/mobile/screens/trip/tabs/MFileTrashSheet.tsx b/client/src/mobile/screens/trip/tabs/MFileTrashSheet.tsx
index 8d1faf0e8..109300aae 100644
--- a/client/src/mobile/screens/trip/tabs/MFileTrashSheet.tsx
+++ b/client/src/mobile/screens/trip/tabs/MFileTrashSheet.tsx
@@ -28,6 +28,7 @@ export default function MFileTrashSheet({ planner, open, onClose }: MFileTrashSh
const [files, setFiles] = useState<TripFile[]>([])
const [loading, setLoading] = useState(false)
const [busyId, setBusyId] = useState<number | null>(null)
+ const [emptying, setEmptying] = useState(false)
const [confirmEmpty, setConfirmEmpty] = useState(false)
const [confirmDeleteId, setConfirmDeleteId] = useState<number | null>(null)
@@ -68,11 +69,14 @@ export default function MFileTrashSheet({ planner, open, onClose }: MFileTrashSh
.finally(() => setBusyId(null))
}
+ // Row actions stay disabled while this runs so a restore cannot race the empty.
const emptyTrash = () => {
setConfirmEmpty(false)
+ setEmptying(true)
filesApi.emptyTrash(tripId)
.then(() => { setFiles([]); toast.success(t('files.toast.trashEmptied')) })
.catch(() => toast.error(t('files.toast.deleteError')))
+ .finally(() => setEmptying(false))
}
return (
@@ -88,7 +92,8 @@ export default function MFileTrashSheet({ planner, open, onClose }: MFileTrashSh
<button
type="button"
onClick={() => setConfirmEmpty(true)}
- className="font-geist text-[0.6875rem] font-bold text-[color:var(--m-st-danger)]"
+ disabled={emptying}
+ className="font-geist text-[0.6875rem] font-bold text-[color:var(--m-st-danger)] disabled:opacity-50"
>
{t('files.emptyTrash')}
</button>
@@ -127,7 +132,7 @@ export default function MFileTrashSheet({ planner, open, onClose }: MFileTrashSh
type="button"
aria-label={t('files.restore')}
onClick={() => restore(file.id)}
- disabled={busy}
+ disabled={busy || emptying}
className="flex h-8 w-8 items-center justify-center rounded-full bg-[color:var(--m-ic)] text-m-muted disabled:opacity-50"
>
{busy ? <Loader2 size={13} className="animate-spin" /> : <RotateCcw size={13} strokeWidth={2} />}
@@ -136,7 +141,7 @@ export default function MFileTrashSheet({ planner, open, onClose }: MFileTrashSh
type="button"
aria-label={t('common.delete')}
onClick={() => setConfirmDeleteId(file.id)}
- disabled={busy}
+ disabled={busy || emptying}
className="flex h-8 w-8 items-center justify-center rounded-full bg-[color:var(--m-ic)] text-[color:var(--m-st-danger)] disabled:opacity-50"
>
<Trash2 size={13} strokeWidth={2} />
diff --git a/client/src/mobile/screens/trip/tabs/MFilesTab.tsx b/client/src/mobile/screens/trip/tabs/MFilesTab.tsx
index d0315c637..154490f83 100644
--- a/client/src/mobile/screens/trip/tabs/MFilesTab.tsx
+++ b/client/src/mobile/screens/trip/tabs/MFilesTab.tsx
@@ -60,18 +60,22 @@ export default function MFilesTab({ planner, shell }: MTabScreenProps) {
if (tooBig.length > 0) planner.toast.error(t('files.uploadErrorSize'))
if (okFiles.length === 0) return
setUploading(true)
- try {
- for (const file of okFiles) {
- const fd = new FormData()
- fd.append('file', file)
+ let uploaded = 0
+ const failures: unknown[] = []
+ for (const file of okFiles) {
+ const fd = new FormData()
+ fd.append('file', file)
+ try {
await planner.tripActions.addFile(planner.tripId, fd)
+ uploaded++
+ } catch (err) {
+ // One rejected file must not drop the rest of the batch.
+ failures.push(err)
}
- planner.toast.success(t('files.uploaded', { count: okFiles.length }))
- } catch (err) {
- planner.toast.error(translateApiError(t, err, 'files.uploadError'))
- } finally {
- setUploading(false)
}
+ setUploading(false)
+ if (uploaded > 0) planner.toast.success(t('files.uploaded', { count: uploaded }))
+ if (failures.length > 0) planner.toast.error(translateApiError(t, failures[0], 'files.uploadError'))
}
const onPickFiles = (e: ChangeEvent<HTMLInputElement>) => {
@@ -122,8 +126,8 @@ export default function MFilesTab({ planner, shell }: MTabScreenProps) {
const openRow = (file: TripFile) => {
if (isMedia(file.mime_type)) {
- const idx = mediaFiles.findIndex(f => f.id === file.id)
- setLightboxIndex(idx >= 0 ? idx : 0)
+ // Only rows out of `visible` get here, so the file is always in mediaFiles.
+ setLightboxIndex(mediaFiles.findIndex(f => f.id === file.id))
} else {
// Wallet passes and everything else (PDF/docs) share the same browser-native
// handling as the transport/reservation file chips: openFile() opens PDFs
diff --git a/client/src/mobile/screens/trip/tabs/MPackItemSheet.tsx b/client/src/mobile/screens/trip/tabs/MPackItemSheet.tsx
index c6662732b..820b495bf 100644
--- a/client/src/mobile/screens/trip/tabs/MPackItemSheet.tsx
+++ b/client/src/mobile/screens/trip/tabs/MPackItemSheet.tsx
@@ -41,12 +41,16 @@ export default function MPackItemSheet({
const [weight, setWeight] = useState('')
const [saving, setSaving] = useState(false)
+ // Keyed on the item id, not the object: packingSlice swaps the object on every
+ // update, and a WebSocket refresh must not overwrite what is being typed.
+ const heldId = item?.id
useEffect(() => {
if (!open || !item) return
setName(isPackingPlaceholder(item) ? '' : item.name)
setQuantity(String(item.quantity || 1))
setWeight(item.weight_grams != null ? String(item.weight_grams) : '')
- }, [open, item])
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [open, heldId])
if (!item) {
return <MSheet open={false} onClose={onClose} />
@@ -81,7 +85,6 @@ export default function MPackItemSheet({
const handleSave = async () => {
const trimmedName = name.trim()
- if (!trimmedName || saving) { onClose(); return }
setSaving(true)
try {
const qty = Math.max(1, Math.min(999, parseInt(quantity, 10) || 1))
diff --git a/client/src/mobile/screens/trip/tabs/MPackingListTab.tsx b/client/src/mobile/screens/trip/tabs/MPackingListTab.tsx
index 8eb54cf26..a9d726a23 100644
--- a/client/src/mobile/screens/trip/tabs/MPackingListTab.tsx
+++ b/client/src/mobile/screens/trip/tabs/MPackingListTab.tsx
@@ -221,7 +221,9 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {
const applyTemplate = async (templateId: number) => {
try {
- const data = await packingApi.applyTemplate(tripId, templateId)
+ // Land the items in the list the user is looking at — without the
+ // visibility the API defaults to 'common' and they vanish from My list.
+ const data = await packingApi.applyTemplate(tripId, templateId, view)
useTripStore.setState(s => ({ packingItems: [...s.packingItems, ...(data.items || [])] }))
toast.success(t('packing.templateApplied', { count: data.count }))
setActionsOpen(false)
diff --git a/client/src/mobile/screens/trip/tabs/MTaskSheet.tsx b/client/src/mobile/screens/trip/tabs/MTaskSheet.tsx
index 1f5e24b8b..17f63b6fc 100644
--- a/client/src/mobile/screens/trip/tabs/MTaskSheet.tsx
+++ b/client/src/mobile/screens/trip/tabs/MTaskSheet.tsx
@@ -177,10 +177,10 @@ export default function MTaskSheet({ planner, open, itemId, categories, members,
{cat}
</button>
))}
+ {/* A category nobody else uses yet (stored on this task or just typed)
+ has nothing to switch to — it is the active label, not a choice. */}
{category && !categories.includes(category) && (
- <button type="button" onClick={() => setCategory(category)} className={pillCls(true)}>
- {category}
- </button>
+ <span className={pillCls(true)}>{category}</span>
)}
{!addingCategory ? (
<button
diff --git a/client/src/mobile/screens/trip/tabs/MTodoListTab.tsx b/client/src/mobile/screens/trip/tabs/MTodoListTab.tsx
index 951944bda..028e442a5 100644
--- a/client/src/mobile/screens/trip/tabs/MTodoListTab.tsx
+++ b/client/src/mobile/screens/trip/tabs/MTodoListTab.tsx
@@ -9,12 +9,17 @@ import type { TodoItem, TripMember } from '../../../../types'
import type { TripPlanner } from '../MTripShell'
import { TabScroller } from './tabChrome'
import {
- PRIORITY_COLOR, PRIORITY_LABEL, filterTodoItems, isTodoOverdue, sortTodoRows,
- todoCategories, todoCategoryOpenCount, todoCounts, type TodoFilter,
+ PRIORITY_COLOR, PRIORITY_LABEL, filterTodoItems, filterTodoItemsByCategory, isTodoOverdue,
+ sortTodoRows, todoCategories, todoCategoryOpenCount, todoCounts, type TodoSmartFilter,
} from './listsModel'
import MTaskSheet from './MTaskSheet'
-const BUILTIN_FILTERS: TodoFilter[] = ['all', 'my', 'overdue', 'done']
+const BUILTIN_FILTERS: TodoSmartFilter[] = ['all', 'my', 'overdue', 'done']
+
+// The rail holds two kinds of bucket: the four built-ins, addressed by id, and
+// the category buckets, addressed by name — so a category a user called "all"
+// or "done" gets its own bucket instead of the built-in one.
+type ActiveFilter = { kind: 'smart'; id: TodoSmartFilter } | { kind: 'category'; name: string }
/**
* To-do sub-tab (spec 03 §4.5-4.7): progress card with "New task", the
@@ -29,7 +34,7 @@ export default function MTodoListTab({ planner }: { planner: TripPlanner }) {
const currentUserId = useAuthStore(s => s.user?.id) ?? null
const tripMembers = planner.tripMembers
- const [filter, setFilter] = useState<TodoFilter>('all')
+ const [active, setActive] = useState<ActiveFilter>({ kind: 'smart', id: 'all' })
const [sortByPriority, setSortByPriority] = useState(false)
const [editingItemId, setEditingItemId] = useState<number | null>(null)
const [creatingTask, setCreatingTask] = useState(false)
@@ -38,12 +43,18 @@ export default function MTodoListTab({ planner }: { planner: TripPlanner }) {
const categories = useMemo(() => todoCategories(items), [items])
const counts = todoCounts(items, currentUserId, today)
const rows = useMemo(
- () => sortTodoRows(filterTodoItems(items, filter, currentUserId, today), sortByPriority, today),
- [items, filter, currentUserId, today, sortByPriority],
+ () => sortTodoRows(
+ active.kind === 'category'
+ ? filterTodoItemsByCategory(items, active.name)
+ : filterTodoItems(items, active.id, currentUserId, today),
+ sortByPriority,
+ today,
+ ),
+ [items, active, currentUserId, today, sortByPriority],
)
const pct = items.length > 0 ? Math.round((counts.done / items.length) * 100) : 0
- const defaultCategoryForNew = !BUILTIN_FILTERS.includes(filter) ? filter : null
+ const defaultCategoryForNew = active.kind === 'category' ? active.name : null
const openCreate = () => { setEditingItemId(null); setCreatingTask(true) }
const openEdit = (id: number) => { setCreatingTask(false); setEditingItemId(id) }
@@ -55,9 +66,9 @@ export default function MTodoListTab({ planner }: { planner: TripPlanner }) {
active ? 'bg-m-act text-m-actfg' : 'bg-[color:var(--m-ic)] text-m-ink'
}`
- const filterLabel = (f: TodoFilter) =>
+ const filterLabel = (f: TodoSmartFilter) =>
f === 'all' ? t('todo.filter.all') : f === 'my' ? t('todo.filter.my') : f === 'overdue' ? t('todo.filter.overdue') : t('todo.filter.done')
- const filterCount = (f: TodoFilter) =>
+ const filterCount = (f: TodoSmartFilter) =>
f === 'all' ? counts.open : f === 'my' ? counts.my : f === 'overdue' ? counts.overdue : counts.done
return (
@@ -87,7 +98,12 @@ export default function MTodoListTab({ planner }: { planner: TripPlanner }) {
{items.length > 0 && (
<div className="mt-[10px] flex items-center gap-[6px] overflow-x-auto whitespace-nowrap">
{BUILTIN_FILTERS.map(f => (
- <button key={f} type="button" onClick={() => setFilter(f)} className={filterPill(filter === f)}>
+ <button
+ key={f}
+ type="button"
+ onClick={() => setActive({ kind: 'smart', id: f })}
+ className={filterPill(active.kind === 'smart' && active.id === f)}
+ >
{filterLabel(f)}
<span className="font-geist text-[0.5625rem] opacity-70">{filterCount(f)}</span>
</button>
@@ -103,7 +119,12 @@ export default function MTodoListTab({ planner }: { planner: TripPlanner }) {
</button>
{categories.length > 0 && <span className="h-4 w-px flex-none bg-[color:var(--m-rowbr)]" />}
{categories.map(cat => (
- <button key={cat} type="button" onClick={() => setFilter(cat)} className={filterPill(filter === cat)}>
+ <button
+ key={cat}
+ type="button"
+ onClick={() => setActive({ kind: 'category', name: cat })}
+ className={filterPill(active.kind === 'category' && active.name === cat)}
+ >
{cat}
<span className="font-geist text-[0.5625rem] opacity-70">{todoCategoryOpenCount(items, cat)}</span>
</button>
@@ -160,7 +181,11 @@ function TaskCard({ item, members, today, onToggle, onOpen }: {
const assignee = members.find(m => m.id === item.assigned_user_id)
const prioColor = item.priority ? PRIORITY_COLOR[item.priority] : undefined
const avatarSrcUrl = assignee ? assignee.avatar_url || avatarSrc(assignee.avatar) : null
- const dueLabel = item.due_date ? formatDate(item.due_date, locale) || item.due_date : null
+ // formatDate() renders "Invalid Date" for anything it can't parse — a due date
+ // that isn't a real date stays raw instead.
+ const dueLabel = item.due_date
+ ? (Number.isNaN(Date.parse(`${item.due_date}T00:00:00Z`)) ? item.due_date : formatDate(item.due_date, locale))
+ : null
return (
<div className={`mt-2 flex items-start gap-[10px] rounded-2xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-3 py-[11px] ${done ? 'opacity-60' : ''}`}>
diff --git a/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx b/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx
index 6687387ea..8ada21436 100644
--- a/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx
+++ b/client/src/mobile/screens/trip/tabs/MTransportsTab.tsx
@@ -7,7 +7,7 @@ import { openFile } from '../../../../utils/fileDownload'
import { useTranslation } from '../../../../i18n'
import type { Reservation } from '../../../../types'
import MConfirmSheet from '../../settings/MConfirmSheet'
-import { CountPill, Field, SectionHeader, StatusDot, TabScroller, TravelerAvatars, TravelerFilterRow } from './tabChrome'
+import { ConfirmationCode, CountPill, Field, SectionHeader, StatusDot, TabScroller, TravelerAvatars, TravelerFilterRow } from './tabChrome'
import { STATUS_COLOR, type MTabScreenProps } from './tabModel'
import {
TRANSPORT_TYPE_COLOR,
@@ -205,71 +205,69 @@ function TransportCard({ res, planner, shell, canEdit, compact }: {
)}
</div>
- {/* Body */}
+ {/* Body — split around the booking code so the reveal can be its own
+ control instead of a click handler buried inside the card button. */}
{!compact && (
- <button type="button" onClick={openDetail} className="block w-full px-3 pb-3 pt-[9px] text-left">
- <div className="flex gap-2">
- <Field label={t('reservations.date')} className="flex-[1.4]">{dayValue}</Field>
- <Field label={t('reservations.time')} className="flex-1" tabular>{timeValue}</Field>
- </div>
+ <div className="px-3 pb-3 pt-[9px]">
+ <button type="button" onClick={openDetail} className="block w-full text-left">
+ <div className="flex gap-2">
+ <Field label={t('reservations.date')} className="flex-[1.4]">{dayValue}</Field>
+ <Field label={t('reservations.time')} className="flex-1" tabular>{timeValue}</Field>
+ </div>
+ </button>
{res.confirmation_number && (
- <div className="mt-2">
- <div className="mb-[3px] font-geist text-[0.5625rem] font-bold uppercase tracking-[.08em] text-m-faint">
- {t('reservations.confirmationCode')}
- </div>
- <div
- onClick={e => { if (blurCodes) { e.stopPropagation(); setCodeRevealed(v => !v) } }}
- className={`overflow-hidden text-ellipsis whitespace-nowrap rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px] text-center font-geist text-[0.71875rem] font-semibold tabular-nums text-m-ink ${
- blurCodes && !codeRevealed ? 'blur-[4px] select-none' : ''
- }`}
- >
- {res.confirmation_number}
- </div>
- </div>
+ <ConfirmationCode
+ code={res.confirmation_number}
+ label={t('reservations.confirmationCode')}
+ blurred={!!blurCodes && !codeRevealed}
+ onToggle={blurCodes ? () => setCodeRevealed(v => !v) : undefined}
+ />
)}
- {eps.length >= 2 && (
- <div className="mt-2 flex flex-wrap items-center justify-center gap-2 rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-2 text-[0.71875rem] font-semibold text-m-ink">
- {eps.map((ep, i) => (
- <span key={i} className="inline-flex min-w-0 items-center gap-2">
- {i > 0 && <TypeIcon size={12} strokeWidth={2.2} className="flex-none" style={{ color: typeColor }} />}
- <span className="truncate">{ep.name}</span>
- </span>
- ))}
- </div>
- )}
+ <button type="button" onClick={openDetail} className="block w-full text-left">
+ {eps.length >= 2 && (
+ <div className="mt-2 flex flex-wrap items-center justify-center gap-2 rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-2 text-[0.71875rem] font-semibold text-m-ink">
+ {eps.map((ep, i) => (
+ <span key={i} className="inline-flex min-w-0 items-center gap-2">
+ {i > 0 && <TypeIcon size={12} strokeWidth={2.2} className="flex-none" style={{ color: typeColor }} />}
+ <span className="truncate">{ep.name}</span>
+ </span>
+ ))}
+ </div>
+ )}
- {metaCells.length > 0 && (
- <div className="mt-2 flex gap-2">
- {metaCells.slice(0, 3).map((c, i) => (
- <Field key={i} label={c.label} className="flex-1">{c.value}</Field>
- ))}
- </div>
- )}
+ {metaCells.length > 0 && (
+ <div className="mt-2 flex gap-2">
+ {metaCells.slice(0, 3).map((c, i) => (
+ <Field key={i} label={c.label} className="flex-1">{c.value}</Field>
+ ))}
+ </div>
+ )}
- <TravelerAvatars travelers={res.travelers || []} label={t('reservations.travelers.label')} />
+ <TravelerAvatars travelers={res.travelers || []} label={t('reservations.travelers.label')} />
- {files.length > 0 && (
- <div className="mt-2">
- <div className="mb-[3px] font-geist text-[0.5625rem] font-bold uppercase tracking-[.08em] text-m-faint">
- {t('files.title')}
- </div>
- <div className="flex flex-col gap-1">
- {files.map(f => (
- <span
- key={f.id}
- onClick={e => { e.stopPropagation(); openFile(f.url, f.original_name) }}
- className="flex items-center gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px]"
- >
- <FileText size={12} strokeWidth={2} className="flex-none text-m-muted" />
- <span className="truncate font-geist text-[0.65625rem] font-semibold text-m-muted">{f.original_name}</span>
- </span>
- ))}
+ {files.length > 0 && (
+ <div className="mt-2">
+ <div className="mb-[3px] font-geist text-[0.5625rem] font-bold uppercase tracking-[.08em] text-m-faint">
+ {t('files.title')}
+ </div>
+ <div className="flex flex-col gap-1">
+ {files.map(f => (
+ <span
+ key={f.id}
+ onClick={e => { e.stopPropagation(); openFile(f.url, f.original_name) }}
+ className="flex items-center gap-[6px] rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px]"
+ >
+ <FileText size={12} strokeWidth={2} className="flex-none text-m-muted" />
+ <span className="truncate font-geist text-[0.65625rem] font-semibold text-m-muted">{f.original_name}</span>
+ </span>
+ ))}
+ </div>
</div>
- </div>
- )}
- </button>
+ )}
+ </button>
+ </div>
)}
<MConfirmSheet
diff --git a/client/src/mobile/screens/trip/tabs/listsModel.ts b/client/src/mobile/screens/trip/tabs/listsModel.ts
index aa5b36685..7b54975cc 100644
--- a/client/src/mobile/screens/trip/tabs/listsModel.ts
+++ b/client/src/mobile/screens/trip/tabs/listsModel.ts
@@ -105,7 +105,8 @@ export function isPackingPlaceholder(item: Pick<PackingItem, 'name'>): boolean {
// ── To-do ────────────────────────────────────────────────────────────────
-export type TodoFilter = 'all' | 'my' | 'overdue' | 'done' | string
+export type TodoSmartFilter = 'all' | 'my' | 'overdue' | 'done'
+export type TodoFilter = TodoSmartFilter | string
export function isTodoOverdue(item: TodoItem, today: string): boolean {
return !!item.due_date && !item.checked && item.due_date < today
@@ -120,11 +121,21 @@ export function filterTodoItems(
): TodoItem[] {
if (filter === 'all') return items.filter(i => !i.checked)
if (filter === 'done') return items.filter(i => !!i.checked)
- if (filter === 'my') return items.filter(i => !i.checked && i.assigned_user_id === currentUserId)
+ // No resolved user means nothing is "mine" — matching the todoCounts badge.
+ if (filter === 'my') return currentUserId ? items.filter(i => !i.checked && i.assigned_user_id === currentUserId) : []
if (filter === 'overdue') return items.filter(i => isTodoOverdue(i, today))
return items.filter(i => i.category === filter)
}
+/**
+ * Category bucket, addressed by name instead of through `filterTodoItems` — a
+ * category literally called 'all'/'my'/'overdue'/'done' keeps its own rows
+ * rather than collapsing into the smart filter of the same id.
+ */
+export function filterTodoItemsByCategory(items: TodoItem[], category: string): TodoItem[] {
+ return items.filter(i => i.category === category)
+}
+
/**
* Row order (spec 03 §4.7): done sinks to the end, open-overdue floats to the
* top, and — only while the priority toggle is on — ties break by ascending
diff --git a/client/src/mobile/screens/trip/tabs/tabChrome.tsx b/client/src/mobile/screens/trip/tabs/tabChrome.tsx
index efee8fb8f..d4eaf647e 100644
--- a/client/src/mobile/screens/trip/tabs/tabChrome.tsx
+++ b/client/src/mobile/screens/trip/tabs/tabChrome.tsx
@@ -88,6 +88,33 @@ export function Field({ label, children, className = '', tabular = false }: {
)
}
+/**
+ * Booking code with the optional shoulder-surfing blur (setting
+ * blur_booking_codes). While the blur is on the box is a real button so the
+ * reveal works by keyboard too; without it there is nothing to operate and it
+ * stays a plain value box.
+ */
+export function ConfirmationCode({ code, label, blurred, onToggle }: {
+ code: string
+ label: string
+ blurred: boolean
+ onToggle?: () => void
+}) {
+ const boxCls = `block w-full overflow-hidden text-ellipsis whitespace-nowrap rounded-[10px] border border-[color:var(--m-rowbr)] bg-m-card px-[10px] py-[7px] text-center font-geist text-[0.71875rem] font-semibold tabular-nums text-m-ink ${
+ blurred ? 'blur-[4px] select-none' : ''
+ }`
+ return (
+ <div className="mt-2">
+ <div className="mb-[3px] font-geist text-[0.5625rem] font-bold uppercase tracking-[.08em] text-m-faint">
+ {label}
+ </div>
+ {onToggle
+ ? <button type="button" onClick={onToggle} aria-pressed={!blurred} className={boxCls}>{code}</button>
+ : <div className={boxCls}>{code}</div>}
+ </div>
+ )
+}
+
/** 7px status dot; `color` is a --m-st-* token from STATUS_COLOR. */
export function StatusDot({ color }: { color: string }) {
return <span className="h-[7px] w-[7px] flex-none rounded-full" style={{ background: color }} />
diff --git a/client/src/mobile/screens/vacay/MVacaySettingsSheet.tsx b/client/src/mobile/screens/vacay/MVacaySettingsSheet.tsx
index 6b4cc3a43..fedd97be4 100644
--- a/client/src/mobile/screens/vacay/MVacaySettingsSheet.tsx
+++ b/client/src/mobile/screens/vacay/MVacaySettingsSheet.tsx
@@ -452,8 +452,11 @@ function CalendarEditor({ cal, countries, calendarType = 'public_holiday', onUpd
const { t } = useTranslation()
const [label, setLabel] = useState(cal.label || '')
const [regions, setRegions] = useState<Option[]>([])
- const country = cal.region.split('-')[0]
- const region = cal.region.includes('-') ? cal.region : ''
+ // A school-holiday group carries a `|group:…` suffix — strip it before the
+ // country is read off, otherwise the region lookup finds nothing.
+ const [baseRegion] = cal.region.split('|')
+ const country = baseRegion.split('-')[0]
+ const region = cal.region.includes('|group:') || baseRegion.includes('-') ? cal.region : ''
useEffect(() => { setLabel(cal.label || '') }, [cal.label])
useEffect(() => {
@@ -498,8 +501,9 @@ function AddCalendarDraft({ countries, calendarType = 'public_holiday', onAdd, o
const [label, setLabel] = useState('')
const [regions, setRegions] = useState<Option[]>([])
- const country = region.split('-')[0] || ''
- const selectedRegion = region.includes('-') ? region : ''
+ const [baseRegion] = region.split('|')
+ const country = baseRegion.split('-')[0] || ''
+ const selectedRegion = region.includes('|group:') || baseRegion.includes('-') ? region : ''
useEffect(() => {
if (!country) { setRegions([]); return }
diff --git a/client/src/pages/AtlasPage.tsx b/client/src/pages/AtlasPage.tsx
index 1cf620a33..41ae6874a 100644
--- a/client/src/pages/AtlasPage.tsx
+++ b/client/src/pages/AtlasPage.tsx
@@ -15,55 +15,6 @@ import { getApiErrorMessage } from '../types'
import { useIsPhone } from '../mobile/useIsPhone'
import MAtlas from '../mobile/screens/atlas/MAtlas'
-function MobileStats({ data, stats, countries, resolveName, t, dark }: { data: AtlasData | null; stats: AtlasStats; countries: AtlasCountry[]; resolveName: (code: string) => string; t: TranslationFn; dark: boolean }): React.ReactElement {
- const tp = dark ? '#f1f5f9' : '#0f172a'
- const tf = dark ? '#475569' : '#94a3b8'
- const { continents, lastTrip, nextTrip, streak, firstYear, tripsThisYear } = data || {}
- const CL = { 'Europe': t('atlas.europe'), 'Asia': t('atlas.asia'), 'North America': t('atlas.northAmerica'), 'South America': t('atlas.southAmerica'), 'Africa': t('atlas.africa'), 'Oceania': t('atlas.oceania') }
- const thisYear = new Date().getFullYear()
-
- return (
- <div className="space-y-4">
- {/* Stats grid */}
- <div className="grid grid-cols-5 gap-2">
- {[[stats.totalCountries, t('atlas.countries')], [stats.totalTrips, t('atlas.trips')], [stats.totalPlaces, t('atlas.places')], [stats.totalCities || 0, t('atlas.cities')], [stats.totalDays, t('atlas.days')]].map(([v, l], i) => (
- <div key={i} className="text-center py-2">
- <p className="text-xl font-black tabular-nums" style={{ color: tp }}>{v}</p>
- <p className="text-[9px] font-semibold uppercase tracking-wide" style={{ color: tf }}>{l}</p>
- </div>
- ))}
- </div>
- {/* Continents */}
- <div className="grid grid-cols-6 gap-1">
- {['Europe', 'Asia', 'North America', 'South America', 'Africa', 'Oceania'].map(cont => {
- const count = continents?.[cont] || 0
- return (
- <div key={cont} className="text-center py-1">
- <p className="text-base font-bold tabular-nums" style={{ color: count > 0 ? tp : (dark ? 'rgba(255,255,255,0.15)' : 'rgba(0,0,0,0.12)') }}>{count}</p>
- <p className="text-[8px] font-semibold uppercase" style={{ color: count > 0 ? tf : (dark ? 'rgba(255,255,255,0.1)' : 'rgba(0,0,0,0.08)') }}>{CL[cont]}</p>
- </div>
- )
- })}
- </div>
- {/* Highlights */}
- <div className="flex gap-3">
- {streak > 0 && (
- <div className="text-center flex-1 py-2">
- <p className="text-xl font-black tabular-nums" style={{ color: tp }}>{streak}</p>
- <p className="text-[9px] font-semibold uppercase tracking-wide" style={{ color: tf }}>{streak === 1 ? t('atlas.yearInRow') : t('atlas.yearsInRow')}</p>
- </div>
- )}
- {tripsThisYear > 0 && (
- <div className="text-center flex-1 py-2">
- <p className="text-xl font-black tabular-nums" style={{ color: tp }}>{tripsThisYear}</p>
- <p className="text-[9px] font-semibold uppercase tracking-wide" style={{ color: tf }}>{tripsThisYear === 1 ? t('atlas.tripIn') : t('atlas.tripsIn')} {thisYear}</p>
- </div>
- )}
- </div>
- </div>
- )
-}
-
export default function AtlasPage(): React.ReactElement {
const isPhone = useIsPhone()
return isPhone ? <MAtlas /> : <AtlasPageDesktop />
diff --git a/client/src/pages/DashboardPage.tsx b/client/src/pages/DashboardPage.tsx
index 04f6a4279..290bccf33 100644
--- a/client/src/pages/DashboardPage.tsx
+++ b/client/src/pages/DashboardPage.tsx
@@ -97,18 +97,6 @@ const RES_ICON: Record<string, React.ReactElement> = {
}
const RES_TYPE_CLASS: Record<string, string> = { flight: 'flight', hotel: 'hotel', restaurant: 'food' }
-// Mobile gets a different boarding-pass treatment (separate card under the hero).
-function useIsMobile(): boolean {
- const [mobile, setMobile] = useState(() => typeof window !== 'undefined' && window.matchMedia('(max-width: 720px)').matches)
- useEffect(() => {
- const mq = window.matchMedia('(max-width: 720px)')
- const onChange = () => setMobile(mq.matches)
- mq.addEventListener('change', onChange)
- return () => mq.removeEventListener('change', onChange)
- }, [])
- return mobile
-}
-
export default function DashboardPage(): React.ReactElement {
// Phones get the mobile screen, everything else the untouched desktop page.
// Both branches call hooks of their own, so the split lives above them.
@@ -125,16 +113,16 @@ function DashboardPageDesktop(): React.ReactElement {
loadError, retryLoad,
tripFilter, setTripFilter, viewMode, toggleViewMode,
showForm, setShowForm, editingTrip, setEditingTrip,
- deleteTrip, setDeleteTrip, copyTrip, setCopyTrip, setTrips,
+ deleteTrip, setDeleteTrip, copyTrip, setCopyTrip, applyCoverUpdate,
handleCreate, handleUpdate, confirmDelete, handleArchive, handleUnarchive, confirmCopy,
allSubOpen, setAllSubOpen,
} = useDashboard()
- // Per-device dashboard widget visibility (from the appearance config).
- const isMobile = useIsMobile()
+ // Dashboard widget visibility (from the appearance config). Phones never reach this
+ // component — DashboardPage routes them to MDashboard — so only the desktop set applies.
const appearanceCfg = useSettingsStore(s => s.settings.appearance)
const dashCfg = normalizeAppearance(appearanceCfg).dashboard
- const sideWidgets = isMobile ? dashCfg.mobile : dashCfg.desktop
+ const sideWidgets = dashCfg.desktop
const showCurrency = sideWidgets.currency
const showTimezones = sideWidgets.timezones
const showUpcoming = sideWidgets.upcomingReservations
@@ -145,7 +133,7 @@ function DashboardPageDesktop(): React.ReactElement {
// Only true dashboard widgets belong here — hero mounts on the boarding pass, and
// place-detail/day-detail widgets live inside the planner panels, not the sidebar.
const widgetPlugins = usePluginStore(s => s.plugins).filter(p => p.type === 'widget' && p.slot !== 'hero' && p.slot !== 'place-detail' && p.slot !== 'day-detail' && p.slot !== 'reservation-detail')
- const sidebarVisible = (isMobile || dashCfg.desktop.sidebar) && (showCurrency || showCollections || showTimezones || showUpcoming || widgetPlugins.length > 0)
+ const sidebarVisible = dashCfg.desktop.sidebar && (showCurrency || showCollections || showTimezones || showUpcoming || widgetPlugins.length > 0)
// Plugin-contributed badges on the trip cards (tripCardProvider hook). One fetch for
// all visible cards; only runs when at least one plugin is active. Fail-safe.
@@ -285,7 +273,7 @@ function DashboardPageDesktop(): React.ReactElement {
trip={editingTrip}
onClose={() => { setShowForm(false); setEditingTrip(null) }}
onSave={editingTrip ? handleUpdate : handleCreate}
- onCoverUpdate={(tripId, coverUrl) => setTrips(prev => prev.map(t => t.id === tripId ? { ...t, cover_image: coverUrl } : t))}
+ onCoverUpdate={applyCoverUpdate}
/>
)}
{deleteTrip && (
@@ -318,7 +306,6 @@ function BoardingPassHero({ trip, bundle, locale, onOpen, onEdit, onCopy, onArch
onEdit: () => void; onCopy: () => void; onArchive: () => void; onDelete: () => void
}): React.ReactElement {
const { t } = useTranslation()
- const mobile = useIsMobile()
const heroPlugins = usePluginStore(s => s.plugins).filter(p => p.type === 'widget' && p.slot === 'hero')
const stop = (e: React.MouseEvent, fn: () => void) => { e.stopPropagation(); fn() }
const status = getTripStatus(trip)
@@ -398,7 +385,7 @@ function BoardingPassHero({ trip, bundle, locale, onOpen, onEdit, onCopy, onArch
<div className="places-preview">
{places.slice(0, 3).map(p => (
<div key={p.id} className="place-av">
- <PlaceAvatar place={p} size={mobile ? 24 : 32} category={{ color: p.category_color ?? undefined, icon: p.category_icon ?? undefined }} />
+ <PlaceAvatar place={p} size={32} category={{ color: p.category_color ?? undefined, icon: p.category_icon ?? undefined }} />
</div>
))}
{places.length === 0 && <div className="place-more"><MapPin size={15} /></div>}
@@ -410,7 +397,6 @@ function BoardingPassHero({ trip, bundle, locale, onOpen, onEdit, onCopy, onArch
)
return (
- <>
<section className="hero-trip" onClick={onOpen}>
{trip.cover_image
? <img className="bg" src={trip.cover_image} alt={trip.title} />
@@ -434,24 +420,20 @@ function BoardingPassHero({ trip, bundle, locale, onOpen, onEdit, onCopy, onArch
<h2 className="hero-title">{trip.title}</h2>
</div>
- {!mobile && (
- <div className="hero-pass-wrap">
- {heroPlugins.length > 0 && (
- <div className="hero-pass-overlay" aria-hidden="true">
- {heroPlugins.map(p => (
- <PluginFrame key={p.id} pluginId={p.id} tripId={String(trip.id)} title={p.name} className="hero-overlay-frame" />
- ))}
- </div>
- )}
- <div className="hero-pass" onClick={(e) => { e.stopPropagation(); onOpen() }}>
- <div className="hero-pass-inner">{passCells}</div>
+ <div className="hero-pass-wrap">
+ {heroPlugins.length > 0 && (
+ <div className="hero-pass-overlay" aria-hidden="true">
+ {heroPlugins.map(p => (
+ <PluginFrame key={p.id} pluginId={p.id} tripId={String(trip.id)} title={p.name} className="hero-overlay-frame" />
+ ))}
</div>
+ )}
+ <div className="hero-pass" onClick={(e) => { e.stopPropagation(); onOpen() }}>
+ <div className="hero-pass-inner">{passCells}</div>
</div>
- )}
+ </div>
</div>
</section>
- {mobile && <section className="pass-card" onClick={onOpen}>{passCells}</section>}
- </>
)
}
@@ -471,14 +453,13 @@ function AtlasStats({ stats }: { stats: TravelStats | null }): React.ReactElemen
const { t } = useTranslation()
const distanceUnit = useSettingsStore(s => s.settings.distance_unit) || 'metric'
const appearance = useSettingsStore(s => s.settings.appearance)
- const isMobile = useIsMobile()
const dash = normalizeAppearance(appearance).dashboard
- // Per-device widget visibility. Atlas + distance are desktop-only tiles.
- const showAtlas = !isMobile && dash.desktop.atlas
- const showTrips = isMobile ? dash.mobile.tripsTotal : dash.desktop.tripsTotal
- const showDays = isMobile ? dash.mobile.daysTraveled : dash.desktop.daysTraveled
- const showDistance = !isMobile && dash.desktop.distanceFlown
+ // Widget visibility — this row only ever renders on the desktop page.
+ const showAtlas = dash.desktop.atlas
+ const showTrips = dash.desktop.tripsTotal
+ const showDays = dash.desktop.daysTraveled
+ const showDistance = dash.desktop.distanceFlown
if (!showAtlas && !showTrips && !showDays && !showDistance) return null
// Reflow: the grid spreads the visible tiles to full width (the passport stays
diff --git a/client/src/pages/SharedTripPage.test.tsx b/client/src/pages/SharedTripPage.test.tsx
index e2eceb120..37ea5a9f8 100644
--- a/client/src/pages/SharedTripPage.test.tsx
+++ b/client/src/pages/SharedTripPage.test.tsx
@@ -756,8 +756,8 @@ describe('SharedTripPage', () => {
},
}));
- // The count is the raw assignment count, including the one whose place is gone.
- expect(screen.getByText('4 places')).toBeInTheDocument();
+ // The count matches the rendered rows — the assignment whose place is gone is left out.
+ expect(screen.getByText('3 places')).toBeInTheDocument();
fireEvent.click(screen.getByText('Day One'));
await waitFor(() => expect(screen.getByText('Rue de Rivoli')).toBeInTheDocument());
diff --git a/client/src/pages/SharedTripPage.tsx b/client/src/pages/SharedTripPage.tsx
index 554e59530..839dfea0c 100644
--- a/client/src/pages/SharedTripPage.tsx
+++ b/client/src/pages/SharedTripPage.tsx
@@ -425,6 +425,9 @@ export default function SharedTripPage() {
<div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
{sortedDays.map((day: any, di: number) => {
const da = assignments[String(day.id)] || [];
+ // A share can still carry an assignment for a deleted place. The timeline
+ // skips those rows, so the header must not count them either.
+ const dayPlaceCount = da.filter((a: any) => a.place).length;
const notes = dayNotes[String(day.id)] || [];
const dayAssignmentIds: number[] = da.map((a: any) => a.id);
const dayTransport = getTransportForDay({
@@ -514,7 +517,7 @@ export default function SharedTripPage() {
</span>
))}
<span className="text-[#9ca3af]" style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))' }}>
- {da.length} {t('shared.places')}
+ {dayPlaceCount} {t('shared.places')}
</span>
</div>
diff --git a/client/src/pages/TripPlannerPage.tsx b/client/src/pages/TripPlannerPage.tsx
index 120b568da..087c21191 100644
--- a/client/src/pages/TripPlannerPage.tsx
+++ b/client/src/pages/TripPlannerPage.tsx
@@ -633,7 +633,7 @@ function TripPlannerPageDesktop(): React.ReactElement | null {
</div>
<div style={{ flex: 1, overflow: 'auto', paddingBottom: 'env(safe-area-inset-bottom, 0px)' }}>
{mobileSidebarOpen === 'left'
- ? <DayPlanSidebar tripId={tripId} trip={trip} days={days} places={places} categories={categories} assignments={assignments} selectedDayId={selectedDayId} selectedPlaceId={selectedPlaceId} selectedAssignmentId={selectedAssignmentId} onSelectDay={(id) => { handleSelectDay(id); setMobileSidebarOpen(null) }} onPlaceClick={(placeId, assignmentId) => { handlePlaceClick(placeId, assignmentId) }} onReorder={handleReorder} onReorderDays={handleReorderDays} onAddDay={handleAddDay} onUpdateDayTitle={handleUpdateDayTitle} onAssignToDay={handleAssignToDay} onRouteCalculated={(r) => { if (r) { setRoute([r.coordinates]); setRouteInfo(r) } }} reservations={reservations} visibleConnectionIds={visibleConnections} onToggleConnection={toggleConnection} allConnectionsShown={allConnectionsShown} onToggleAllConnections={toggleAllConnections} onAddReservation={(dayId) => { setEditingReservation(null); tripActions.setSelectedDay(dayId); setShowReservationModal(true); setMobileSidebarOpen(null) }} onAddTransport={can('day_edit', trip) ? (dayId) => { setTransportModalDayId(dayId); setEditingTransport(null); setTransitPrefill(null); setTransportModalAutomated(false); setShowTransportModal(true); setMobileSidebarOpen(null) } : undefined} onOpenTransit={(r) => { setTransitJourney(r); setMobileSidebarOpen(null) }} onPlanTransit={can('day_edit', trip) && tripHasDates ? (dayId) => { setTransportModalDayId(dayId); setEditingTransport(null); setTransitPrefill(null); setTransportModalAutomated(true); setShowTransportModal(true); setMobileSidebarOpen(null) } : undefined} onAddPlace={() => { setEditingPlace(null); setShowPlaceForm(true); setMobileSidebarOpen(null) }} onDayDetail={(day) => { setShowDayDetail(day); setSelectedPlaceId(null); selectAssignment(null) }} onRemoveAssignment={handleRemoveAssignment} onEditPlace={(place, assignmentId) => { setEditingPlace(place); setEditingAssignmentId(assignmentId || null); setShowPlaceForm(true); setMobileSidebarOpen(null) }} onDeletePlace={(placeId) => handleDeletePlace(placeId)} accommodations={tripAccommodations} routeShown={routeShown} routeProfile={routeProfile} onToggleRoute={() => setRouteShown(v => !v)} onSetRouteProfile={setRouteProfile} onNavigateToFiles={() => { setMobileSidebarOpen(null); handleTabChange('dateien') }} onExpandedDaysChange={setExpandedDayIds} pushUndo={pushUndo} canUndo={canUndo} lastActionLabel={lastActionLabel} onUndo={handleUndo} onEditTransport={can('day_edit', trip) ? (reservation) => { setEditingTransport(reservation); setTransportModalDayId(reservation.day_id ?? null); setShowTransportModal(true); setMobileSidebarOpen(null) } : undefined} onEditReservation={can('reservation_edit', trip) ? (r) => { setEditingReservation(r); setShowReservationModal(true); setMobileSidebarOpen(null) } : undefined} initialScrollTop={mobilePlanScrollTopRef.current} onScrollTopChange={(top) => { mobilePlanScrollTopRef.current = top }} showRouteToolsWhenExpanded isMobile />
+ ? <DayPlanSidebar tripId={tripId} trip={trip} days={days} places={places} categories={categories} assignments={assignments} selectedDayId={selectedDayId} selectedPlaceId={selectedPlaceId} selectedAssignmentId={selectedAssignmentId} onSelectDay={(id) => { handleSelectDay(id); setMobileSidebarOpen(null) }} onPlaceClick={(placeId, assignmentId) => { handlePlaceClick(placeId, assignmentId) }} onReorder={handleReorder} onReorderDays={handleReorderDays} onAddDay={handleAddDay} onUpdateDayTitle={handleUpdateDayTitle} onAssignToDay={handleAssignToDay} onRouteCalculated={(r) => { if (r) { setRoute([r.coordinates]); setRouteInfo(r) } else { setRoute(null); setRouteInfo(null) } }} reservations={reservations} visibleConnectionIds={visibleConnections} onToggleConnection={toggleConnection} allConnectionsShown={allConnectionsShown} onToggleAllConnections={toggleAllConnections} onAddReservation={(dayId) => { setEditingReservation(null); tripActions.setSelectedDay(dayId); setShowReservationModal(true); setMobileSidebarOpen(null) }} onAddTransport={can('day_edit', trip) ? (dayId) => { setTransportModalDayId(dayId); setEditingTransport(null); setTransitPrefill(null); setTransportModalAutomated(false); setShowTransportModal(true); setMobileSidebarOpen(null) } : undefined} onOpenTransit={(r) => { setTransitJourney(r); setMobileSidebarOpen(null) }} onPlanTransit={can('day_edit', trip) && tripHasDates ? (dayId) => { setTransportModalDayId(dayId); setEditingTransport(null); setTransitPrefill(null); setTransportModalAutomated(true); setShowTransportModal(true); setMobileSidebarOpen(null) } : undefined} onAddPlace={() => { setEditingPlace(null); setShowPlaceForm(true); setMobileSidebarOpen(null) }} onDayDetail={(day) => { setShowDayDetail(day); setSelectedPlaceId(null); selectAssignment(null) }} onRemoveAssignment={handleRemoveAssignment} onEditPlace={(place, assignmentId) => { setEditingPlace(place); setEditingAssignmentId(assignmentId || null); setShowPlaceForm(true); setMobileSidebarOpen(null) }} onDeletePlace={(placeId) => handleDeletePlace(placeId)} accommodations={tripAccommodations} routeShown={routeShown} routeProfile={routeProfile} onToggleRoute={() => setRouteShown(v => !v)} onSetRouteProfile={setRouteProfile} onNavigateToFiles={() => { setMobileSidebarOpen(null); handleTabChange('dateien') }} onExpandedDaysChange={setExpandedDayIds} pushUndo={pushUndo} canUndo={canUndo} lastActionLabel={lastActionLabel} onUndo={handleUndo} onEditTransport={can('day_edit', trip) ? (reservation) => { setEditingTransport(reservation); setTransportModalDayId(reservation.day_id ?? null); setShowTransportModal(true); setMobileSidebarOpen(null) } : undefined} onEditReservation={can('reservation_edit', trip) ? (r) => { setEditingReservation(r); setShowReservationModal(true); setMobileSidebarOpen(null) } : undefined} initialScrollTop={mobilePlanScrollTopRef.current} onScrollTopChange={(top) => { mobilePlanScrollTopRef.current = top }} showRouteToolsWhenExpanded isMobile />
: <PlacesSidebar tripId={tripId} places={places} categories={categories} assignments={assignments} selectedDayId={selectedDayId} selectedPlaceId={selectedPlaceId} onPlaceClick={(placeId) => { handlePlaceClick(placeId); setMobileSidebarOpen(null) }} onAddPlace={() => { setEditingPlace(null); setShowPlaceForm(true); setMobileSidebarOpen(null) }} onAssignToDay={handleAssignToDay} onEditPlace={(place) => { openPlaceEditor(place); setMobileSidebarOpen(null) }} onDeletePlace={(placeId) => handleDeletePlace(placeId)} onBulkDeletePlaces={(ids) => setDeletePlaceIds(ids)} onBulkDeleteConfirm={(ids) => confirmDeletePlaces(ids)} onBulkChangeCategory={(ids, catId) => confirmChangeCategory(ids, catId)} days={days} isMobile pushUndo={pushUndo} initialScrollTop={mobilePlacesScrollTopRef.current} onScrollTopChange={(top) => { mobilePlacesScrollTopRef.current = top }} />
}
</div>
@@ -705,7 +705,7 @@ function TripPlannerPageDesktop(): React.ReactElement | null {
files={files || []}
onUpload={(fd) => tripActions.addFile(tripId, fd)}
onDelete={(id) => tripActions.deleteFile(tripId, id)}
- onUpdate={(id, data) => tripActions.loadFiles(tripId)}
+ onUpdate={() => tripActions.loadFiles(tripId)}
places={places}
days={days}
assignments={assignments}
diff --git a/client/src/pages/TripPlannerPage.wiring.test.tsx b/client/src/pages/TripPlannerPage.wiring.test.tsx
index 9008184b4..e6db18098 100644
--- a/client/src/pages/TripPlannerPage.wiring.test.tsx
+++ b/client/src/pages/TripPlannerPage.wiring.test.tsx
@@ -741,7 +741,11 @@ describe('TripPlannerPage — mobile drawers', () => {
act(() => { props('dayPlan').onRouteCalculated({ coordinates: [[1, 2]] }) })
expect(hookState.setRoute).toHaveBeenCalled()
+
+ // clearing from the drawer resets both slots, same as the desktop sidebar
act(() => { props('dayPlan').onRouteCalculated(null) })
+ expect(hookState.setRoute).toHaveBeenLastCalledWith(null)
+ expect(hookState.setRouteInfo).toHaveBeenLastCalledWith(null)
act(() => { props('dayPlan').onAddReservation(7) })
act(() => { props('dayPlan').onAddTransport(7) })
diff --git a/client/src/pages/admin/AdminNotificationsPanel.test.tsx b/client/src/pages/admin/AdminNotificationsPanel.test.tsx
index 0a034725a..9b9696f67 100644
--- a/client/src/pages/admin/AdminNotificationsPanel.test.tsx
+++ b/client/src/pages/admin/AdminNotificationsPanel.test.tsx
@@ -3,7 +3,7 @@ import { http, HttpResponse } from 'msw';
import React from 'react';
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
import { server } from '../../../tests/helpers/msw/server';
-import { fireEvent, render, screen, waitFor } from '../../../tests/helpers/render';
+import { act, fireEvent, render, screen, waitFor } from '../../../tests/helpers/render';
import { buildAdminToast } from '../../../tests/helpers/mobileAdmin';
import { resetAllStores } from '../../../tests/helpers/store';
import { useTranslation } from '../../i18n';
@@ -180,4 +180,31 @@ describe('AdminNotificationsPanel', () => {
expect(await screen.findByText('In-App')).toBeInTheDocument();
expect(screen.queryByText('Ntfy')).not.toBeInTheDocument();
});
+
+ it('FE-ADMMTX-012: a failing save keeps a toggle that succeeded before it', async () => {
+ servePreferences(matrix());
+ const bodies: Record<string, unknown>[] = [];
+ server.use(
+ http.put('/api/admin/notification-preferences', async ({ request }) => {
+ bodies.push((await request.json()) as Record<string, unknown>);
+ return bodies.length === 1 ? HttpResponse.json({ success: true }) : HttpResponse.json({}, { status: 500 });
+ })
+ );
+ const toast = renderPanel();
+
+ await screen.findByText('New version available');
+ const [inappToggle, emailToggle] = screen.getAllByRole('button');
+
+ // Both clicks land before React re-renders, so the second handler still sees the
+ // preferences of the first render.
+ await act(async () => {
+ fireEvent.click(inappToggle); // on -> off, succeeds
+ fireEvent.click(emailToggle); // off -> on, fails
+ });
+
+ await waitFor(() => expect(toast.error).toHaveBeenCalledWith('Error'));
+ expect(bodies[1]).toEqual({ version_available: { inapp: false, email: true } });
+ expect(emailToggle.className).toContain('bg-edge');
+ expect(inappToggle.className).toContain('bg-edge');
+ });
});
diff --git a/client/src/pages/admin/AdminNotificationsPanel.tsx b/client/src/pages/admin/AdminNotificationsPanel.tsx
index a78dbd3a6..d9173075f 100644
--- a/client/src/pages/admin/AdminNotificationsPanel.tsx
+++ b/client/src/pages/admin/AdminNotificationsPanel.tsx
@@ -1,4 +1,4 @@
-import React, { useEffect, useState } from 'react'
+import React, { useEffect, useRef, useState } from 'react'
import { adminApi } from '../../api/client'
import { useToast } from '../../components/shared/Toast'
import { ADMIN_EVENT_LABEL_KEYS, ADMIN_CHANNEL_LABEL_KEYS } from './AdminPage.constants'
@@ -8,9 +8,20 @@ import { ADMIN_EVENT_LABEL_KEYS, ADMIN_CHANNEL_LABEL_KEYS } from './AdminPage.co
export default function AdminNotificationsPanel({ t, toast }: { t: (k: string) => string; toast: ReturnType<typeof useToast> }) {
const [matrix, setMatrix] = useState<any>(null)
const [saving, setSaving] = useState(false)
+ // Toggles fire faster than React re-renders, so the live preferences are mirrored in a
+ // ref. Reading state out of the render closure would let a second toggle undo the first.
+ const prefsRef = useRef<any>(null)
+
+ const writePrefs = (prefs: any) => {
+ prefsRef.current = prefs
+ setMatrix((m: any) => m ? { ...m, preferences: prefs } : m)
+ }
useEffect(() => {
- adminApi.getNotificationPreferences().then((data: any) => setMatrix(data)).catch(() => {})
+ adminApi.getNotificationPreferences().then((data: any) => {
+ prefsRef.current = data.preferences
+ setMatrix(data)
+ }).catch(() => {})
}, [])
if (!matrix) return <p className="text-content-faint" style={{ fontSize: 'calc(12px * var(--fs-scale-body, 1))', fontStyle: 'italic', padding: 16 }}>Loading…</p>
@@ -24,14 +35,17 @@ export default function AdminNotificationsPanel({ t, toast }: { t: (k: string) =
})
const toggle = async (eventType: string, channel: string) => {
- const current = matrix.preferences[eventType]?.[channel] ?? true
- const updated = { ...matrix.preferences, [eventType]: { ...matrix.preferences[eventType], [channel]: !current } }
- setMatrix((m: any) => m ? { ...m, preferences: updated } : m)
+ const before = prefsRef.current ?? matrix.preferences
+ const current = before[eventType]?.[channel] ?? true
+ const updated = { ...before, [eventType]: { ...before[eventType], [channel]: !current } }
+ writePrefs(updated)
setSaving(true)
try {
await adminApi.updateNotificationPreferences(updated)
} catch {
- setMatrix((m: any) => m ? { ...m, preferences: matrix.preferences } : m)
+ // Revert this cell only — a toggle that already went through keeps its value.
+ const latest = prefsRef.current ?? updated
+ writePrefs({ ...latest, [eventType]: { ...latest[eventType], [channel]: current } })
toast.error(t('common.error'))
} finally {
setSaving(false)
diff --git a/client/src/pages/admin/AdminNotificationsTab.tsx b/client/src/pages/admin/AdminNotificationsTab.tsx
index 532020163..06e859990 100644
--- a/client/src/pages/admin/AdminNotificationsTab.tsx
+++ b/client/src/pages/admin/AdminNotificationsTab.tsx
@@ -244,8 +244,9 @@ export default function AdminNotificationsTab({ admin, t }: AdminNotificationsTa
</button>
<button
onClick={async () => {
+ // A masked value means the URL only lives on the server — send no url and let
+ // the server test the stored one instead of pre-saving the mask.
const url = smtpValues.admin_webhook_url === '••••••••' ? undefined : smtpValues.admin_webhook_url
- if (!url && smtpValues.admin_webhook_url !== '••••••••') return
try {
if (url) await authApi.updateAppSettings({ admin_webhook_url: url }).catch(() => {})
const result = await notificationsApi.testWebhook(url)
diff --git a/client/src/pages/admin/useAdmin.test.tsx b/client/src/pages/admin/useAdmin.test.tsx
index 43f3f294d..d5825d763 100644
--- a/client/src/pages/admin/useAdmin.test.tsx
+++ b/client/src/pages/admin/useAdmin.test.tsx
@@ -579,6 +579,24 @@ describe('useAdmin', () => {
});
});
+ it('FE-ADMHOOK-036b: handleSaveUser does nothing without a user in the editor', async () => {
+ let called = false;
+ server.use(
+ http.put('/api/admin/users/:id', () => {
+ called = true;
+ return HttpResponse.json({ user: buildUser({}) });
+ })
+ );
+ const { result } = await mountAdmin();
+
+ await act(async () => {
+ await result.current.handleSaveUser();
+ });
+
+ expect(called).toBe(false);
+ expect(toastCalls).toEqual([]);
+ });
+
it('FE-ADMHOOK-036: handleSaveUser sends the trimmed fields and replaces the row', async () => {
let body: Record<string, unknown> | null = null;
server.use(
diff --git a/client/src/pages/admin/useAdmin.ts b/client/src/pages/admin/useAdmin.ts
index 3f3d57dbe..0b9c35f4a 100644
--- a/client/src/pages/admin/useAdmin.ts
+++ b/client/src/pages/admin/useAdmin.ts
@@ -319,6 +319,7 @@ export function useAdmin() {
}
const handleSaveUser = async () => {
+ if (!editingUser) return
try {
const payload: { username?: string; email?: string; role: string; password?: string } = {
username: editForm.username.trim() || undefined,
diff --git a/client/src/pages/atlas/useAtlas.ts b/client/src/pages/atlas/useAtlas.ts
index eba7ebc2c..cee3fb7fa 100644
--- a/client/src/pages/atlas/useAtlas.ts
+++ b/client/src/pages/atlas/useAtlas.ts
@@ -24,7 +24,7 @@ function useCountryNames(language: string): (code: string) => string {
* loading, the Leaflet map lifecycle (country + sub-national region layers,
* bucket markers, viewport-driven region fetching), country/region mark/unmark
* flows and the country search. AtlasPage stays a wiring container that renders
- * the returned state via its presentational SidebarContent/MobileStats helpers.
+ * the returned state via its presentational SidebarContent helper.
* Behaviour is identical to the previous in-component logic.
*/
export function useAtlas() {
@@ -351,7 +351,6 @@ export function useAtlas() {
<span style="font-size:12px;font-weight:700">${formatDate(c.lastVisit)}</span>
</div>
</div>
- </div>
</div>`
layer.bindTooltip(tooltipHtml, {
// sticky so the tooltip tracks the cursor; non-sticky anchors it at the feature's
@@ -596,7 +595,6 @@ export function useAtlas() {
setConfirmActionRef.current = setConfirmAction
const handleUnmarkCountry = (code: string): void => {
- const country = data?.countries.find(c => c.code === code)
setConfirmAction({ type: 'unmark', code, name: resolveName(code) })
}
diff --git a/client/src/pages/dashboard/useDashboard.test.tsx b/client/src/pages/dashboard/useDashboard.test.tsx
index 2b9d1bd2a..9d382cede 100644
--- a/client/src/pages/dashboard/useDashboard.test.tsx
+++ b/client/src/pages/dashboard/useDashboard.test.tsx
@@ -322,4 +322,17 @@ describe('useDashboard', () => {
expect(result.current.spotlight).toBeNull();
expect(result.current.heroBundle).toBeNull();
});
+
+ it('FE-HOOK-DASH-026: a new cover reaches the active and the archived list', async () => {
+ const { result } = await mountLoaded();
+
+ act(() => result.current.applyCoverUpdate(101, '/uploads/covers/new-paris.jpg'));
+ act(() => result.current.applyCoverUpdate(103, '/uploads/covers/new-rome.jpg'));
+
+ act(() => result.current.setTripFilter('completed'));
+ expect(result.current.gridTrips[0].cover_image).toBe('/uploads/covers/new-paris.jpg');
+
+ act(() => result.current.setTripFilter('archive'));
+ expect(result.current.gridTrips[0].cover_image).toBe('/uploads/covers/new-rome.jpg');
+ });
});
diff --git a/client/src/pages/dashboard/useDashboard.ts b/client/src/pages/dashboard/useDashboard.ts
index 478ec9b89..7852a859e 100644
--- a/client/src/pages/dashboard/useDashboard.ts
+++ b/client/src/pages/dashboard/useDashboard.ts
@@ -185,6 +185,13 @@ export function useDashboard() {
setCopyTrip(null)
}
+ // The cover can be swapped from the archive filter too, so patch both lists.
+ const applyCoverUpdate = (tripId: number, coverUrl: string) => {
+ const patch = (list: DashboardTrip[]) => list.map(t => t.id === tripId ? { ...t, cover_image: coverUrl } : t)
+ setTrips(patch)
+ setArchivedTrips(patch)
+ }
+
const gridTrips = tripFilter === 'archive' ? archivedTrips
: tripFilter === 'completed' ? rest.filter(t => getTripStatus(t) === 'past')
: rest.filter(t => getTripStatus(t) !== 'past')
@@ -198,7 +205,7 @@ export function useDashboard() {
// ui state
tripFilter, setTripFilter, viewMode, toggleViewMode,
showForm, setShowForm, editingTrip, setEditingTrip,
- deleteTrip, setDeleteTrip, copyTrip, setCopyTrip, setTrips,
+ deleteTrip, setDeleteTrip, copyTrip, setCopyTrip, applyCoverUpdate,
allSubOpen, setAllSubOpen,
// actions
handleCreate, handleUpdate, confirmDelete, handleArchive, handleUnarchive, confirmCopy,
diff --git a/client/src/pages/journeyDetail/useJourneyDetail.test.tsx b/client/src/pages/journeyDetail/useJourneyDetail.test.tsx
index a1755d973..704c8be07 100644
--- a/client/src/pages/journeyDetail/useJourneyDetail.test.tsx
+++ b/client/src/pages/journeyDetail/useJourneyDetail.test.tsx
@@ -301,12 +301,10 @@ describe('useJourneyDetail', () => {
],
}));
setup();
- // Three consecutive days for the closed trip, nothing for the open-ended one.
- // The keys themselves are UTC-shifted (see report), so assert the shape.
+ // Three days for the closed trip, nothing for the open-ended one. The keys are local
+ // dates, so they match the trip's own start/end regardless of the runner's timezone.
await waitFor(() => expect(latest.tripDates.size).toBe(3));
- const dates = [...latest.tripDates].sort();
- expect(new Date(dates[2]).getTime() - new Date(dates[0]).getTime()).toBe(2 * 86400000);
- expect(dates.some(d => d.startsWith('2026-06'))).toBe(false);
+ expect([...latest.tripDates].sort()).toEqual(['2026-05-01', '2026-05-02', '2026-05-03']);
});
it('FE-JRN-DETHOOK-020: the desktop two-pane layout locks body scroll and restores it', async () => {
diff --git a/client/src/pages/journeyDetail/useJourneyDetail.ts b/client/src/pages/journeyDetail/useJourneyDetail.ts
index 05cd303ad..f6737b13d 100644
--- a/client/src/pages/journeyDetail/useJourneyDetail.ts
+++ b/client/src/pages/journeyDetail/useJourneyDetail.ts
@@ -262,12 +262,15 @@ export function useJourneyDetail() {
const tripDates = useMemo(() => {
const dates = new Set<string>()
if (!current?.trips) return dates
+ // The days are walked in local time, so the key has to be built from the local parts —
+ // toISOString() would shift the whole range by a day in every timezone east of UTC.
+ const dateKey = (d: Date) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`
for (const trip of current.trips) {
if (!trip.start_date || !trip.end_date) continue
const start = new Date(trip.start_date + 'T00:00:00')
const end = new Date(trip.end_date + 'T00:00:00')
for (let d = new Date(start); d <= end; d.setDate(d.getDate() + 1)) {
- dates.add(d.toISOString().split('T')[0])
+ dates.add(dateKey(d))
}
}
return dates
diff --git a/client/src/pages/tripPlanner/useTripPlanner.test.tsx b/client/src/pages/tripPlanner/useTripPlanner.test.tsx
index cabea0af8..71f142a2d 100644
--- a/client/src/pages/tripPlanner/useTripPlanner.test.tsx
+++ b/client/src/pages/tripPlanner/useTripPlanner.test.tsx
@@ -396,8 +396,10 @@ describe('useTripPlanner — tabs', () => {
})
it('FE-TP-HOOK-016: switching to the Costs tab loads the budget items and persists the tab', async () => {
+ vi.mocked(addonsApi.enabled).mockResolvedValue({ addons: [{ id: 'budget' }] })
seedTrip()
const { result } = await renderPlanner()
+ await waitFor(() => expect(result.current.TRIP_TABS.map(t => t.id)).toContain('finanzplan'))
act(() => { result.current.handleTabChange('finanzplan') })
@@ -428,6 +430,18 @@ describe('useTripPlanner — tabs', () => {
expect(sessionStorage.getItem('trip-tab-42')).toBe('plan')
})
+ it('FE-TP-HOOK-018b: a tab set programmatically is re-validated on the spot', async () => {
+ usePluginStore.setState({ plugins: [], loaded: true })
+ seedTrip()
+
+ const { result } = await renderPlanner()
+
+ act(() => { result.current.setActiveTab('plugin:ghost') })
+
+ await waitFor(() => expect(result.current.activeTab).toBe('plan'))
+ expect(sessionStorage.getItem('trip-tab-42')).toBe('plan')
+ })
+
it('FE-TP-HOOK-019: a positioned trip-page plugin splices its tab and can replace a core tab', async () => {
usePluginStore.setState({
plugins: [
diff --git a/client/src/pages/tripPlanner/useTripPlanner.ts b/client/src/pages/tripPlanner/useTripPlanner.ts
index ff0a356ce..f3d8a0834 100644
--- a/client/src/pages/tripPlanner/useTripPlanner.ts
+++ b/client/src/pages/tripPlanner/useTripPlanner.ts
@@ -151,7 +151,7 @@ export function useTripPlanner() {
setActiveTab('plan')
sessionStorage.setItem(`trip-tab-${tripId}`, 'plan')
}
- }, [enabledAddons, tripPluginIds, pluginsLoaded])
+ }, [activeTab, enabledAddons, tripPluginIds, pluginsLoaded])
const handleTabChange = (rawTabId: string): void => {
// A core tab a plugin replaced is gone from the bar, but a programmatic jump
@@ -365,7 +365,7 @@ export function useTripPlanner() {
for (const [dayId, dayAssignments] of Object.entries(assignments)) {
if (expandedDayIds.has(Number(dayId))) {
for (const a of dayAssignments) {
- hiddenPlaceIds.delete(a.place?.id)
+ if (a.place?.id) hiddenPlaceIds.delete(a.place.id)
}
}
}
diff --git a/client/src/repo/placeRepo.offline.test.ts b/client/src/repo/placeRepo.offline.test.ts
index 0c29a9d67..41b6e608b 100644
--- a/client/src/repo/placeRepo.offline.test.ts
+++ b/client/src/repo/placeRepo.offline.test.ts
@@ -77,10 +77,13 @@ describe('placeRepo.update — offline', () => {
expect(mutation.tempEntityId).toBe(-5)
})
- it('FE-REPO-PLACE-005: nothing cached — still produces an optimistic row and a null token', async () => {
+ it('FE-REPO-PLACE-005: nothing cached — the optimistic row still carries its trip_id', async () => {
const { place } = await placeRepo.update(3, '91', { name: 'Ghost' })
- expect(place).toEqual({ name: 'Ghost', id: 91 })
+ expect(place).toEqual({ name: 'Ghost', id: 91, trip_id: 3 })
expect((await offlineDb.places.get(91))!.name).toBe('Ghost')
+ // Without trip_id the row would be invisible to every where('trip_id') read
+ // and would survive clearTripData() forever.
+ expect(await offlineDb.places.where('trip_id').equals(3).toArray()).toHaveLength(1)
const [mutation] = await queue()
expect(mutation.baseUpdatedAt).toBeNull()
diff --git a/client/src/repo/placeRepo.ts b/client/src/repo/placeRepo.ts
index 12a654d1d..6b86063dc 100644
--- a/client/src/repo/placeRepo.ts
+++ b/client/src/repo/placeRepo.ts
@@ -50,7 +50,15 @@ export const placeRepo = {
async update(tripId: number | string, id: number | string, data: Record<string, unknown>): Promise<{ place: Place }> {
if (isEffectivelyOffline()) {
const existing = await offlineDb.places.get(Number(id))
- const optimistic: Place = { ...(existing ?? {} as Place), ...(data as Partial<Place>), id: Number(id) }
+ // trip_id has to be there even when nothing was cached: every read goes
+ // through places.where('trip_id'), and clearTripData() evicts by it too —
+ // a row without it is invisible and never cleaned up.
+ const optimistic: Place = {
+ ...(existing ?? {} as Place),
+ ...(data as Partial<Place>),
+ id: Number(id),
+ trip_id: Number(tripId),
+ }
await offlineDb.places.put(optimistic)
const mutId = generateUUID()
const isTemp = Number(id) < 0
diff --git a/client/src/store/collectionStore.test.ts b/client/src/store/collectionStore.test.ts
index 246d2bcf7..05dcc3d9b 100644
--- a/client/src/store/collectionStore.test.ts
+++ b/client/src/store/collectionStore.test.ts
@@ -1,4 +1,4 @@
-// FE-STORE-COLLECTION-001 to FE-STORE-COLLECTION-055
+// FE-STORE-COLLECTION-001 to FE-STORE-COLLECTION-062
//
// The store owns the optimistic updates (status, labels, reorder, bulk delete) and the
// reload chains that follow every mutation, so the API layer is mocked here and the
@@ -310,6 +310,8 @@ describe('collectionStore — list CRUD', () => {
activeId: 1,
places: [buildPlace()],
members: [{ user_id: 5, username: 'bob', status: 'accepted' }],
+ labels: [{ id: 3, collection_id: 1, name: 'Food' }],
+ labelFilter: [3],
})
await store().deleteCollection(1)
@@ -318,6 +320,9 @@ describe('collectionStore — list CRUD', () => {
expect(store().activeId).toBeNull()
expect(store().places).toEqual([])
expect(store().members).toEqual([])
+ // Labels belong to the deleted list, so they go with it.
+ expect(store().labels).toEqual([])
+ expect(store().labelFilter).toEqual([])
expect(collectionsApi.list).toHaveBeenCalled()
})
@@ -464,6 +469,31 @@ describe('collectionStore — place mutations', () => {
expect(collectionsApi.deleteMany).toHaveBeenCalledWith([10, 11])
})
+ it('FE-STORE-COLLECTION-056: deletePlace() puts the row back when the server refuses', async () => {
+ useCollectionStore.setState({ places: [buildPlace({ id: 10 }), buildPlace({ id: 11 })] })
+ vi.mocked(collectionsApi.deletePlace).mockRejectedValue(new Error('nope'))
+
+ await expect(store().deletePlace(10)).rejects.toThrow('nope')
+
+ expect(store().places.map(p => p.id)).toEqual([10, 11])
+ expect(collectionsApi.list).not.toHaveBeenCalled()
+ })
+
+ it('FE-STORE-COLLECTION-057: deleteMany() restores the rows and the selection on failure', async () => {
+ useCollectionStore.setState({
+ places: [buildPlace({ id: 10 }), buildPlace({ id: 11 })],
+ selectedIds: [10],
+ selectMode: true,
+ })
+ vi.mocked(collectionsApi.deleteMany).mockRejectedValue(new Error('nope'))
+
+ await expect(store().deleteMany([10])).rejects.toThrow('nope')
+
+ expect(store().places.map(p => p.id)).toEqual([10, 11])
+ expect(store().selectedIds).toEqual([10])
+ expect(store().selectMode).toBe(true)
+ })
+
it('FE-STORE-COLLECTION-031: copyToTrip() forwards the payload and returns the dedup report', async () => {
vi.mocked(collectionsApi.copyToTrip).mockResolvedValue({ copied: 1, skipped: [{ id: 11, name: 'Shibuya' }] })
@@ -500,6 +530,28 @@ describe('collectionStore — place mutations', () => {
expect(collectionsApi.get).not.toHaveBeenCalled()
})
+ it('FE-STORE-COLLECTION-058: moveToList() only drops the places that actually moved', async () => {
+ useCollectionStore.setState({
+ activeId: 1,
+ places: [buildPlace({ id: 10 }), buildPlace({ id: 11 }), buildPlace({ id: 12 })],
+ selectedIds: [10, 11],
+ selectMode: true,
+ })
+ vi.mocked(collectionsApi.get).mockResolvedValue(
+ detail({ places: [buildPlace({ id: 11 }), buildPlace({ id: 12 })] }),
+ )
+ vi.mocked(collectionsApi.updatePlace)
+ .mockResolvedValueOnce(buildPlace({ id: 10 }))
+ .mockRejectedValueOnce(new Error('nope'))
+
+ await expect(store().moveToList([10, 11], 2)).rejects.toThrow('nope')
+
+ // The list is refreshed either way, so the open list matches the server again.
+ expect(collectionsApi.get).toHaveBeenCalledWith(1)
+ expect(store().places.map(p => p.id)).toEqual([11, 12])
+ expect(store().selectedIds).toEqual([])
+ })
+
it('FE-STORE-COLLECTION-034: duplicateToList() re-saves each place into the target list', async () => {
const source = buildPlace({
id: 10,
@@ -672,6 +724,42 @@ describe('collectionStore — labels', () => {
expect(collectionsApi.unassignLabels).toHaveBeenCalledWith([3], [10])
expect(collectionsApi.assignLabels).not.toHaveBeenCalled()
})
+ it('FE-STORE-COLLECTION-059: updateLabel() undoes the recolor when the server refuses', async () => {
+ useCollectionStore.setState({ activeId: 1, labels: [{ id: 3, collection_id: 1, name: 'Food', color: '#ef4444' }] })
+ vi.mocked(collectionsApi.updateLabel).mockRejectedValue(new Error('nope'))
+
+ await expect(store().updateLabel(3, { color: '#22c55e' })).rejects.toThrow('nope')
+
+ expect(store().labels[0]!.color).toBe('#ef4444')
+ expect(collectionsApi.get).not.toHaveBeenCalled()
+ })
+
+ it('FE-STORE-COLLECTION-060: deleteLabel() restores the label, its filter and its assignments', async () => {
+ useCollectionStore.setState({
+ activeId: 1,
+ labels: [{ id: 3, collection_id: 1, name: 'Food' }],
+ labelFilter: [3],
+ places: [buildPlace({ id: 10, label_ids: [3] })],
+ })
+ vi.mocked(collectionsApi.deleteLabel).mockRejectedValue(new Error('nope'))
+
+ await expect(store().deleteLabel(3)).rejects.toThrow('nope')
+
+ expect(store().labels.map(l => l.id)).toEqual([3])
+ expect(store().labelFilter).toEqual([3])
+ expect(store().places[0]!.label_ids).toEqual([3])
+ })
+
+ it('FE-STORE-COLLECTION-061: assignLabels() rolls the chips back on failure', async () => {
+ useCollectionStore.setState({ activeId: 1, places: [buildPlace({ id: 10, label_ids: [] })] })
+ vi.mocked(collectionsApi.assignLabels).mockRejectedValue(new Error('nope'))
+
+ await expect(store().assignLabels([3], [10])).rejects.toThrow('nope')
+
+ expect(store().places[0]!.label_ids).toEqual([])
+ expect(collectionsApi.get).not.toHaveBeenCalled()
+ })
+
})
describe('collectionStore — members and invitations', () => {
@@ -748,6 +836,8 @@ describe('collectionStore — members and invitations', () => {
activeId: 1,
places: [buildPlace()],
members: [{ user_id: 5, username: 'bob', status: 'accepted' }],
+ labels: [{ id: 3, collection_id: 1, name: 'Food' }],
+ labelFilter: [3],
})
vi.mocked(collectionsApi.list).mockResolvedValue(listResponse({ collections: [] }))
@@ -757,6 +847,9 @@ describe('collectionStore — members and invitations', () => {
expect(store().activeId).toBeNull()
expect(store().places).toEqual([])
expect(store().members).toEqual([])
+ // Labels belong to the list we just left.
+ expect(store().labels).toEqual([])
+ expect(store().labelFilter).toEqual([])
expect(store().collections).toEqual([])
})
diff --git a/client/src/store/collectionStore.ts b/client/src/store/collectionStore.ts
index 187c29641..6e310d9e9 100644
--- a/client/src/store/collectionStore.ts
+++ b/client/src/store/collectionStore.ts
@@ -208,7 +208,8 @@ export const useCollectionStore = create<CollectionState>((set, get) => ({
deleteCollection: async (id: number) => {
await collectionsApi.remove(id)
- if (get().activeId === id) set({ activeId: null, places: [], members: [] })
+ // Labels are per-list, so they have to go with the list they belonged to.
+ if (get().activeId === id) set({ activeId: null, places: [], members: [], labels: [], labelFilter: [] })
await get().loadAll()
},
@@ -253,15 +254,30 @@ export const useCollectionStore = create<CollectionState>((set, get) => ({
},
deletePlace: async (placeId: number) => {
- set({ places: get().places.filter(p => p.id !== placeId) })
- await collectionsApi.deletePlace(placeId)
+ // optimistic; put the row back if the server refuses, then let the caller toast
+ const prev = get().places
+ set({ places: prev.filter(p => p.id !== placeId) })
+ try {
+ await collectionsApi.deletePlace(placeId)
+ } catch (err) {
+ set({ places: prev })
+ throw err
+ }
await get().loadAll()
},
deleteMany: async (ids: number[]) => {
const idSet = new Set(ids)
- set({ places: get().places.filter(p => !idSet.has(p.id)), selectedIds: [], selectMode: false })
- await collectionsApi.deleteMany(ids)
+ const prev = get().places
+ const prevSelected = get().selectedIds
+ const prevSelectMode = get().selectMode
+ set({ places: prev.filter(p => !idSet.has(p.id)), selectedIds: [], selectMode: false })
+ try {
+ await collectionsApi.deleteMany(ids)
+ } catch (err) {
+ set({ places: prev, selectedIds: prevSelected, selectMode: prevSelectMode })
+ throw err
+ }
await get().loadAll()
},
@@ -273,12 +289,26 @@ export const useCollectionStore = create<CollectionState>((set, get) => ({
// Move the selected places into another list (re-point collection_id). They
// leave the current list, so drop them locally + refresh.
moveToList: async (placeIds: number[], targetId: number) => {
- for (const id of placeIds) await collectionsApi.updatePlace(id, { collection_id: targetId })
- const idSet = new Set(placeIds)
+ // The fan-out can fail halfway through, so drop only the places that really
+ // moved and refresh either way — otherwise the open list keeps showing rows
+ // that already belong to the target.
+ const moved: number[] = []
+ let failure: unknown = null
+ for (const id of placeIds) {
+ try {
+ await collectionsApi.updatePlace(id, { collection_id: targetId })
+ moved.push(id)
+ } catch (err) {
+ failure = err
+ break
+ }
+ }
+ const idSet = new Set(moved)
set({ places: get().places.filter(p => !idSet.has(p.id)), selectedIds: [], selectMode: false })
await get().loadAll()
const active = get().activeId
if (typeof active === 'number') await get().loadCollection(active)
+ if (failure) throw failure
},
// Duplicate the selected places into another list (re-save each place's data).
@@ -322,20 +352,32 @@ export const useCollectionStore = create<CollectionState>((set, get) => ({
updateLabel: async (labelId: number, body: CollectionLabelUpdateRequest) => {
// optimistic recolor/rename
- set({ labels: get().labels.map(l => (l.id === labelId ? { ...l, ...body } : l)) })
- await collectionsApi.updateLabel(labelId, body)
+ const prevLabels = get().labels
+ set({ labels: prevLabels.map(l => (l.id === labelId ? { ...l, ...body } : l)) })
+ try {
+ await collectionsApi.updateLabel(labelId, body)
+ } catch (err) {
+ set({ labels: prevLabels })
+ throw err
+ }
const active = get().activeId
if (typeof active === 'number') await get().loadCollection(active)
},
deleteLabel: async (labelId: number) => {
// optimistic: drop the label + its assignments + any active filter on it
+ const prev = { labels: get().labels, labelFilter: get().labelFilter, places: get().places }
set({
- labels: get().labels.filter(l => l.id !== labelId),
- labelFilter: get().labelFilter.filter(id => id !== labelId),
- places: get().places.map(p => ({ ...p, label_ids: (p.label_ids ?? []).filter(id => id !== labelId) })),
+ labels: prev.labels.filter(l => l.id !== labelId),
+ labelFilter: prev.labelFilter.filter(id => id !== labelId),
+ places: prev.places.map(p => ({ ...p, label_ids: (p.label_ids ?? []).filter(id => id !== labelId) })),
})
- await collectionsApi.deleteLabel(labelId)
+ try {
+ await collectionsApi.deleteLabel(labelId)
+ } catch (err) {
+ set(prev)
+ throw err
+ }
const active = get().activeId
if (typeof active === 'number') await get().loadCollection(active)
},
@@ -343,8 +385,9 @@ export const useCollectionStore = create<CollectionState>((set, get) => ({
assignLabels: async (labelIds: number[], placeIds: number[], remove = false) => {
const idSet = new Set(placeIds)
// optimistic per-place label_ids update
+ const prevPlaces = get().places
set({
- places: get().places.map(p => {
+ places: prevPlaces.map(p => {
if (!idSet.has(p.id)) return p
const current = new Set(p.label_ids ?? [])
if (remove) labelIds.forEach(id => current.delete(id))
@@ -352,8 +395,13 @@ export const useCollectionStore = create<CollectionState>((set, get) => ({
return { ...p, label_ids: [...current] }
}),
})
- if (remove) await collectionsApi.unassignLabels(labelIds, placeIds)
- else await collectionsApi.assignLabels(labelIds, placeIds)
+ try {
+ if (remove) await collectionsApi.unassignLabels(labelIds, placeIds)
+ else await collectionsApi.assignLabels(labelIds, placeIds)
+ } catch (err) {
+ set({ places: prevPlaces })
+ throw err
+ }
const active = get().activeId
if (typeof active === 'number') await get().loadCollection(active)
},
@@ -390,7 +438,8 @@ export const useCollectionStore = create<CollectionState>((set, get) => ({
leave: async (collectionId: number) => {
await collectionsApi.leave(collectionId)
- if (get().activeId === collectionId) set({ activeId: null, places: [], members: [] })
+ // Labels are per-list, so they have to go with the list we just left.
+ if (get().activeId === collectionId) set({ activeId: null, places: [], members: [], labels: [], labelFilter: [] })
await get().loadAll()
},
diff --git a/client/src/store/journeyStore.ts b/client/src/store/journeyStore.ts
index 8f466dd51..4f24f65b5 100644
--- a/client/src/store/journeyStore.ts
+++ b/client/src/store/journeyStore.ts
@@ -349,5 +349,5 @@ export const useJourneyStore = create<JourneyState>((set, get) => ({
})
},
- clear: () => set({ journeys: [], current: null, loading: false }),
+ clear: () => set({ journeys: [], current: null, loading: false, notFound: false }),
}))
diff --git a/client/src/store/slices/budgetSlice.test.ts b/client/src/store/slices/budgetSlice.test.ts
index 7068087c4..c30a6cc7d 100644
--- a/client/src/store/slices/budgetSlice.test.ts
+++ b/client/src/store/slices/budgetSlice.test.ts
@@ -264,4 +264,23 @@ describe('budgetSlice', () => {
expect(useTripStore.getState().budgetItems.map(i => i.id)).toEqual([1, 2]);
expect(addToast).toHaveBeenCalledWith('Reorder rejected', 'error', undefined);
});
+
+ it('FE-STORE-BUDGET-017: a reorder whose reload also fails still notifies instead of rejecting', async () => {
+ const a = buildBudgetItem({ id: 1, trip_id: 1 });
+ const b = buildBudgetItem({ id: 2, trip_id: 1 });
+ seedStore(useTripStore, { budgetItems: [a, b] });
+
+ // Offline: the reorder and the recovery read both fail. The caller fires
+ // this without awaiting, so nothing may escape as a rejection.
+ server.use(
+ http.put('/api/trips/1/budget/reorder/items', () => HttpResponse.error()),
+ http.put('/api/trips/1/budget/reorder/categories', () => HttpResponse.error()),
+ http.get('/api/trips/1/budget', () => HttpResponse.error())
+ );
+
+ await expect(useTripStore.getState().reorderBudgetItems(1, [2, 1])).resolves.toBeUndefined();
+ await expect(useTripStore.getState().reorderBudgetCategories(1, ['Transport'])).resolves.toBeUndefined();
+
+ expect(addToast).toHaveBeenCalledTimes(2);
+ });
});
diff --git a/client/src/store/slices/budgetSlice.ts b/client/src/store/slices/budgetSlice.ts
index 92b68a2af..dac827ddb 100644
--- a/client/src/store/slices/budgetSlice.ts
+++ b/client/src/store/slices/budgetSlice.ts
@@ -95,10 +95,12 @@ export const createBudgetSlice = (set: SetState, get: GetState): BudgetSlice =>
// Optimistic: reorder locally
set(state => {
const byId = new Map(state.budgetItems.map(i => [i.id, i]))
- const reordered = orderedIds.map((id, idx): BudgetItem | null => {
- const item = byId.get(id)
- return item ? { ...item, sort_order: idx } : null
- }).filter((i): i is BudgetItem => i !== null)
+ // Drop unknown ids before reindexing, otherwise a stale id leaves a gap
+ // in the local sort_order sequence.
+ const reordered = orderedIds
+ .map(id => byId.get(id))
+ .filter((i): i is BudgetItem => i !== undefined)
+ .map((item, idx): BudgetItem => ({ ...item, sort_order: idx }))
// Keep items not in orderedIds at the end
const remaining = state.budgetItems.filter(i => !orderedIds.includes(i.id))
return { budgetItems: [...reordered, ...remaining] }
@@ -107,9 +109,12 @@ export const createBudgetSlice = (set: SetState, get: GetState): BudgetSlice =>
await budgetApi.reorderItems(tripId, orderedIds)
} catch (err: unknown) {
// Reload on failure to restore the server's ordering, and tell the user
- // their reorder didn't stick (the caller fires this without awaiting).
- const data = await budgetApi.list(tripId)
- set({ budgetItems: data.items })
+ // their reorder didn't stick (the caller fires this without awaiting, so
+ // a failing reload must not escape as an unhandled rejection).
+ try {
+ const data = await budgetApi.list(tripId)
+ set({ budgetItems: data.items })
+ } catch { /* offline too — the next successful load restores the order */ }
notify(getApiErrorMessage(err, 'Error reordering budget items'), 'error')
}
},
@@ -137,9 +142,12 @@ export const createBudgetSlice = (set: SetState, get: GetState): BudgetSlice =>
await budgetApi.reorderCategories(tripId, orderedCategories)
} catch (err: unknown) {
// Reload on failure to restore the server's ordering, and tell the user
- // their reorder didn't stick (the caller fires this without awaiting).
- const data = await budgetApi.list(tripId)
- set({ budgetItems: data.items })
+ // their reorder didn't stick (the caller fires this without awaiting, so
+ // a failing reload must not escape as an unhandled rejection).
+ try {
+ const data = await budgetApi.list(tripId)
+ set({ budgetItems: data.items })
+ } catch { /* offline too — the next successful load restores the order */ }
notify(getApiErrorMessage(err, 'Error reordering budget items'), 'error')
}
},
diff --git a/client/src/store/slices/daysSlice.test.ts b/client/src/store/slices/daysSlice.test.ts
index 8c0739f25..7d4997069 100644
--- a/client/src/store/slices/daysSlice.test.ts
+++ b/client/src/store/slices/daysSlice.test.ts
@@ -165,7 +165,7 @@ describe('daysSlice', () => {
expect(useTripStore.getState().days.map(d => d.id)).toEqual([1, 5]);
});
- it('FE-TSLICE-DAYS-008: restores the day list and throws when the insert fails', async () => {
+ it('FE-TSLICE-DAYS-008: leaves the day list untouched and throws when the insert fails', async () => {
seedStore(useTripStore, { days: datedDays() });
server.use(
http.post('/api/trips/1/days', () =>
@@ -174,6 +174,7 @@ describe('daysSlice', () => {
);
await expect(useTripStore.getState().insertDay(1, 2)).rejects.toThrow('Trip is locked');
+ // The insert never writes optimistically, so a failure needs no rollback.
expect(useTripStore.getState().days.map(d => d.id)).toEqual([1, 2, 3]);
});
});
diff --git a/client/src/store/slices/daysSlice.ts b/client/src/store/slices/daysSlice.ts
index 5fdc030b4..8d67dd3ef 100644
--- a/client/src/store/slices/daysSlice.ts
+++ b/client/src/store/slices/daysSlice.ts
@@ -44,14 +44,12 @@ export const createDaysSlice = (set: SetState, get: GetState): DaysSlice => ({
// Insert a new empty day at a 1-based position (omit to append). On a dated
// trip this extends the trip by one day and re-pins dates server-side.
insertDay: async (tripId, position) => {
- const prevDays = get().days
try {
const result = await daysApi.create(tripId, { position })
await get().refreshDays(tripId)
await get().loadReservations(tripId)
return result.day
} catch (err: unknown) {
- set({ days: prevDays })
throw new Error(getApiErrorMessage(err, 'Error adding day'))
}
},
diff --git a/client/src/store/slices/packingSlice.test.ts b/client/src/store/slices/packingSlice.test.ts
index ae9506036..0c07e517c 100644
--- a/client/src/store/slices/packingSlice.test.ts
+++ b/client/src/store/slices/packingSlice.test.ts
@@ -263,9 +263,9 @@ describe('packingSlice', () => {
const items = useTripStore.getState().packingItems;
expect(items.map(i => i.id)).toEqual([2, 1, 3]);
- // sort_order is reindexed against the requested positions, so the slot the
- // unknown id occupied leaves a gap until the server's order comes back.
- expect(items.map(i => i.sort_order)).toEqual([0, 2, 2]);
+ // The unknown id is dropped before reindexing, so the reordered items get a
+ // gapless sequence; the unlisted item keeps its own sort_order.
+ expect(items.map(i => i.sort_order)).toEqual([0, 1, 2]);
});
it('FE-STORE-PACKING-013: togglePackingItem rolls the checkbox back and notifies on failure', async () => {
diff --git a/client/src/store/slices/packingSlice.ts b/client/src/store/slices/packingSlice.ts
index f0bbdfe91..8f1d82f9f 100644
--- a/client/src/store/slices/packingSlice.ts
+++ b/client/src/store/slices/packingSlice.ts
@@ -80,11 +80,14 @@ export const createPackingSlice = (set: SetState, get: GetState): PackingSlice =
const prev = get().packingItems
// Optimistic reorder: rebuild the array in the requested order, reindexing
// sort_order; any items not in orderedIds keep their place at the end.
+ // Unknown ids are dropped first so a stale id can't leave a gap in the
+ // local sort_order sequence.
set(state => {
const byId = new Map(state.packingItems.map(i => [i.id, i]))
const reordered = orderedIds
- .map((id, idx): PackingItem | null => { const item = byId.get(id); return item ? { ...item, sort_order: idx } : null })
- .filter((i): i is PackingItem => i !== null)
+ .map(id => byId.get(id))
+ .filter((i): i is PackingItem => i !== undefined)
+ .map((item, idx): PackingItem => ({ ...item, sort_order: idx }))
const remaining = state.packingItems.filter(i => !orderedIds.includes(i.id))
return { packingItems: [...reordered, ...remaining] }
})
diff --git a/client/src/store/slices/placesSlice.ts b/client/src/store/slices/placesSlice.ts
index e87e08648..fe7069883 100644
--- a/client/src/store/slices/placesSlice.ts
+++ b/client/src/store/slices/placesSlice.ts
@@ -126,7 +126,7 @@ export const createPlacesSlice = (set: SetState, get: GetState): PlacesSlice =>
let changed = false
for (const [dayId, items] of Object.entries(state.assignments)) {
if (items.some((a: Assignment) => a.place?.id != null && idSet.has(a.place.id))) {
- updatedAssignments[dayId] = items.filter((a: Assignment) => !idSet.has(a.place?.id!))
+ updatedAssignments[dayId] = items.filter((a: Assignment) => a.place?.id == null || !idSet.has(a.place.id))
changed = true
}
}
diff --git a/client/src/store/slices/remoteEventHandler.ts b/client/src/store/slices/remoteEventHandler.ts
index 594ee81f1..17af1cb81 100644
--- a/client/src/store/slices/remoteEventHandler.ts
+++ b/client/src/store/slices/remoteEventHandler.ts
@@ -266,9 +266,11 @@ export const STATE_APPLIERS: Partial<Record<TrekWsTripEventName, StateApplier>>
}
},
'assignment:reordered': (payload, state) => {
+ // No ids means no order to apply — dropping through would wipe the day.
+ if (!payload.orderedIds) return {}
const dayKey = String(payload.dayId)
const currentItems = state.assignments[dayKey] || []
- const orderedIds: number[] = (payload.orderedIds as number[] | undefined) || []
+ const orderedIds = payload.orderedIds as number[]
const reordered = orderedIds.map((id, idx) => {
const item = currentItems.find(a => a.id === id)
return item ? { ...item, order_index: idx } : null
@@ -396,12 +398,14 @@ export const STATE_APPLIERS: Partial<Record<TrekWsTripEventName, StateApplier>>
if (payload.orderedIds) {
const orderedIds = payload.orderedIds as number[]
const byId = new Map(state.budgetItems.map(i => [i.id, i]))
- const reordered = orderedIds.map((id, idx): BudgetItem | null => {
- const item = byId.get(id)
- return item ? { ...item, sort_order: idx } : null
- }).filter((i): i is BudgetItem => i !== null)
+ const reordered = orderedIds
+ .map(id => byId.get(id))
+ .filter((i): i is BudgetItem => i !== undefined)
const remaining = state.budgetItems.filter(i => !orderedIds.includes(i.id))
- return { budgetItems: [...reordered, ...remaining] }
+ // A partial orderedIds list leaves the untouched items behind, so index
+ // the whole array — otherwise sort_order and array position disagree and
+ // anything that re-sorts by sort_order undoes the reorder.
+ return { budgetItems: [...reordered, ...remaining].map((item, idx) => ({ ...item, sort_order: idx })) }
}
if (payload.orderedCategories) {
const orderedCategories = payload.orderedCategories as string[]
diff --git a/client/src/store/slices/todoSlice.test.ts b/client/src/store/slices/todoSlice.test.ts
index 651581c29..d15031f3c 100644
--- a/client/src/store/slices/todoSlice.test.ts
+++ b/client/src/store/slices/todoSlice.test.ts
@@ -113,9 +113,9 @@ describe('todoSlice', () => {
const items = useTripStore.getState().todoItems;
expect(items.map(i => i.id)).toEqual([2, 1, 3]);
- // sort_order is reindexed against the requested positions, so the slot the
- // unknown id occupied leaves a gap until the server's order comes back.
- expect(items.map(i => i.sort_order)).toEqual([0, 2, 2]);
+ // The unknown id is dropped before reindexing, so the reordered todos get a
+ // gapless sequence; the unlisted todo keeps its own sort_order.
+ expect(items.map(i => i.sort_order)).toEqual([0, 1, 2]);
});
it('FE-STORE-TODO-004: toggleTodoItem rolls the checkbox back and notifies on failure', async () => {
diff --git a/client/src/store/slices/todoSlice.ts b/client/src/store/slices/todoSlice.ts
index 31c5b2622..03092d1c3 100644
--- a/client/src/store/slices/todoSlice.ts
+++ b/client/src/store/slices/todoSlice.ts
@@ -73,11 +73,14 @@ export const createTodoSlice = (set: SetState, get: GetState): TodoSlice => ({
reorderTodoItems: async (tripId, orderedIds) => {
const prev = get().todoItems
+ // Unknown ids are dropped before reindexing so a stale id can't leave a gap
+ // in the local sort_order sequence.
set(state => {
const byId = new Map(state.todoItems.map(i => [i.id, i]))
const reordered = orderedIds
- .map((id, idx): TodoItem | null => { const item = byId.get(id); return item ? { ...item, sort_order: idx } : null })
- .filter((i): i is TodoItem => i !== null)
+ .map(id => byId.get(id))
+ .filter((i): i is TodoItem => i !== undefined)
+ .map((item, idx): TodoItem => ({ ...item, sort_order: idx }))
const remaining = state.todoItems.filter(i => !orderedIds.includes(i.id))
return { todoItems: [...reordered, ...remaining] }
})
diff --git a/client/src/store/vacayStore.ts b/client/src/store/vacayStore.ts
index 78e84e44b..bebc647cd 100644
--- a/client/src/store/vacayStore.ts
+++ b/client/src/store/vacayStore.ts
@@ -72,7 +72,6 @@ interface VacayApi {
declineInvite: (planId: number) => Promise<unknown>
cancelInvite: (userId: number) => Promise<unknown>
dissolve: () => Promise<unknown>
- availableUsers: () => Promise<{ users: VacayUser[] }>
getYears: () => Promise<VacayYearsResponse>
addYear: (year: number) => Promise<VacayYearsResponse>
removeYear: (year: number) => Promise<VacayYearsResponse>
@@ -81,7 +80,6 @@ interface VacayApi {
toggleCompanyHoliday: (date: string) => Promise<unknown>
getStats: (year: number) => Promise<VacayStatsResponse>
updateStats: (year: number, days: number, targetUserId?: number) => Promise<unknown>
- getCountries: () => Promise<{ countries: string[] }>
getHolidays: (year: number, country: string) => Promise<VacayHolidayRaw[]>
getSchoolHolidays: (year: number, country: string, subdivision?: string | null, group?: string | null) => Promise<VacaySchoolHolidayRaw[]>
addHolidayCalendar: (data: { region: string; color?: string; label?: string | null; type?: 'public_holiday' | 'school_holiday' }) => Promise<{ calendar: VacayHolidayCalendar }>
@@ -91,7 +89,6 @@ interface VacayApi {
share: (userId: number) => Promise<unknown>
removeShare: (shareId: number) => Promise<unknown>
updateShare: (shareId: number, hidden: boolean) => Promise<unknown>
- shareAvailableUsers: () => Promise<{ users: VacayUser[] }>
getSharedCalendars: (year: number) => Promise<{ calendars: SharedVacayCalendar[] }>
getYearSettings: () => Promise<{ settings: VacayYearSettings }>
updateYearSettings: (data: VacayYearSettingsRequest) => Promise<{ settings: VacayYearSettings }>
@@ -106,7 +103,6 @@ const api: VacayApi = {
declineInvite: (planId) => ax.post('/addons/vacay/invite/decline', { plan_id: planId } satisfies VacayInviteActionRequest).then((r: AxiosResponse) => r.data),
cancelInvite: (userId) => ax.post('/addons/vacay/invite/cancel', { user_id: userId }).then((r: AxiosResponse) => r.data),
dissolve: () => ax.post('/addons/vacay/dissolve').then((r: AxiosResponse) => r.data),
- availableUsers: () => ax.get('/addons/vacay/available-users').then((r: AxiosResponse) => r.data),
getYears: () => ax.get('/addons/vacay/years').then((r: AxiosResponse) => r.data),
addYear: (year) => ax.post('/addons/vacay/years', { year } satisfies VacayAddYearRequest).then((r: AxiosResponse) => r.data),
removeYear: (year) => ax.delete(`/addons/vacay/years/${year}`).then((r: AxiosResponse) => r.data),
@@ -115,7 +111,6 @@ const api: VacayApi = {
toggleCompanyHoliday: (date) => ax.post('/addons/vacay/entries/company-holiday', { date } satisfies VacayCompanyHolidayRequest).then((r: AxiosResponse) => r.data),
getStats: (year) => ax.get(`/addons/vacay/stats/${year}`).then((r: AxiosResponse) => r.data),
updateStats: (year, days, targetUserId) => ax.put(`/addons/vacay/stats/${year}`, { vacation_days: days, target_user_id: targetUserId } satisfies VacayUpdateStatsRequest).then((r: AxiosResponse) => r.data),
- getCountries: () => ax.get('/addons/vacay/holidays/countries').then((r: AxiosResponse) => r.data),
getHolidays: (year, country) => ax.get(`/addons/vacay/holidays/${year}/${country}`).then((r: AxiosResponse) => r.data),
getSchoolHolidays: (year, country, subdivision, group) => {
const params = new URLSearchParams()
@@ -130,7 +125,6 @@ const api: VacayApi = {
share: (userId) => ax.post('/addons/vacay/shares', { user_id: userId } satisfies VacayShareRequest).then((r: AxiosResponse) => r.data),
removeShare: (shareId) => ax.delete(`/addons/vacay/shares/${shareId}`).then((r: AxiosResponse) => r.data),
updateShare: (shareId, hidden) => ax.put(`/addons/vacay/shares/${shareId}`, { hidden } satisfies VacayShareUpdateRequest).then((r: AxiosResponse) => r.data),
- shareAvailableUsers: () => ax.get('/addons/vacay/shares/available-users').then((r: AxiosResponse) => r.data),
getSharedCalendars: (year) => ax.get(`/addons/vacay/shares/calendars/${year}`).then((r: AxiosResponse) => r.data),
getYearSettings: () => ax.get('/addons/vacay/year-settings').then((r: AxiosResponse) => r.data),
updateYearSettings: (data) => ax.put('/addons/vacay/year-settings', data satisfies VacayYearSettingsRequest).then((r: AxiosResponse) => r.data),
diff --git a/client/src/sync/offlinePrefs.ts b/client/src/sync/offlinePrefs.ts
index 90bf18e1e..7f78c9831 100644
--- a/client/src/sync/offlinePrefs.ts
+++ b/client/src/sync/offlinePrefs.ts
@@ -91,7 +91,7 @@ export function setTripOfflineEnabled(tripId: number, on: boolean): void {
/** Subscribe to preference changes. Returns an unsubscribe function. */
export function onOfflinePrefsChange(fn: () => void): () => void {
listeners.add(fn)
- return () => listeners.delete(fn)
+ return () => { listeners.delete(fn) }
}
/** Reset to defaults — test helper only. */
diff --git a/client/src/sync/tripSyncManager.prepare.test.ts b/client/src/sync/tripSyncManager.prepare.test.ts
index 23923e133..0545a0ded 100644
--- a/client/src/sync/tripSyncManager.prepare.test.ts
+++ b/client/src/sync/tripSyncManager.prepare.test.ts
@@ -1,4 +1,4 @@
-// FE-SYNC-PREP-001 to FE-SYNC-PREP-020
+// FE-SYNC-PREP-001 to FE-SYNC-PREP-021
// prepareForOffline, the idle tile pass and the file-blob caching branches that
// tests/unit/sync/tripSyncManager.test.ts leaves untouched.
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'
@@ -250,6 +250,20 @@ describe('tripSyncManager — file blob caching', () => {
expect((await offlineDb.syncMeta.get(614))!.filesCachedCount).toBe(1)
})
+ it('FE-SYNC-PREP-021: a trip that lost all its files has its cached-file count reset', async () => {
+ const url = '/api/trips/617/files/908/download'
+ await prepareWithFiles(617, [buildTripFile({ id: 908, trip_id: 617, url, mime_type: 'application/pdf' })])
+ expect((await offlineDb.syncMeta.get(617))!.filesCachedCount).toBe(1)
+
+ // The count is derived from the trip being synced, not from the first file
+ // row, so an empty list still updates the meta.
+ tripSyncManager._resetSyncing()
+ await offlineDb.tripFiles.clear()
+ await prepareWithFiles(617, [])
+
+ expect((await offlineDb.syncMeta.get(617))!.filesCachedCount).toBe(0)
+ })
+
it('FE-SYNC-PREP-016: a file row without a url is ignored', async () => {
await prepareWithFiles(615, [
buildTripFile({ id: 908, trip_id: 615, url: undefined, mime_type: 'application/pdf' }),
diff --git a/client/src/sync/tripSyncManager.ts b/client/src/sync/tripSyncManager.ts
index 6a953ed8d..0d5b3a15a 100644
--- a/client/src/sync/tripSyncManager.ts
+++ b/client/src/sync/tripSyncManager.ts
@@ -115,35 +115,35 @@ async function syncTrip(tripId: number): Promise<void> {
}
/** Cache non-photo file blobs for a trip. Fire-and-forget safe. */
-async function cacheFilesForTrip(files: TripFile[]): Promise<void> {
+async function cacheFilesForTrip(tripId: number, files: TripFile[]): Promise<void> {
const nonPhotos = files.filter(f => f.url && !isPhoto(f) && !isVideo(f))
- let cached = 0
+ // `present` is what syncMeta.filesCachedCount reports (files available
+ // offline afterwards); `downloaded` only counts what this run actually wrote.
+ let present = 0
+ let downloaded = 0
for (const file of nonPhotos) {
// Skip if already cached
const existing = await offlineDb.blobCache.get(file.url!)
- if (existing) { cached++; continue }
+ if (existing) { present++; continue }
try {
const resp = await fetch(file.url!, { credentials: 'include' })
if (!resp.ok) continue
const blob = await resp.blob()
await offlineDb.blobCache.put({ url: file.url!, tripId: file.trip_id, blob, bytes: blob.size, mime: file.mime_type, cachedAt: Date.now() })
- cached++
+ present++
+ downloaded++
} catch {
// Network failure — skip this file, will retry next sync
}
}
// Keep the blob cache within its size/count budget after adding new files.
- if (cached > 0) await enforceBlobBudget().catch(() => {})
+ if (downloaded > 0) await enforceBlobBudget().catch(() => {})
- // Update filesCachedCount in syncMeta
- const tripId = files[0]?.trip_id
- if (tripId) {
- const meta = await offlineDb.syncMeta.get(tripId)
- if (meta) await upsertSyncMeta({ ...meta, filesCachedCount: cached })
- }
+ const meta = await offlineDb.syncMeta.get(tripId)
+ if (meta) await upsertSyncMeta({ ...meta, filesCachedCount: present })
}
// ── Public API ────────────────────────────────────────────────────────────────
@@ -205,7 +205,7 @@ export const tripSyncManager = {
const tileUrl = useSettingsStore.getState().settings.map_tile_url || undefined
for (const trip of toSync) {
const files = await offlineDb.tripFiles.where('trip_id').equals(trip.id).toArray()
- cacheFilesForTrip(files).catch(console.error)
+ cacheFilesForTrip(trip.id, files).catch(console.error)
}
// Map tiles last, and only once the browser goes idle. syncAll runs right
@@ -265,7 +265,7 @@ export const tripSyncManager = {
for (const trip of toSync) {
onProgress?.({ phase: 'files', current: ++i, total, label: trip.title })
const files = await offlineDb.tripFiles.where('trip_id').equals(trip.id).toArray()
- await cacheFilesForTrip(files).catch(console.error)
+ await cacheFilesForTrip(trip.id, files).catch(console.error)
}
// 3) Map tiles — awaited, and only when the user opted to store them.
diff --git a/client/src/types.ts b/client/src/types.ts
index bc7fab35a..378338b37 100644
--- a/client/src/types.ts
+++ b/client/src/types.ts
@@ -406,7 +406,9 @@ export interface ApiError {
export function getApiErrorMessage(err: unknown, fallback: string): string {
if (typeof err === 'object' && err !== null && 'response' in err) {
const apiErr = err as ApiError
- if (apiErr.response?.data?.error) return apiErr.response.data.error
+ // Axios' own message ("Request failed with status code 500") is untranslated
+ // boilerplate, so only the server's error text beats the localized fallback.
+ return apiErr.response?.data?.error || fallback
}
if (err instanceof Error) return err.message
return fallback
diff --git a/client/src/utils/fileDownload.ts b/client/src/utils/fileDownload.ts
index 1a9fe3008..96ae0cbb6 100644
--- a/client/src/utils/fileDownload.ts
+++ b/client/src/utils/fileDownload.ts
@@ -73,6 +73,17 @@ async function getFileBlob(url: string): Promise<Blob> {
return await resp.blob()
}
+/**
+ * Triggers a browser download for an in-memory Blob (CSV export, generated
+ * report, …). Use this instead of hand-rolling the anchor: Firefox ignores a
+ * click on an anchor that is not in the document, and revoking the object URL
+ * in the same tick can abort the download in other browsers.
+ */
+export function downloadBlob(blob: Blob, filename: string): void {
+ const blobUrl = URL.createObjectURL(blob)
+ triggerAnchorDownload(blobUrl, filename)
+}
+
/**
* Fetches a protected file using cookie auth (credentials: include) and
* triggers a browser download. Works inside PWA standalone mode because the
diff --git a/client/src/utils/uploadQueue.test.ts b/client/src/utils/uploadQueue.test.ts
index 8845eddfb..bbc81a465 100644
--- a/client/src/utils/uploadQueue.test.ts
+++ b/client/src/utils/uploadQueue.test.ts
@@ -1,4 +1,4 @@
-// FE-W4UPQ-001 to FE-W4UPQ-010
+// FE-W4UPQ-001 to FE-W4UPQ-012
import { describe, it, expect, vi } from 'vitest'
import { uploadFilesResilient, type UploadOpts, type UploadProgress } from './uploadQueue'
@@ -139,4 +139,20 @@ describe('uploadFilesResilient', () => {
expect(uploadOne).not.toHaveBeenCalled()
expect(res).toEqual({ succeeded: [], failed: [] })
})
+
+ it('FE-W4UPQ-012: the bytes of an aborted attempt do not survive into the retry', async () => {
+ const seen: UploadProgress[] = []
+ let attempt = 0
+ const uploadOne = async (f: File, opts: UploadOpts) => {
+ attempt++
+ opts.onUploadProgress({ loaded: f.size / 2, total: f.size } as never)
+ if (attempt === 1) throw new Error('connection reset')
+ return [f.name]
+ }
+
+ await uploadFilesResilient([file('a.txt', 200)], uploadOne, { retries: 1, onProgress: p => { seen.push(p) } })
+
+ // 50% from the aborted attempt, then back to 0 before the retry reports its own.
+ expect(seen.map(p => p.percent)).toEqual([50, 0, 50, 100])
+ })
})
diff --git a/client/src/utils/uploadQueue.ts b/client/src/utils/uploadQueue.ts
index 2b949bec3..de2f92b8e 100644
--- a/client/src/utils/uploadQueue.ts
+++ b/client/src/utils/uploadQueue.ts
@@ -67,7 +67,14 @@ export async function uploadFilesResilient<T>(
let items: T[] | null = null
for (let attempt = 0; attempt <= maxRetries; attempt++) {
- if (attempt > 0) await sleep(400 * attempt)
+ if (attempt > 0) {
+ // The aborted attempt's bytes never landed, so drop them before the
+ // retry starts reporting its own — otherwise they'd be counted twice
+ // until the first onUploadProgress of the new attempt arrives.
+ loadedMap.set(i, 0)
+ emitProgress()
+ await sleep(400 * attempt)
+ }
try {
items = await uploadOne(file, {
idempotencyKey,
diff --git a/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx b/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx
index f290ea93f..f4c8b28f5 100644
--- a/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx
+++ b/client/tests/unit/mobile/admin/MAdminAddonManager.test.tsx
@@ -1,4 +1,4 @@
-// FE-MOB-AADD-001 to FE-MOB-AADD-023
+// FE-MOB-AADD-001 to FE-MOB-AADD-025
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
import userEvent from '@testing-library/user-event';
import { delay, http, HttpResponse } from 'msw';
@@ -435,6 +435,26 @@ describe('MAdminAddonManager', () => {
expect(screen.getByRole('button', { name: 'Pull' })).toBeEnabled();
});
+ it('FE-MOB-AADD-025: an error frame in the pull stream aborts the pull', async () => {
+ const user = userEvent.setup();
+ server.use(
+ addonsRoute([llmAddon({ provider: 'local' })]),
+ modelsRoute([]),
+ http.post('/api/admin/llm/local/pull', () => new HttpResponse(
+ '{"status":"pulling manifest"}\n{"error":"manifest not found"}\n',
+ { headers: { 'Content-Type': 'application/x-ndjson' } },
+ )),
+ );
+ render(<><ToastContainer /><MAdminAddonManager /></>);
+
+ await screen.findByText('No models installed yet — pull one below.');
+ await user.click(screen.getByRole('button', { name: 'Pull' }));
+
+ await screen.findByText('manifest not found');
+ expect(screen.queryByText('Model pulled')).not.toBeInTheDocument();
+ expect(screen.getByRole('button', { name: 'Pull' })).toBeEnabled();
+ });
+
it('FE-MOB-AADD-023: saving posts the whole config and reports both outcomes', async () => {
const user = userEvent.setup();
const bodies: unknown[] = [];
diff --git a/client/tests/unit/mobile/admin/MAdminBackupPanel.test.tsx b/client/tests/unit/mobile/admin/MAdminBackupPanel.test.tsx
index e21ecb323..4281a450a 100644
--- a/client/tests/unit/mobile/admin/MAdminBackupPanel.test.tsx
+++ b/client/tests/unit/mobile/admin/MAdminBackupPanel.test.tsx
@@ -446,6 +446,14 @@ describe('MAdminBackupPanel', () => {
expect(screen.queryByText('Failed to load backups')).not.toBeInTheDocument();
});
+ it('FE-MOB-MBKP-028: a 200 without a settings block keeps the built-in defaults', async () => {
+ server.use(http.get('/api/backup/auto-settings', () => HttpResponse.json({ timezone: 'UTC' })));
+ withToast();
+ await screen.findByText('backup-2025-01-15.zip');
+
+ expect(screen.getByRole('switch', { name: 'Enable auto-backup' })).toHaveAttribute('aria-checked', 'false');
+ });
+
it('FE-MOB-MBKP-027: an unusable server timezone falls back to the raw timestamp', async () => {
server.use(autoSettingsHandler(DEFAULT_AUTO, 'Not/AZone'));
render(<MAdminBackupPanel />);
diff --git a/client/tests/unit/mobile/admin/MAdminDefaultUserSettings.test.tsx b/client/tests/unit/mobile/admin/MAdminDefaultUserSettings.test.tsx
index 9f9b3ad9c..ab41355d7 100644
--- a/client/tests/unit/mobile/admin/MAdminDefaultUserSettings.test.tsx
+++ b/client/tests/unit/mobile/admin/MAdminDefaultUserSettings.test.tsx
@@ -346,7 +346,7 @@ describe('MAdminDefaultUserSettings', () => {
await waitFor(() => expect(puts).toEqual([{ mapbox_3d_enabled: false }, { mapbox_quality_mode: true }]));
});
- it('FE-MOB-MDUS-023: a rejected save surfaces the request error instead of a success toast', async () => {
+ it('FE-MOB-MDUS-023: a rejected save surfaces the server error instead of a success toast', async () => {
const user = userEvent.setup();
server.use(
http.get('/api/admin/default-user-settings', () => HttpResponse.json({})),
@@ -357,7 +357,7 @@ describe('MAdminDefaultUserSettings', () => {
await user.click(screen.getByRole('tab', { name: 'Dark' }));
- expect(await screen.findByText(/Request failed with status code 500/)).toBeInTheDocument();
+ expect(await screen.findByText('nope')).toBeInTheDocument();
expect(screen.queryByText('Default saved')).not.toBeInTheDocument();
});
@@ -372,7 +372,7 @@ describe('MAdminDefaultUserSettings', () => {
await user.click(resetLink('Temperature Unit'));
- expect(await screen.findByText(/Request failed with status code 503/)).toBeInTheDocument();
+ expect(await screen.findByText('nope')).toBeInTheDocument();
expect(screen.queryByText('Reset to built-in default')).not.toBeInTheDocument();
expect(screen.getByRole('tab', { name: '°C Celsius' })).toHaveAttribute('aria-selected', 'true');
});
diff --git a/client/tests/unit/mobile/admin/MAdminGitHubPanel.test.tsx b/client/tests/unit/mobile/admin/MAdminGitHubPanel.test.tsx
index f8ec8c654..706e677a1 100644
--- a/client/tests/unit/mobile/admin/MAdminGitHubPanel.test.tsx
+++ b/client/tests/unit/mobile/admin/MAdminGitHubPanel.test.tsx
@@ -1,4 +1,4 @@
-// FE-MOB-AGH-001 to FE-MOB-AGH-018
+// FE-MOB-AGH-001 to FE-MOB-AGH-019
import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import { http, HttpResponse } from 'msw';
import userEvent from '@testing-library/user-event';
@@ -252,20 +252,26 @@ describe('MAdminGitHubPanel', () => {
expect(screen.queryByText('Load more')).not.toBeInTheDocument();
});
- it('FE-MOB-AGH-017: a failing "Load more" swaps the timeline for the error card', async () => {
+ it('FE-MOB-AGH-017: a failing "Load more" keeps the timeline and can be retried', async () => {
let calls = 0;
server.use(
http.get('/api/admin/github-releases', () => {
calls += 1;
- if (calls === 1) return HttpResponse.json(PAGE_1);
- return HttpResponse.json({ message: 'nope' }, { status: 500 });
+ if (calls === 2) return HttpResponse.json({ message: 'nope' }, { status: 500 });
+ return HttpResponse.json(calls === 1 ? PAGE_1 : PAGE_2);
}),
);
const user = userEvent.setup();
await renderPanel();
await user.click(screen.getByText('Load more'));
- await screen.findByText('Failed to load releases');
+ await screen.findByText(/Failed to load releases/);
+ expect(screen.getAllByText(/^v1\.\d\.0$/)).toHaveLength(10);
+
+ // the retry succeeds and clears the error
+ await user.click(screen.getByText('Load more'));
+ expect(await screen.findByText('v0.0.0')).toBeInTheDocument();
+ await waitFor(() => expect(screen.queryByText(/Failed to load releases/)).not.toBeInTheDocument());
});
it('FE-MOB-AGH-018: a non-array response is treated as an empty release list', async () => {
@@ -276,4 +282,20 @@ describe('MAdminGitHubPanel', () => {
expect(screen.queryByText('Load more')).not.toBeInTheDocument();
expect(screen.queryByText('Latest')).not.toBeInTheDocument();
});
+
+ it('FE-MOB-AGH-019: skips over a full page that only contains prereleases', async () => {
+ const prereleasePage = Array.from({ length: 10 }, (_, i) =>
+ buildRelease({ id: 200 + i, tag_name: `v4.0.0-beta.${i}`, prerelease: true }),
+ );
+ server.use(
+ http.get('/api/admin/github-releases', ({ request }) => {
+ const page = new URL(request.url).searchParams.get('page');
+ return HttpResponse.json(page === '1' ? prereleasePage : PAGE_2);
+ }),
+ );
+ await renderPanel();
+
+ expect(screen.getByText('v0.0.0')).toBeInTheDocument();
+ expect(screen.queryByText('Load more')).not.toBeInTheDocument();
+ });
});
diff --git a/client/tests/unit/mobile/admin/MAdminPackingTemplateManager.test.tsx b/client/tests/unit/mobile/admin/MAdminPackingTemplateManager.test.tsx
index e5c665533..eb808e101 100644
--- a/client/tests/unit/mobile/admin/MAdminPackingTemplateManager.test.tsx
+++ b/client/tests/unit/mobile/admin/MAdminPackingTemplateManager.test.tsx
@@ -483,7 +483,7 @@ describe('MAdminPackingTemplateManager', () => {
await user.click(within(categoryHeader('Clothing')).getByRole('button', { name: 'Delete' }));
- await screen.findByText('Failed to delete template');
+ await screen.findByText('Failed to delete');
expect(screen.getByText('Clothing')).toBeInTheDocument();
});
@@ -671,7 +671,7 @@ describe('MAdminPackingTemplateManager', () => {
expect(screen.getByText('Shorts')).toBeInTheDocument();
await user.click(within(itemRow('Shorts')).getByRole('button', { name: 'Delete' }));
- await screen.findByText('Failed to delete template');
+ await screen.findByText('Failed to delete');
expect(screen.getByText('Shorts')).toBeInTheDocument();
});
});
diff --git a/client/tests/unit/mobile/admin/MAdminPluginsPanel.test.tsx b/client/tests/unit/mobile/admin/MAdminPluginsPanel.test.tsx
index cef494f82..ce205ecf5 100644
--- a/client/tests/unit/mobile/admin/MAdminPluginsPanel.test.tsx
+++ b/client/tests/unit/mobile/admin/MAdminPluginsPanel.test.tsx
@@ -490,6 +490,21 @@ describe('MAdminPluginsPanel — the registry detail sheet', () => {
expect(screen.queryByText('Connects to')).not.toBeInTheDocument();
});
+ it('FE-MOB-PLUGP-092: the manifest capabilities are chipped before the install decision', async () => {
+ await openDetail({
+ ...registryEntry(),
+ size: null,
+ publishedAt: null,
+ manifest: {
+ ...manifest,
+ capabilities: { widget: { slot: 'hero' }, tripPage: { replaces: ['places'] } },
+ },
+ });
+
+ expect(await screen.findByText('Replaces planner tabs')).toBeInTheDocument();
+ expect(screen.getByText('Boarding-pass widget')).toBeInTheDocument();
+ });
+
it('FE-MOB-PLUGP-030: a failed detail fetch is reported inside the sheet', async () => {
mockPanel([], [registryEntry()]);
server.use(http.get('*/api/admin/plugins/registry/trek-gotify', () =>
diff --git a/client/tests/unit/mobile/admin/MAdminSheets.test.tsx b/client/tests/unit/mobile/admin/MAdminSheets.test.tsx
index 3b92c8eb3..2ccfd8c6a 100644
--- a/client/tests/unit/mobile/admin/MAdminSheets.test.tsx
+++ b/client/tests/unit/mobile/admin/MAdminSheets.test.tsx
@@ -282,7 +282,7 @@ describe('MAdminSheets', () => {
expect(screen.getByRole('link', { name: 'Open the update guide' })).toHaveAttribute(
'href',
- 'https://github.com/mauriceboe/TREK/wiki/Updating',
+ 'https://github.com/liketrek/TREK/wiki/Updating',
);
expect(screen.queryByText(/docker pull/)).not.toBeInTheDocument();
expect(screen.getByRole('link', { name: 'View on GitHub' })).toHaveAttribute(
diff --git a/client/tests/unit/mobile/atlas/MAtlasCountryPopup.test.tsx b/client/tests/unit/mobile/atlas/MAtlasCountryPopup.test.tsx
index 08cb6eda1..f883c8949 100644
--- a/client/tests/unit/mobile/atlas/MAtlasCountryPopup.test.tsx
+++ b/client/tests/unit/mobile/atlas/MAtlasCountryPopup.test.tsx
@@ -7,7 +7,7 @@ import MAtlasCountryPopup from '../../../../src/mobile/screens/atlas/MAtlasCount
import type { AtlasController } from '../../../../src/mobile/screens/atlas/atlasController';
import type { AtlasData } from '../../../../src/pages/atlas/atlasModel';
-// FE-MOB-ATLASPOP-001 to FE-MOB-ATLASPOP-025
+// FE-MOB-ATLASPOP-001 to FE-MOB-ATLASPOP-026
type ConfirmAction = AtlasController['confirmAction'];
@@ -53,9 +53,11 @@ describe('MAtlasCountryPopup', () => {
expect(screen.getByText('atlas.addToBucket')).toBeInTheDocument();
});
- it('FE-MOB-ATLASPOP-003: a non-ISO2 code falls back to the flag glyph instead of an image', () => {
+ it('FE-MOB-ATLASPOP-003: a non-ISO2 code falls back to a placeholder instead of an image', () => {
renderPopup({ confirmAction: chooseAction({ code: 'DEU', name: 'Germany' }) });
expect(document.querySelector('img')).toBeNull();
+ // No flag is available for alpha-3, but the slot must not stay empty.
+ expect(document.querySelector('.lucide-map-pin')).not.toBeNull();
});
it('FE-MOB-ATLASPOP-004: marking a country appends it to the atlas data and closes the sheet', async () => {
@@ -350,4 +352,25 @@ describe('MAtlasCountryPopup', () => {
expect(atlas.setConfirmAction).toHaveBeenCalledWith(null);
});
+
+ it('FE-MOB-ATLASPOP-026: a place-derived region left behind keeps the country, as on desktop', async () => {
+ const { atlas } = renderPopup({
+ confirmAction: { type: 'unmark-region', code: 'IT', name: 'Lazio', regionCode: 'IT-62' },
+ visitedRegions: {
+ IT: [
+ { code: 'IT-62', name: 'Lazio', placeCount: 0, manuallyMarked: true },
+ { code: 'IT-25', name: 'Lombardia', placeCount: 2 },
+ ],
+ } as VisitedRegions,
+ data: buildAtlasData({
+ countries: [{ code: 'IT', tripCount: 0, placeCount: 0 }],
+ stats: { totalTrips: 0, totalPlaces: 0, totalCountries: 1, totalDays: 0 },
+ }),
+ });
+
+ fireEvent.click(screen.getByText('atlas.unmark'));
+
+ await waitFor(() => expect(atlas.setConfirmAction).toHaveBeenCalledWith(null));
+ expect((atlas.data as AtlasData).countries.map((c) => c.code)).toEqual(['IT']);
+ });
});
diff --git a/client/tests/unit/mobile/collections/MCollAddSheet.test.tsx b/client/tests/unit/mobile/collections/MCollAddSheet.test.tsx
index a1067131e..0f1db1aed 100644
--- a/client/tests/unit/mobile/collections/MCollAddSheet.test.tsx
+++ b/client/tests/unit/mobile/collections/MCollAddSheet.test.tsx
@@ -1,4 +1,4 @@
-// FE-MOB-COLADD-001 to FE-MOB-COLADD-014
+// FE-MOB-COLADD-001 to FE-MOB-COLADD-015
import React from 'react'
import { describe, it, expect, vi, beforeEach, afterEach, type Mock } from 'vitest'
import { http, HttpResponse } from 'msw'
@@ -306,4 +306,20 @@ describe('MCollAddSheet', () => {
rerender(<MCollAddSheet {...baseProps()} />)
expect(screen.getByPlaceholderText('common.name')).toHaveValue('')
})
+
+ it('FE-MOB-COLADD-015: a list arriving after the open still becomes the default target', async () => {
+ const user = userEvent.setup()
+ const seen = mockSave()
+ const { rerender } = render(<MCollAddSheet {...baseProps({ collectionId: null, lists: [] })} />)
+
+ expect(screen.getByText('collections.noListsYet')).toBeInTheDocument()
+ // The collection list only resolves once the sheet is already open.
+ rerender(<MCollAddSheet {...baseProps({ collectionId: null })} />)
+
+ await user.type(screen.getByPlaceholderText('common.name'), 'Alster')
+ await user.click(screen.getByRole('button', { name: /common.add/ }))
+
+ await waitFor(() => expect(seen.body).toBeDefined())
+ expect(seen.body).toMatchObject({ collection_id: 1 })
+ })
})
diff --git a/client/tests/unit/mobile/collections/MCollEditSheet.test.tsx b/client/tests/unit/mobile/collections/MCollEditSheet.test.tsx
index f18c06799..6e9339495 100644
--- a/client/tests/unit/mobile/collections/MCollEditSheet.test.tsx
+++ b/client/tests/unit/mobile/collections/MCollEditSheet.test.tsx
@@ -1,4 +1,4 @@
-// FE-MOB-COLEDIT-001 to FE-MOB-COLEDIT-013
+// FE-MOB-COLEDIT-001 to FE-MOB-COLEDIT-014
import React from 'react'
import { describe, it, expect, vi, beforeEach, afterEach, type Mock } from 'vitest'
import { http, HttpResponse } from 'msw'
@@ -301,4 +301,22 @@ describe('MCollEditSheet', () => {
// Switching target re-seeds the form.
expect(screen.getByPlaceholderText('collections.listNamePlaceholder')).toHaveValue('Julien Tipps')
})
+
+ it('FE-MOB-COLEDIT-014: cancelling after a failed cover still hands the created list over', async () => {
+ const user = userEvent.setup()
+ uploadCover.mockRejectedValueOnce(new Error('boom'))
+ const props = baseProps()
+ render(<MCollEditSheet {...props} />)
+
+ const input = document.querySelector('input[type="file"]') as HTMLInputElement
+ await user.upload(input, new File(['x'], 'cover.png', { type: 'image/png' }))
+ await user.type(screen.getByPlaceholderText('collections.listNamePlaceholder'), 'Kopenhagen')
+ await user.click(screen.getByRole('button', { name: 'collections.create' }))
+ await waitFor(() => expect(toast).toHaveBeenCalledWith('common.error', 'error', undefined))
+
+ // The list exists even though the cover step failed — cancelling must not lose it.
+ await user.click(screen.getByRole('button', { name: 'common.cancel' }))
+ expect(props.onCreated).toHaveBeenCalledWith(11)
+ expect(props.onClose).toHaveBeenCalledTimes(1)
+ })
})
diff --git a/client/tests/unit/mobile/collections/MCollLabelsSheet.test.tsx b/client/tests/unit/mobile/collections/MCollLabelsSheet.test.tsx
index 194052152..3cb9288b2 100644
--- a/client/tests/unit/mobile/collections/MCollLabelsSheet.test.tsx
+++ b/client/tests/unit/mobile/collections/MCollLabelsSheet.test.tsx
@@ -125,10 +125,10 @@ describe('MCollLabelsSheet', () => {
expect(screen.getByRole('button', { name: SWATCH_COLORS[0] })).toHaveAttribute('aria-pressed', 'true')
})
- it('FE-MOB-CLBLS-009: the trash icon deletes that label', () => {
+ it('FE-MOB-CLBLS-009: the trash icon deletes that label', async () => {
const { onDelete } = setup()
fireEvent.click(screen.getAllByRole('button', { name: 'Delete' })[1])
- expect(onDelete).toHaveBeenCalledWith(2)
+ await waitFor(() => expect(onDelete).toHaveBeenCalledWith(2))
})
it('FE-MOB-CLBLS-010: a second submit is swallowed while the first is still running', async () => {
@@ -209,4 +209,20 @@ describe('MCollLabelsSheet', () => {
setup({ open: false })
expect(screen.queryByRole('dialog')).not.toBeInTheDocument()
})
+
+ it('FE-MOB-CLBLS-019: a delete waits for the running create instead of overtaking it', async () => {
+ let resolve!: () => void
+ const onCreate = vi.fn<Props['onCreate']>().mockReturnValue(new Promise<void>(r => { resolve = r }))
+ const { onDelete } = setup({ onCreate })
+ fireEvent.change(screen.getByPlaceholderText('e.g. Berlin'), { target: { value: 'Bars' } })
+ fireEvent.click(screen.getByRole('button', { name: /Add label/ }))
+
+ fireEvent.click(screen.getAllByRole('button', { name: 'Delete' })[0])
+ expect(onDelete).not.toHaveBeenCalled()
+
+ resolve()
+ await waitFor(() => expect(screen.getAllByRole('button', { name: 'Delete' })[0]).not.toBeDisabled())
+ fireEvent.click(screen.getAllByRole('button', { name: 'Delete' })[0])
+ await waitFor(() => expect(onDelete).toHaveBeenCalledWith(1))
+ })
})
diff --git a/client/tests/unit/mobile/collections/MCollListPickerSheet.test.tsx b/client/tests/unit/mobile/collections/MCollListPickerSheet.test.tsx
index 5546dddca..0528f2f00 100644
--- a/client/tests/unit/mobile/collections/MCollListPickerSheet.test.tsx
+++ b/client/tests/unit/mobile/collections/MCollListPickerSheet.test.tsx
@@ -102,4 +102,14 @@ describe('MCollListPickerSheet', () => {
rerender(<Harness {...props} mode={null} />)
expect(screen.getByText('Duplicate 3 to another list')).toBeInTheDocument()
})
+
+ it('FE-MOB-CLISTP-011: a rejecting pick unlocks the rows instead of escaping', async () => {
+ const onPick = vi.fn<(id: number) => Promise<void>>().mockRejectedValue(new Error('nope'))
+ setup({ onPick })
+ fireEvent.click(screen.getByRole('button', { name: /Tokyo 2026/ }))
+
+ await waitFor(() => expect(screen.getByRole('button', { name: /Someday/ })).not.toBeDisabled())
+ fireEvent.click(screen.getByRole('button', { name: /Someday/ }))
+ await waitFor(() => expect(onPick).toHaveBeenNthCalledWith(2, 2))
+ })
})
diff --git a/client/tests/unit/mobile/collections/MCollListsDrawer.test.tsx b/client/tests/unit/mobile/collections/MCollListsDrawer.test.tsx
deleted file mode 100644
index f6728cff9..000000000
--- a/client/tests/unit/mobile/collections/MCollListsDrawer.test.tsx
+++ /dev/null
@@ -1,122 +0,0 @@
-// FE-MOB-COLDRAW-001 to FE-MOB-COLDRAW-008
-import React from 'react'
-import { describe, it, expect, vi } from 'vitest'
-import type { Collection } from '@trek/shared'
-import { render, screen, fireEvent } from '../../../helpers/render'
-import MCollListsDrawer from '../../../../src/mobile/screens/collections/MCollListsDrawer'
-import { ALL_SAVED } from '../../../../src/store/collectionStore'
-import type { IncomingCollectionInvite } from '../../../../src/store/collectionStore'
-
-const t = (key: string) => key
-
-function buildList(over: Partial<Collection> = {}): Collection {
- return { id: 1, owner_id: 1, name: 'Hamburg', color: '#38BDF8', place_count: 4, is_owner: true, ...over }
-}
-
-const invite: IncomingCollectionInvite = {
- collection_id: 42,
- name: 'Roadtrip 2027',
- from: { id: 9, username: 'julien' },
-}
-
-type Props = React.ComponentProps<typeof MCollListsDrawer>
-
-function renderDrawer(overrides: Partial<Props> = {}) {
- const props: Props = {
- open: true,
- onClose: vi.fn(),
- ownedLists: [buildList()],
- sharedLists: [],
- activeId: ALL_SAVED,
- incomingInvites: [],
- onSelect: vi.fn(),
- onNewList: vi.fn(),
- onAcceptInvite: vi.fn(),
- onDeclineInvite: vi.fn(),
- t,
- ...overrides,
- }
- render(<MCollListsDrawer {...props} />)
- return props
-}
-
-describe('MCollListsDrawer', () => {
- it('FE-MOB-COLDRAW-001: renders nothing while closed', () => {
- renderDrawer({ open: false })
- expect(screen.queryByRole('dialog')).not.toBeInTheDocument()
- })
-
- it('FE-MOB-COLDRAW-002: lists the owned lists with their place counts above the union entry', () => {
- renderDrawer({
- ownedLists: [buildList(), buildList({ id: 2, name: 'Kopenhagen', place_count: undefined })],
- })
-
- expect(screen.getByRole('dialog', { name: 'collections.title' })).toBeInTheDocument()
- expect(screen.getByText('Hamburg')).toBeInTheDocument()
- expect(screen.getByText('4')).toBeInTheDocument()
- // A list the server did not count yet falls back to 0.
- expect(screen.getByText('Kopenhagen')).toBeInTheDocument()
- expect(screen.getByText('0')).toBeInTheDocument()
- })
-
- it('FE-MOB-COLDRAW-003: selecting the union and a list reports the right id', () => {
- const props = renderDrawer()
-
- fireEvent.click(screen.getByRole('button', { name: /collections.allSaved/ }))
- expect(props.onSelect).toHaveBeenCalledWith(ALL_SAVED)
-
- fireEvent.click(screen.getByText('Hamburg'))
- expect(props.onSelect).toHaveBeenCalledWith(1)
- })
-
- it('FE-MOB-COLDRAW-004: the new-list and close buttons call their handlers', () => {
- const props = renderDrawer()
-
- fireEvent.click(screen.getByRole('button', { name: /collections.newList/ }))
- expect(props.onNewList).toHaveBeenCalledTimes(1)
-
- fireEvent.click(screen.getByRole('button', { name: 'common.close' }))
- expect(props.onClose).toHaveBeenCalledTimes(1)
- })
-
- it('FE-MOB-COLDRAW-005: the active list is highlighted, the union entry is not', () => {
- renderDrawer({ activeId: 1 })
-
- const row = screen.getByText('Hamburg').closest('button') as HTMLElement
- expect(row.className).toContain('bg-[color:var(--m-ic)]')
- expect(row.style.boxShadow).toContain('inset 0 0 0 1.5px')
-
- const union = screen.getByRole('button', { name: /collections.allSaved/ })
- expect(union.className).not.toContain('bg-[color:var(--m-ic)]')
- })
-
- it('FE-MOB-COLDRAW-006: shared lists get their own section, absent when there are none', () => {
- renderDrawer()
- expect(screen.queryByText('collections.shared')).not.toBeInTheDocument()
-
- renderDrawer({ sharedLists: [buildList({ id: 7, name: 'Julien Tipps', color: null, is_owner: false })] })
- expect(screen.getByText('collections.shared')).toBeInTheDocument()
- expect(screen.getByText('Julien Tipps')).toBeInTheDocument()
- })
-
- it('FE-MOB-COLDRAW-007: pending invites show the inviter and accept/decline by collection id', () => {
- const props = renderDrawer({ incomingInvites: [invite] })
-
- expect(screen.getByText('collections.invites.title')).toBeInTheDocument()
- expect(screen.getByText('Roadtrip 2027')).toBeInTheDocument()
- expect(screen.getByText(/julien/)).toBeInTheDocument()
-
- fireEvent.click(screen.getByRole('button', { name: 'collections.invites.accept' }))
- expect(props.onAcceptInvite).toHaveBeenCalledWith(42)
-
- fireEvent.click(screen.getByRole('button', { name: 'collections.invites.decline' }))
- expect(props.onDeclineInvite).toHaveBeenCalledWith(42)
- })
-
- it('FE-MOB-COLDRAW-008: a list without a colour falls back to the default swatch', () => {
- renderDrawer({ ownedLists: [buildList({ color: null })] })
-
- const dot = screen.getByText('Hamburg').previousElementSibling as HTMLElement
- expect(dot).toHaveStyle({ background: '#6366F1' })
- })
-})
diff --git a/client/tests/unit/mobile/dashboard/MDashboard.test.tsx b/client/tests/unit/mobile/dashboard/MDashboard.test.tsx
index 8f8f9fac2..f16d0ee21 100644
--- a/client/tests/unit/mobile/dashboard/MDashboard.test.tsx
+++ b/client/tests/unit/mobile/dashboard/MDashboard.test.tsx
@@ -63,7 +63,7 @@ function buildDash(over: Record<string, unknown> = {}): Record<string, unknown>
setDeleteTrip: vi.fn(),
copyTrip: null,
setCopyTrip: vi.fn(),
- setTrips: vi.fn(),
+ applyCoverUpdate: vi.fn(),
handleCreate: vi.fn(),
handleUpdate: vi.fn(),
confirmDelete: vi.fn(),
@@ -501,18 +501,16 @@ describe('MDashboard', () => {
});
it('FE-MOB-DASH-035: a cover uploaded in the sheet is patched into the trip list', async () => {
- const setTrips = vi.fn((updater: (prev: DashboardTrip[]) => DashboardTrip[]) => {
- expect(updater([buildTrip({ id: 19, cover_image: null })])[0].cover_image).toBe('/uploads/covers/n.jpg');
- });
+ const applyCoverUpdate = vi.fn();
vi.spyOn(tripsApi, 'uploadCover').mockResolvedValue({ cover_image: '/uploads/covers/n.jpg' });
- mocks.dash = buildDash({ showForm: true, editingTrip: buildTrip({ id: 19 }), setTrips });
+ mocks.dash = buildDash({ showForm: true, editingTrip: buildTrip({ id: 19 }), applyCoverUpdate });
render(<MDashboard />);
fireEvent.change(document.querySelector('input[type="file"]') as HTMLInputElement, {
target: { files: [new File(['x'], 'c.png', { type: 'image/png' })] },
});
- await waitFor(() => expect(setTrips).toHaveBeenCalled());
+ await waitFor(() => expect(applyCoverUpdate).toHaveBeenCalledWith(19, '/uploads/covers/n.jpg'));
});
it('FE-MOB-DASH-036: dismissing the copy sheet clears the pending trip', () => {
diff --git a/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx b/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx
index c0f196f09..fdb26baba 100644
--- a/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx
+++ b/client/tests/unit/mobile/journey/MJourneyDetail.test.tsx
@@ -486,10 +486,8 @@ describe('MJourneyDetail', () => {
it('FE-MOB-JDET-028: a settled carousel scroll re-centres the map on the nearest card', async () => {
setup();
- // Let the photo-provider probe land first: its state update re-runs the
- // carousel effect and would drop the pending scroll-settle timer.
- await waitFor(() => expect(addonsApi.enabled).toHaveBeenCalled());
-
+ // An unrelated render (here the photo-provider probe resolving) must not
+ // tear the scroll listener down and drop the pending settle timer.
fireEvent.click(screen.getByText('Kyoto'));
expect(screen.getByTestId('journey-map')).toHaveAttribute('data-active', '2');
diff --git a/client/tests/unit/mobile/settings/MPhotoProvidersSection.test.tsx b/client/tests/unit/mobile/settings/MPhotoProvidersSection.test.tsx
index 9e202a331..df22e91d1 100644
--- a/client/tests/unit/mobile/settings/MPhotoProvidersSection.test.tsx
+++ b/client/tests/unit/mobile/settings/MPhotoProvidersSection.test.tsx
@@ -139,8 +139,10 @@ describe('MPhotoProvidersSection', () => {
});
it('FE-MOB-PHOTOPROV-006: a connected provider masks the empty secret field', async () => {
+ // The two routes disagree on purpose: with a status route configured that
+ // one decides the badge, so the mask has to appear regardless of ordering.
server.use(
- http.get('/api/addons/immich/settings', () => HttpResponse.json({ url: 'https://photos.example.com', connected: true })),
+ http.get('/api/addons/immich/settings', () => HttpResponse.json({ url: 'https://photos.example.com', connected: false })),
http.get('/api/addons/immich/status', () => HttpResponse.json({ connected: true })),
);
seedProviders([immich]);
@@ -182,7 +184,8 @@ describe('MPhotoProvidersSection', () => {
render(<MPhotoProvidersSection />);
await screen.findByDisplayValue('https://photos.example.com');
- await user.type(screen.getByPlaceholderText(''), ' fresh-key ');
+ // The status route reports connected, so the empty secret shows the mask.
+ await user.type(await screen.findByPlaceholderText('••••••••'), ' fresh-key ');
await user.click(screen.getByRole('switch', { name: 'Skip SSL certificate verification' }));
const save = screen.getByRole('button', { name: 'Save' });
await waitFor(() => expect(save).toBeEnabled());
@@ -274,7 +277,7 @@ describe('MPhotoProvidersSection', () => {
await screen.findByText('Immich');
await user.click(screen.getByRole('button', { name: 'Test' }));
- expect(await screen.findByText(/Could not connect to Immich : Auth failed/)).toBeInTheDocument();
+ expect(await screen.findByText('Could not connect to Immich: Auth failed')).toBeInTheDocument();
expect(screen.getByText('Not connected')).toBeInTheDocument();
});
diff --git a/client/tests/unit/mobile/settings/MSettingsAccount.test.tsx b/client/tests/unit/mobile/settings/MSettingsAccount.test.tsx
index 16d860841..de1186299 100644
--- a/client/tests/unit/mobile/settings/MSettingsAccount.test.tsx
+++ b/client/tests/unit/mobile/settings/MSettingsAccount.test.tsx
@@ -191,7 +191,7 @@ describe('MSettingsAccount – profile', () => {
await user.click(screen.getByRole('button', { name: 'Remove Profile Picture' }));
- await screen.findByText('Upload failed');
+ await screen.findByText('Removal failed');
});
it('FE-MOB-SETACC-012: Save sends the edited fields through updateProfile', async () => {
diff --git a/client/tests/unit/mobile/settings/MSettingsMcp.test.tsx b/client/tests/unit/mobile/settings/MSettingsMcp.test.tsx
index cabe5ee49..7839c7599 100644
--- a/client/tests/unit/mobile/settings/MSettingsMcp.test.tsx
+++ b/client/tests/unit/mobile/settings/MSettingsMcp.test.tsx
@@ -149,11 +149,16 @@ describe('MSettingsMcp', () => {
it('FE-MOB-SETMCP-007: a preset fills the create form and registers the client with split URIs', async () => {
const user = userEvent.setup();
let body: Record<string, unknown> | null = null;
+ // The list is re-read after the registration, so the server keeps the
+ // registered client and hands back its normalised name.
+ const registered: unknown[] = [];
server.use(
http.post('/api/oauth/clients', async ({ request }) => {
body = (await request.json()) as Record<string, unknown>;
+ registered.push({ ...OAUTH_CLIENT, id: 'new', name: 'Claude.ai (web)', client_id: 'clid-new' });
return HttpResponse.json({ client: { ...OAUTH_CLIENT, id: 'new', client_id: 'clid-new', client_secret: 'sec-new' } });
}),
+ http.get('/api/oauth/clients', () => HttpResponse.json({ clients: registered })),
);
renderScreen();
@@ -178,8 +183,8 @@ describe('MSettingsMcp', () => {
expect(screen.getByText('clid-new')).toBeInTheDocument();
expect(screen.getByText('sec-new')).toBeInTheDocument();
- // The freshly created client is appended to the list without its secret
- expect(screen.getAllByText('Claude Web').length).toBeGreaterThan(0);
+ // The row comes from the re-read, so it carries the server's name
+ expect(await screen.findByText('Claude.ai (web)')).toBeInTheDocument();
});
it('FE-MOB-SETMCP-008: the created-client sheet ignores Escape and closes on Done', async () => {
diff --git a/client/tests/unit/mobile/settings/MSettingsPlugins.test.tsx b/client/tests/unit/mobile/settings/MSettingsPlugins.test.tsx
index 1aca80e93..b58f62d2c 100644
--- a/client/tests/unit/mobile/settings/MSettingsPlugins.test.tsx
+++ b/client/tests/unit/mobile/settings/MSettingsPlugins.test.tsx
@@ -293,8 +293,7 @@ describe('MSettingsPlugins', () => {
await screen.findByText('Actions');
await user.click(screen.getByRole('button', { name: 'Test connection' }));
- // 'common.success' has no English string, so t() echoes the key
- await screen.findByText('common.success');
+ await screen.findByText('Success');
await user.click(screen.getByRole('button', { name: 'Probe' }));
await screen.findByText('Error');
diff --git a/client/tests/unit/mobile/trip/ImpFileStep.test.tsx b/client/tests/unit/mobile/trip/ImpFileStep.test.tsx
index 89b822802..87f0c50a9 100644
--- a/client/tests/unit/mobile/trip/ImpFileStep.test.tsx
+++ b/client/tests/unit/mobile/trip/ImpFileStep.test.tsx
@@ -209,7 +209,7 @@ describe('ImpFileStep', () => {
expect(planner.toast.success).toHaveBeenCalledWith('places.kmlKmzImported:3')
})
- it('FE-MOB-IMPF-016: a mixed import labels the undo generically and uses the GPX toast key', async () => {
+ it('FE-MOB-IMPF-016: a mixed import counts each format on its own key and labels the undo neutrally', async () => {
vi.spyOn(placesApi, 'importGpx').mockResolvedValue({ count: 1, skipped: 0, places: [{ id: 1 }] })
vi.spyOn(placesApi, 'importMapFile').mockResolvedValue({ count: 2, places: [{ id: 2 }] })
const { planner, onDone } = renderStep()
@@ -217,8 +217,20 @@ describe('ImpFileStep', () => {
fireEvent.click(submit())
await waitFor(() => expect(onDone).toHaveBeenCalled())
- expect(planner.toast.success).toHaveBeenCalledWith('places.gpxImported:3')
- expect(planner.pushUndo).toHaveBeenCalledWith('undo.importKeyholeMarkup', expect.any(Function))
+ expect(planner.toast.success).toHaveBeenCalledWith('places.gpxImported:1')
+ expect(planner.toast.success).toHaveBeenCalledWith('places.kmlKmzImported:2')
+ expect(planner.pushUndo).toHaveBeenCalledWith('undo.importFiles', expect.any(Function))
+ })
+
+ it('FE-MOB-IMPF-016b: a KML response without a summary still warns when everything was skipped', async () => {
+ vi.spyOn(placesApi, 'importMapFile').mockResolvedValue({ count: 0, skipped: 3, places: [] })
+ const { planner, onDone } = renderStep()
+ pick([kmlFile()])
+ fireEvent.click(submit())
+
+ await waitFor(() => expect(onDone).toHaveBeenCalled())
+ expect(planner.toast.warning).toHaveBeenCalledWith('places.importAllSkipped')
+ expect(planner.toast.success).not.toHaveBeenCalled()
})
it('FE-MOB-IMPF-017: warns when everything was skipped and registers no undo', async () => {
diff --git a/client/tests/unit/mobile/trip/MAccommodationSheet.test.tsx b/client/tests/unit/mobile/trip/MAccommodationSheet.test.tsx
index eef8b0ac1..2ac8da935 100644
--- a/client/tests/unit/mobile/trip/MAccommodationSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MAccommodationSheet.test.tsx
@@ -183,6 +183,12 @@ describe('MAccommodationSheet', () => {
expect(shell.openSheet).toHaveBeenCalledWith('day', { dayId: 11 })
})
+ it('FE-MOB-ACCSH-011b: an edit opened without a dayId returns to the stay\'s start day', () => {
+ const { shell } = setup(makePlanner(), makeShell({ accId: 77 }))
+ fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
+ expect(shell.openSheet).toHaveBeenCalledWith('day', { dayId: 12 })
+ })
+
it('FE-MOB-ACCSH-012: the All chip spans the whole trip and reaches the payload', async () => {
const create = vi.spyOn(accommodationsApi, 'create').mockResolvedValue({})
setup()
diff --git a/client/tests/unit/mobile/trip/MBookingsTab.test.tsx b/client/tests/unit/mobile/trip/MBookingsTab.test.tsx
index 57e92beff..bb38efa03 100644
--- a/client/tests/unit/mobile/trip/MBookingsTab.test.tsx
+++ b/client/tests/unit/mobile/trip/MBookingsTab.test.tsx
@@ -237,12 +237,14 @@ describe('MBookingsTab', () => {
expect(screen.queryByText('Kyoto Station')).not.toBeInTheDocument()
})
- it('FE-MOB-BKTAB-018: blurs the confirmation code until it is tapped', () => {
+ it('FE-MOB-BKTAB-018: blurs the confirmation code until its button is used', () => {
renderTab(planner({ settings: buildSettings({ time_format: '24h', blur_booking_codes: true }) }))
- const code = within(cardOf('Hotel Granvia')).getByText('HG-77')
+ // A button, not a bare div — the reveal has to be reachable by keyboard.
+ const code = within(cardOf('Hotel Granvia')).getByRole('button', { name: 'HG-77' })
expect(code).toHaveClass('blur-[4px]')
fireEvent.click(code)
expect(code).not.toHaveClass('blur-[4px]')
+ expect(code).toHaveAttribute('aria-pressed', 'true')
})
it('FE-MOB-BKTAB-019: filters the list by assigned traveler', () => {
diff --git a/client/tests/unit/mobile/trip/MBrowseActionsSheet.test.tsx b/client/tests/unit/mobile/trip/MBrowseActionsSheet.test.tsx
index 9b0531e82..f44be1f3e 100644
--- a/client/tests/unit/mobile/trip/MBrowseActionsSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MBrowseActionsSheet.test.tsx
@@ -117,14 +117,14 @@ describe('MBrowseActionsSheet', () => {
expect(planner.handleAssignToDay).toHaveBeenCalledWith(77, 2)
})
- it('FE-MOB-BRACT-011: numbers an untitled, undated day by position and falls back to "?" for a zero', () => {
+ it('FE-MOB-BRACT-011: numbers an untitled, undated day by its position when day_number is missing or zero', () => {
const days = [
{ id: 9, trip_id: 5, day_number: null, date: null, title: null },
{ id: 10, trip_id: 5, day_number: 0, date: null, title: null },
] as unknown as Day[]
setup({ days }, { sheet: { id: 'bract', payload: { placeId: 77, dayPicker: true } } })
expect(screen.getByRole('button', { name: 'Day 1' })).toBeInTheDocument()
- expect(screen.getByRole('button', { name: 'Day ?' })).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'Day 2' })).toBeInTheDocument()
})
it('FE-MOB-BRACT-012: delete routes through the planner confirm flow', () => {
diff --git a/client/tests/unit/mobile/trip/MCollabNotes.test.tsx b/client/tests/unit/mobile/trip/MCollabNotes.test.tsx
index a32e84207..a4f5c6cdb 100644
--- a/client/tests/unit/mobile/trip/MCollabNotes.test.tsx
+++ b/client/tests/unit/mobile/trip/MCollabNotes.test.tsx
@@ -406,7 +406,7 @@ describe('MCollabNotes', () => {
fireEvent.click(within(chip).getByRole('button'))
await waitFor(() => expect(deletedFiles).toEqual(['1/5']))
- expect(screen.queryByText('passport.pdf')).not.toBeInTheDocument()
+ await waitFor(() => expect(screen.queryByText('passport.pdf')).not.toBeInTheDocument())
})
it('FE-MOB-CNOTE-020: a new note uploads its queued files against the created id', async () => {
@@ -425,7 +425,7 @@ describe('MCollabNotes', () => {
expect(await screen.findByText('Ferry')).toBeInTheDocument()
})
- it('FE-MOB-CNOTE-021: toasts when detaching an existing file is rejected', async () => {
+ it('FE-MOB-CNOTE-021: keeps the chip and toasts when detaching an existing file is rejected', async () => {
serveNotes([note(1, {
title: 'Visa',
attachments: [{ id: 5, filename: 'p', original_name: 'passport.pdf', url: '/uploads/p' }],
@@ -438,6 +438,7 @@ describe('MCollabNotes', () => {
fireEvent.click(screen.getByText('Visa'))
fireEvent.click(within(screen.getByText('passport.pdf')).getByRole('button'))
await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('common.error'))
+ expect(screen.getByText('passport.pdf')).toBeInTheDocument()
})
it('FE-MOB-CNOTE-022: the attach tile opens the hidden file picker', async () => {
diff --git a/client/tests/unit/mobile/trip/MCostSheet.test.tsx b/client/tests/unit/mobile/trip/MCostSheet.test.tsx
index b0b18bbd4..02e6556dc 100644
--- a/client/tests/unit/mobile/trip/MCostSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MCostSheet.test.tsx
@@ -149,7 +149,7 @@ describe('MCostSheet', () => {
}))
})
- it('FE-MOB-COSTSH-005: an expense nobody shares is saved without payers or members', async () => {
+ it('FE-MOB-COSTSH-005: an expense nobody shares is saved without members but keeps its payer', async () => {
renderSheet()
fillBasics('Souvenir', '12')
fireEvent.click(screen.getByRole('button', { name: 'Y You' }))
@@ -157,7 +157,11 @@ describe('MCostSheet', () => {
fireEvent.click(submit())
await waitFor(() => expect(addBudgetItem).toHaveBeenCalledTimes(1))
- expect(addBudgetItem).toHaveBeenCalledWith(1, expect.objectContaining({ payers: [], members: [], member_ids: [] }))
+ // The server derives total_price from the payer sum, so the payer has to go
+ // out even with an empty split — otherwise the entry comes back at 0.
+ expect(addBudgetItem).toHaveBeenCalledWith(1, expect.objectContaining({
+ payers: [{ user_id: 1, amount: 12 }], members: [], member_ids: [],
+ }))
})
it('FE-MOB-COSTSH-006: switching the category updates the pressed pill and the payload', async () => {
diff --git a/client/tests/unit/mobile/trip/MCostsTab.test.tsx b/client/tests/unit/mobile/trip/MCostsTab.test.tsx
index ec16045d5..9a1f3029f 100644
--- a/client/tests/unit/mobile/trip/MCostsTab.test.tsx
+++ b/client/tests/unit/mobile/trip/MCostsTab.test.tsx
@@ -194,7 +194,7 @@ describe('MCostsTab', () => {
it('FE-MOB-COSTT-006: lists the settle-up flows and names the participants', async () => {
await renderTab()
- const settle = up(screen.getByText('costs.settleUp'), 2)
+ const settle = up(screen.getByText('costs.settleUp'), 3)
expect(within(settle).getByText('$40.00')).toBeInTheDocument()
expect(within(settle).getByText('$15.00')).toBeInTheDocument()
expect(within(settle).getByText('$5.00')).toBeInTheDocument()
@@ -205,22 +205,23 @@ describe('MCostsTab', () => {
it('FE-MOB-COSTT-007: shows each member balance with its sign, zero for unknown members', async () => {
await renderTab()
- const settle = up(screen.getByText('costs.settleUp'), 2)
+ const settle = up(screen.getByText('costs.settleUp'), 3)
expect(within(settle).getByText('+$12.50')).toBeInTheDocument()
expect(within(settle).getByText('−$7.25')).toBeInTheDocument()
expect(within(settle).getByText('$0.00')).toBeInTheDocument()
expect(within(settle).getByAltText('')).toHaveAttribute('src', '/uploads/avatars/ada.png')
})
- it('FE-MOB-COSTT-008: collapses and reopens the settle-up card by click and by keyboard', async () => {
+ it('FE-MOB-COSTT-008: collapses and reopens the settle-up card', async () => {
await renderTab()
- const head = screen.getByRole('button', { expanded: true })
+ // The header is a real <button> now, so Enter/Space activation is the
+ // browser's job — no key handler of our own left to exercise.
+ const head = screen.getByRole('button', { name: /costs\.settleUp/ })
+ expect(head).toHaveAttribute('aria-expanded', 'true')
fireEvent.click(head)
expect(screen.queryByText('costs.balances')).not.toBeInTheDocument()
- fireEvent.keyDown(head, { key: 'Enter' })
+ fireEvent.click(head)
expect(screen.getByText('costs.balances')).toBeInTheDocument()
- fireEvent.keyDown(head, { key: ' ' })
- expect(screen.queryByText('costs.balances')).not.toBeInTheDocument()
})
it('FE-MOB-COSTT-009: celebrates a settlement without open flows', async () => {
@@ -236,7 +237,7 @@ describe('MCostsTab', () => {
render(<MCostsTab planner={planner()} shell={buildShell()} />)
await waitFor(() => expect(settlementBases).toEqual(['USD']))
expect(screen.getByText('costs.everyoneSquare')).toBeInTheDocument()
- const settle = up(screen.getByText('costs.settleUp'), 2)
+ const settle = up(screen.getByText('costs.settleUp'), 3)
expect(within(settle).getAllByText('$0.00')).toHaveLength(3)
})
@@ -438,7 +439,9 @@ describe('MCostsTab', () => {
rerender(<MCostsTab planner={p} shell={buildShell({ exportCostsCsvSignal: 1 })} />)
expect(downloadName).toBe('costs-Tokyo Trip.csv')
- expect(revokeObjectURL).toHaveBeenCalledWith('blob:costs')
+ // The blob URL outlives the click by a beat so the download can start.
+ expect(revokeObjectURL).not.toHaveBeenCalled()
+ await waitFor(() => expect(revokeObjectURL).toHaveBeenCalledWith('blob:costs'))
const csv = await blobs[0].text()
const lines = csv.replace('', '').split('\r\n')
diff --git a/client/tests/unit/mobile/trip/MDaySheet.test.tsx b/client/tests/unit/mobile/trip/MDaySheet.test.tsx
index 465e43ba8..570378887 100644
--- a/client/tests/unit/mobile/trip/MDaySheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MDaySheet.test.tsx
@@ -10,7 +10,7 @@ import type { Accommodation, Assignment, Day, DayNote, Reservation } from '../..
import { resetAllStores, seedStore } from '../../../helpers/store'
import { act, fireEvent, render, screen, waitFor } from '../../../helpers/render'
-// FE-MOB-DAYSH-001 to FE-MOB-DAYSH-027
+// FE-MOB-DAYSH-001 to FE-MOB-DAYSH-028
const DAYS = [
{ id: 1, trip_id: 5, day_number: 1, date: '2026-05-01', title: null },
@@ -389,4 +389,13 @@ describe('MDaySheet', () => {
// The route pill is a view toggle, not an edit — it survives.
expect(screen.getByRole('button', { name: 'Route' })).toBeInTheDocument()
})
+
+ it('FE-MOB-DAYSH-028: numbers an untitled day by its position when day_number is 0', async () => {
+ const days = [
+ { id: 1, trip_id: 5, day_number: 1, date: '2026-05-01', title: null },
+ { id: 2, trip_id: 5, day_number: 0, date: '2026-05-02', title: null },
+ ] as unknown as Day[]
+ await renderSheet(makePlanner({ days, tripAccommodations: [] }))
+ expect(screen.getByRole('dialog', { name: 'Day 2' })).toBeInTheDocument()
+ })
})
diff --git a/client/tests/unit/mobile/trip/MExportSheet.test.tsx b/client/tests/unit/mobile/trip/MExportSheet.test.tsx
index a0b1dc348..be4762858 100644
--- a/client/tests/unit/mobile/trip/MExportSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MExportSheet.test.tsx
@@ -141,10 +141,29 @@ describe('MExportSheet', () => {
await waitFor(() => expect(clickSpy).toHaveBeenCalledTimes(1))
expect(clickedAnchor().getAttribute('href')).toBe('blob:trek/ics')
expect(clickedAnchor().download).toBe('Japan 2026.ics')
- expect(URL.revokeObjectURL).toHaveBeenCalledWith('blob:trek/ics')
+ // The object URL outlives the click so slower browsers can still read it.
+ expect(URL.revokeObjectURL).not.toHaveBeenCalled()
+ await waitFor(() => expect(URL.revokeObjectURL).toHaveBeenCalledWith('blob:trek/ics'))
await waitFor(() => expect(shell.closeSheet).toHaveBeenCalledTimes(1))
})
+ it('FE-MOB-EXPSH-008b: a second tap while the ics request runs is ignored', async () => {
+ let release: () => void = () => {}
+ server.use(http.get('/api/trips/1/export.ics', async () => {
+ await new Promise<void>(res => { release = res })
+ return HttpResponse.text('BEGIN:VCALENDAR')
+ }))
+ const { shell } = renderSheet()
+ fireEvent.click(screen.getByText('Download .ics'))
+
+ const busy = await screen.findByText('Loading...')
+ fireEvent.click(busy)
+ release()
+
+ await waitFor(() => expect(shell.closeSheet).toHaveBeenCalledTimes(1))
+ expect(clickSpy).toHaveBeenCalledTimes(1)
+ })
+
it('FE-MOB-EXPSH-009: falls back to a generic filename without a trip title', async () => {
server.use(http.get('/api/trips/1/export.ics', () => HttpResponse.text('BEGIN:VCALENDAR')))
renderSheet({ trip: null })
diff --git a/client/tests/unit/mobile/trip/MFileLightbox.test.tsx b/client/tests/unit/mobile/trip/MFileLightbox.test.tsx
index 7165e08c6..c59778d45 100644
--- a/client/tests/unit/mobile/trip/MFileLightbox.test.tsx
+++ b/client/tests/unit/mobile/trip/MFileLightbox.test.tsx
@@ -152,7 +152,7 @@ describe('MFileLightbox', () => {
fireEvent.click(img)
expect(onClose).not.toHaveBeenCalled()
fireEvent.click(img.parentElement as HTMLElement)
- expect(onClose).toHaveBeenCalled()
+ expect(onClose).toHaveBeenCalledTimes(1)
})
it('FE-MOB-FLBOX-012: the close button closes', () => {
diff --git a/client/tests/unit/mobile/trip/MFileTrashSheet.test.tsx b/client/tests/unit/mobile/trip/MFileTrashSheet.test.tsx
index 6f46143a6..903ff5c50 100644
--- a/client/tests/unit/mobile/trip/MFileTrashSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MFileTrashSheet.test.tsx
@@ -151,6 +151,22 @@ describe('MFileTrashSheet', () => {
expect(planner.toast.success).toHaveBeenCalledWith('files.toast.trashEmptied')
})
+ it('FE-MOB-FTRASH-011b: locks the row actions while the empty is in flight', async () => {
+ let release: () => void = () => {}
+ vi.mocked(filesApi.emptyTrash).mockImplementation(() => new Promise(resolve => { release = () => resolve({}) }))
+ renderSheet()
+ await settled()
+ fireEvent.click(screen.getByRole('button', { name: 'files.emptyTrash' }))
+ const confirm = screen.getByRole('dialog', { name: 'files.emptyTrash' })
+ fireEvent.click(within(confirm).getByRole('button', { name: 'files.emptyTrash' }))
+
+ expect(screen.getAllByRole('button', { name: 'files.restore' })[0]).toBeDisabled()
+ expect(screen.getAllByRole('button', { name: 'common.delete' })[0]).toBeDisabled()
+
+ await act(async () => { release() })
+ expect(filesApi.restore).not.toHaveBeenCalled()
+ })
+
it('FE-MOB-FTRASH-012: reports a failed empty', async () => {
vi.mocked(filesApi.emptyTrash).mockRejectedValue(new Error('nope'))
const { planner } = renderSheet()
diff --git a/client/tests/unit/mobile/trip/MFilesTab.test.tsx b/client/tests/unit/mobile/trip/MFilesTab.test.tsx
index 7b99e3dfb..1bdecc2d0 100644
--- a/client/tests/unit/mobile/trip/MFilesTab.test.tsx
+++ b/client/tests/unit/mobile/trip/MFilesTab.test.tsx
@@ -321,6 +321,21 @@ describe('MFilesTab', () => {
expect(planner.toast.success).not.toHaveBeenCalled()
})
+ it('FE-MOB-FTAB-021b: one rejected file does not drop the rest of the batch', async () => {
+ const tripActions = buildTripActions()
+ tripActions.addFile
+ .mockRejectedValueOnce(new Error('server-500'))
+ .mockResolvedValueOnce(undefined)
+ const { container, planner } = renderTab({ tripActions } as unknown as Partial<TripPlanner>)
+ fireEvent.change(hiddenInput(container), {
+ target: { files: [makeFile('a.pdf', 'application/pdf'), makeFile('b.pdf', 'application/pdf')] },
+ })
+
+ await waitFor(() => expect(planner.toast.success).toHaveBeenCalledWith('files.uploaded:1'))
+ expect(planner.tripActions.addFile).toHaveBeenCalledTimes(2)
+ expect(planner.toast.error).toHaveBeenCalledWith('files.uploadError')
+ })
+
it('FE-MOB-FTAB-022: the uploading pill shows while the request is in flight', async () => {
let release: () => void = () => {}
const tripActions = buildTripActions()
diff --git a/client/tests/unit/mobile/trip/MNoteSheet.test.tsx b/client/tests/unit/mobile/trip/MNoteSheet.test.tsx
index a2370b697..eb3177b47 100644
--- a/client/tests/unit/mobile/trip/MNoteSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MNoteSheet.test.tsx
@@ -242,4 +242,20 @@ describe('MNoteSheet', () => {
expect(screen.getByPlaceholderText('dayplan.noteSubtitle')).toHaveValue('')
expect(screen.getByRole('button', { name: 'Car' })).toHaveAttribute('aria-pressed', 'true')
})
+
+ it('FE-MOB-NOTESH-019: a fresh payload object for the same note keeps the typed draft', () => {
+ const planner = buildPlanner({ tripId: 3, selectedDayId: 7 })
+ const onClose = vi.fn()
+ const { rerender } = render(
+ <MNoteSheet planner={planner} open payload={{ dayId: 7, note: NOTE }} onClose={onClose} />,
+ )
+ typeTitle('Buy museum tickets for four')
+ // Same day, same note — only the wrapper object is new (inline payload or a
+ // store refresh), so the draft must survive.
+ rerender(
+ <MNoteSheet planner={planner} open payload={{ dayId: 7, note: { ...NOTE } }} onClose={onClose} />,
+ )
+
+ expect(screen.getByPlaceholderText('dayplan.noteTitle *')).toHaveValue('Buy museum tickets for four')
+ })
})
diff --git a/client/tests/unit/mobile/trip/MPackItemSheet.test.tsx b/client/tests/unit/mobile/trip/MPackItemSheet.test.tsx
index dda837593..b4874bd0c 100644
--- a/client/tests/unit/mobile/trip/MPackItemSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MPackItemSheet.test.tsx
@@ -5,7 +5,7 @@ import type { PackingItem, TripMember } from '../../../../src/types'
import { buildPlanner } from '../../../helpers/mobileTrip'
import { fireEvent, render, screen, waitFor } from '../../../helpers/render'
-// FE-MOB-PACKITEM-001 to FE-MOB-PACKITEM-020
+// FE-MOB-PACKITEM-001 to FE-MOB-PACKITEM-024
const ME = 7
const ANNA = { id: 11, username: 'anna', avatar: 'anna.png', avatar_url: null } as unknown as TripMember
@@ -236,4 +236,15 @@ describe('MPackItemSheet', () => {
expect(onClose).toHaveBeenCalledTimes(2)
})
+
+ it('FE-MOB-PACKITEM-024: a store refresh of the open item keeps the typed draft', () => {
+ const { view, planner, ...props } = setup()
+ fireEvent.change(screen.getByDisplayValue('Rain jacket'), { target: { value: 'Rain shell' } })
+ // packingSlice replaces the item object on every update, so a WebSocket
+ // refresh of the same id must not reseed the fields.
+ const refreshed = buildPlanner({ tripId: 3, packingItems: [packItem()], t: planner.t })
+ view.rerender(<MPackItemSheet {...props} planner={refreshed} />)
+
+ expect(screen.getByDisplayValue('Rain shell')).toBeInTheDocument()
+ })
})
diff --git a/client/tests/unit/mobile/trip/MPackingListTab.test.tsx b/client/tests/unit/mobile/trip/MPackingListTab.test.tsx
index 8c6da6a9c..5a4ad5d21 100644
--- a/client/tests/unit/mobile/trip/MPackingListTab.test.tsx
+++ b/client/tests/unit/mobile/trip/MPackingListTab.test.tsx
@@ -226,7 +226,9 @@ describe('MPackingListTab', () => {
expect(screen.getByText('12 admin.packingTemplates.items')).toBeInTheDocument()
await act(async () => { fireEvent.click(screen.getByRole('button', { name: /Beach trip/ })) })
- expect(packingApi.applyTemplate).toHaveBeenCalledWith(3, 91)
+ // The visibility follows the Shared|My-list toggle so the items land where
+ // the user can see them.
+ expect(packingApi.applyTemplate).toHaveBeenCalledWith(3, 91, 'common')
expect(planner.toast.success).toHaveBeenCalledWith('packing.templateApplied:1')
expect(useTripStore.getState().packingItems.map(i => i.id)).toEqual([30])
expect(screen.queryByRole('button', { name: /Beach trip/ })).toBeNull()
diff --git a/client/tests/unit/mobile/trip/MPlaceSheet.test.tsx b/client/tests/unit/mobile/trip/MPlaceSheet.test.tsx
index b9db692b8..cde8129d1 100644
--- a/client/tests/unit/mobile/trip/MPlaceSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MPlaceSheet.test.tsx
@@ -349,7 +349,7 @@ describe('MPlaceSheet', () => {
expect(openPicker).not.toHaveBeenCalled()
await act(async () => { rejectUpdate(new Error('nope')) })
- await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('Could not upload image'))
+ await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('Could not remove image'))
})
it('FE-MOB-PLSH-022: hands the place to the save-to-collection picker', () => {
@@ -407,4 +407,21 @@ describe('MPlaceSheet', () => {
// Read-only members still get the navigation actions.
expect(screen.getByRole('button', { name: 'Google Maps' })).toBeInTheDocument()
})
+
+ it('FE-MOB-PLSH-026: collapses the track colour picker again when the sheet closes', () => {
+ const place = { ...PLACE, route_geometry: 'x', route_color: null } as unknown as Place
+ const planner = makePlanner({ selectedPlace: place })
+ const shell = makeShell()
+ const { rerender } = render(<MPlaceSheet planner={planner} shell={shell} />)
+
+ fireEvent.click(screen.getByRole('button', { name: /Automatic color/ }))
+ expect(screen.getAllByRole('button', { name: /Automatic color/ })[0]).toHaveAttribute('aria-expanded', 'true')
+
+ // The component stays mounted across selections — only MSheet's children unmount.
+ fireEvent.click(screen.getByRole('button', { name: 'Close' }))
+ rerender(<MPlaceSheet planner={makePlanner({ selectedPlace: null })} shell={shell} />)
+ rerender(<MPlaceSheet planner={planner} shell={shell} />)
+
+ expect(screen.getAllByRole('button', { name: /Automatic color/ })[0]).toHaveAttribute('aria-expanded', 'false')
+ })
})
diff --git a/client/tests/unit/mobile/trip/MPlacesBrowser.test.tsx b/client/tests/unit/mobile/trip/MPlacesBrowser.test.tsx
index 5bba47519..8ecbaaf57 100644
--- a/client/tests/unit/mobile/trip/MPlacesBrowser.test.tsx
+++ b/client/tests/unit/mobile/trip/MPlacesBrowser.test.tsx
@@ -10,7 +10,7 @@ import { resetAllStores, seedStore } from '../../../helpers/store'
import type { MTripShellApi, TripPlanner } from '../../../../src/mobile/screens/trip/MTripShell'
import type { AssignmentsMap, Category, Day, Place } from '../../../../src/types'
-// FE-MOB-PBROW-001 to FE-MOB-PBROW-029
+// FE-MOB-PBROW-001 to FE-MOB-PBROW-030
const CATEGORIES = [
{ id: 1, name: 'Sights', color: '#123456', icon: 'landmark' },
@@ -241,18 +241,30 @@ describe('MPlacesBrowser', () => {
expect(screen.getByRole('button', { name: 'common.selectAll' })).toBeEnabled()
})
- it('FE-MOB-PBROW-018: the bulk category sheet applies the pick and leaves select mode', () => {
+ it('FE-MOB-PBROW-018: the bulk category sheet applies the pick and leaves select mode once it resolved', async () => {
const { planner } = renderBrowser()
fireEvent.click(screen.getByRole('button', { name: 'common.select' }))
fireEvent.click(row('Louvre'))
fireEvent.click(screen.getByRole('button', { name: 'places.changeCategory' }))
expect(screen.getByRole('dialog', { name: 'Change category' })).toBeInTheDocument()
- fireEvent.click(screen.getByRole('button', { name: 'Food' }))
+ await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'Food' })) })
expect(planner.confirmChangeCategory).toHaveBeenCalledWith([1], 2)
expect(screen.queryByText(/places.selectionCount/)).not.toBeInTheDocument()
})
+ it('FE-MOB-PBROW-018b: a failed bulk category change keeps the selection for a retry', async () => {
+ const planner = makePlanner()
+ ;(planner.confirmChangeCategory as ReturnType<typeof vi.fn>).mockRejectedValueOnce(new Error('nope'))
+ renderBrowser(planner)
+ fireEvent.click(screen.getByRole('button', { name: 'common.select' }))
+ fireEvent.click(row('Louvre'))
+ fireEvent.click(screen.getByRole('button', { name: 'places.changeCategory' }))
+ await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'Food' })) })
+
+ expect(screen.getByText('places.selectionCount:1')).toBeInTheDocument()
+ })
+
it('FE-MOB-PBROW-019: dismissing the category sheet keeps the selection untouched', async () => {
const { planner } = renderBrowser()
fireEvent.click(screen.getByRole('button', { name: 'common.select' }))
@@ -265,7 +277,7 @@ describe('MPlacesBrowser', () => {
expect(screen.getByText('places.selectionCount:1')).toBeInTheDocument()
})
- it('FE-MOB-PBROW-020: the delete confirmation removes the selection in one call', () => {
+ it('FE-MOB-PBROW-020: the delete confirmation removes the selection in one call', async () => {
const { planner } = renderBrowser()
fireEvent.click(screen.getByRole('button', { name: 'common.select' }))
fireEvent.click(row('Louvre'))
@@ -273,11 +285,23 @@ describe('MPlacesBrowser', () => {
fireEvent.click(screen.getByRole('button', { name: 'places.deleteSelected' }))
expect(screen.getByText('trip.confirm.deletePlaces:2')).toBeInTheDocument()
- fireEvent.click(screen.getByRole('button', { name: 'common.delete' }))
+ await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.delete' })) })
expect(planner.confirmDeletePlaces).toHaveBeenCalledWith([1, 3])
expect(screen.queryByText(/places.selectionCount/)).not.toBeInTheDocument()
})
+ it('FE-MOB-PBROW-020b: a failed bulk delete keeps the selection for a retry', async () => {
+ const planner = makePlanner()
+ ;(planner.confirmDeletePlaces as ReturnType<typeof vi.fn>).mockRejectedValueOnce(new Error('nope'))
+ renderBrowser(planner)
+ fireEvent.click(screen.getByRole('button', { name: 'common.select' }))
+ fireEvent.click(row('Louvre'))
+ fireEvent.click(screen.getByRole('button', { name: 'places.deleteSelected' }))
+ await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.delete' })) })
+
+ expect(screen.getByText('places.selectionCount:1')).toBeInTheDocument()
+ })
+
it('FE-MOB-PBROW-021: cancelling the delete keeps the selection intact', () => {
const { planner } = renderBrowser()
fireEvent.click(screen.getByRole('button', { name: 'common.select' }))
@@ -357,4 +381,21 @@ describe('MPlacesBrowser', () => {
})
expect(screen.getByText('places.selectionCount:2')).toBeInTheDocument()
})
+
+ it('FE-MOB-PBROW-030: a selection that only matches the visible pool in size is not "all selected"', () => {
+ renderBrowser()
+ fireEvent.click(screen.getByRole('button', { name: 'common.select' }))
+ fireEvent.click(row('Louvre'))
+ fireEvent.click(row('Eiffel Tower'))
+
+ // Narrow to the two categorised places: two visible, two selected — but not
+ // the same two, so the toolbar must still offer select-all.
+ fireEvent.click(screen.getByRole('button', { name: 'places.allCategories' }))
+ fireEvent.click(screen.getByRole('checkbox', { name: 'Sights' }))
+ fireEvent.click(screen.getByRole('checkbox', { name: 'Food' }))
+
+ expect(screen.getByText('places.count:2')).toBeInTheDocument()
+ expect(screen.getByText('places.selectionCount:2')).toBeInTheDocument()
+ expect(screen.getByRole('button', { name: 'common.selectAll' })).toBeInTheDocument()
+ })
})
diff --git a/client/tests/unit/mobile/trip/MPlanTimeline.test.tsx b/client/tests/unit/mobile/trip/MPlanTimeline.test.tsx
index fc49ed462..7bf2ec6d1 100644
--- a/client/tests/unit/mobile/trip/MPlanTimeline.test.tsx
+++ b/client/tests/unit/mobile/trip/MPlanTimeline.test.tsx
@@ -315,10 +315,14 @@ describe('MPlanTimeline', () => {
})
describe('per-segment travel mode', () => {
+ /** The timeline only offers the mode menu in edit mode, where many buttons exist. */
+ const renderEditing = () => renderTimeline({}, {}, { mode: 'edit' })
+ const connector = () => screen.getByText('7 min').closest('button') as HTMLElement
+
it('FE-MOB-PLTL-017: a connector with an origin assignment opens the mode menu', () => {
- renderTimeline()
+ renderEditing()
- fireEvent.click(screen.getByRole('button'))
+ fireEvent.click(connector())
expect(screen.getByText('Driving')).toBeInTheDocument()
expect(screen.getByText('Walking')).toBeInTheDocument()
@@ -327,8 +331,8 @@ describe('MPlanTimeline', () => {
})
it('FE-MOB-PLTL-018: picking a mode sets it on the origin assignment', () => {
- renderTimeline()
- fireEvent.click(screen.getByRole('button'))
+ renderEditing()
+ fireEvent.click(connector())
fireEvent.click(screen.getByText('Walking'))
@@ -336,8 +340,8 @@ describe('MPlanTimeline', () => {
})
it('FE-MOB-PLTL-019: the default entry clears the override', () => {
- renderTimeline()
- fireEvent.click(screen.getByRole('button'))
+ renderEditing()
+ fireEvent.click(connector())
fireEvent.click(screen.getByText('dayplan.transportMode.useDefault'))
@@ -345,8 +349,15 @@ describe('MPlanTimeline', () => {
})
it('FE-MOB-PLTL-020: read-only members get no tappable connectors', () => {
- const { container } = renderTimeline({}, { can: vi.fn(() => false) })
+ const { container } = renderTimeline({}, { can: vi.fn(() => false) }, { mode: 'edit' })
+
+ expect(container.querySelector('button')).toBeNull()
+ })
+
+ it('FE-MOB-PLTL-020b: go mode keeps the connectors read-only even with edit rights', () => {
+ const { container } = renderTimeline()
+ expect(screen.getByText('7 min').closest('button')).toBeNull()
expect(container.querySelector('button')).toBeNull()
})
})
diff --git a/client/tests/unit/mobile/trip/MPlanTimelineRows.test.tsx b/client/tests/unit/mobile/trip/MPlanTimelineRows.test.tsx
index 1f13f145d..eb7446468 100644
--- a/client/tests/unit/mobile/trip/MPlanTimelineRows.test.tsx
+++ b/client/tests/unit/mobile/trip/MPlanTimelineRows.test.tsx
@@ -7,7 +7,7 @@ import type { TransitMeta, TransportEntry } from '../../../../src/mobile/screens
import type { PluginDayScheduleItem } from '../../../../src/api/client'
import type { Assignment, DayNote, Place, Reservation, RouteSegment, TranslationFn } from '../../../../src/types'
-// FE-MOB-PLROW-001 to FE-MOB-PLROW-038
+// FE-MOB-PLROW-001 to FE-MOB-PLROW-041
// Same echo strategy as tests/helpers/mobileTrip: assertions stay on keys, not copy.
const t: TranslationFn = (key, params) =>
@@ -300,6 +300,21 @@ describe('TransitRow', () => {
expect(screen.queryByText('transit.min:1 · transit.walkTo:Hotel')).not.toBeInTheDocument()
})
+ it('FE-MOB-PLROW-041: a walk without a duration stays in the strip, like in the expanded list', () => {
+ const transit: TransitMeta = {
+ legs: [
+ { mode: 'WALK', to: { name: 'Shibuya Sta.' } },
+ { mode: 'SUBWAY', line: 'G', duration: 1500, from: { name: 'Shibuya Sta.' }, to: { name: 'Asakusa Sta.' } },
+ ],
+ }
+ const { container } = render(<TransitRow {...base} transit={transit} open={false} />)
+
+ // the strip renders both legs: the footprint chip plus the line badge
+ const strip = container.querySelector('.flex-wrap') as HTMLElement
+ expect(strip.children).toHaveLength(2)
+ expect(screen.getByText('G')).toBeInTheDocument()
+ })
+
it('FE-MOB-PLROW-023: expanding renders every leg with duration, stops and platform', () => {
render(<TransitRow {...base} open />)
@@ -422,17 +437,32 @@ describe('HotelConnRow', () => {
const top = container.firstElementChild as HTMLElement
expect(top.children[0].textContent).toBe('Hotel Sacher')
- expect(top.children[1].textContent).toContain('1 h 5 min')
- expect(top.children[1].textContent).toContain('· 5.4 km ·')
expect(top.children[1].textContent).toContain('14 min')
+ expect(top.children[1].textContent).toContain('· 5.4 km')
unmount()
const bottom = render(<HotelConnRow seg={SEG} name="Hotel Sacher" placement="bottom" />)
.container.firstElementChild as HTMLElement
- expect(bottom.children[0].textContent).toContain('1 h 5 min')
+ expect(bottom.children[0].textContent).toContain('14 min')
expect(bottom.children[1].textContent).toBe('Hotel Sacher')
})
+
+ it('FE-MOB-PLROW-039: a bookend leg reads its travel mode like every other connector', () => {
+ const seg = { ...SEG, mode: 'plugin:ev/fastest', durationText: '22 min', noteText: '25 min charge' }
+ render(<HotelConnRow seg={seg} name="Hotel Sacher" placement="top" />)
+
+ expect(screen.getByText('22 min')).toBeInTheDocument()
+ expect(screen.getByText('25 min charge')).toBeInTheDocument()
+ expect(screen.queryByText('1 h 5 min')).not.toBeInTheDocument()
+ })
+
+ it('FE-MOB-PLROW-040: a walking bookend leg shows the walking duration', () => {
+ render(<HotelConnRow seg={{ ...SEG, mode: 'walking' }} name="Hotel Sacher" placement="bottom" />)
+
+ expect(screen.getByText('1 h 5 min')).toBeInTheDocument()
+ expect(screen.queryByText('14 min')).not.toBeInTheDocument()
+ })
})
describe('NoteRow', () => {
diff --git a/client/tests/unit/mobile/trip/MReservationSheet.test.tsx b/client/tests/unit/mobile/trip/MReservationSheet.test.tsx
index 18a1d808c..f168a4654 100644
--- a/client/tests/unit/mobile/trip/MReservationSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MReservationSheet.test.tsx
@@ -343,6 +343,21 @@ describe('MReservationSheet', () => {
expect(onOpenExpense).not.toHaveBeenCalled()
})
+ it('FE-MOB-RESSH-018b: an all-day booking that ends on its start day is savable', async () => {
+ const { planner } = setup()
+ type(titleField(), 'Museum pass')
+ type(dates()[0], '2026-05-02')
+ type(dates()[1], '2026-05-02')
+
+ expect(screen.queryByText('reservations.validation.endBeforeStart')).toBeNull()
+ fireEvent.click(submitBtn())
+ await waitFor(() => expect(planner.handleSaveReservation).toHaveBeenCalled())
+ expect(savedPayload(planner)).toMatchObject({
+ reservation_time: '2026-05-02',
+ reservation_end_time: '2026-05-02',
+ })
+ })
+
// ── Editing an existing booking ────────────────────────────────────────────
it('FE-MOB-RESSH-019: editing seeds every field and splits the end timestamp', () => {
diff --git a/client/tests/unit/mobile/trip/MTaskSheet.test.tsx b/client/tests/unit/mobile/trip/MTaskSheet.test.tsx
index 166890264..31cd3c403 100644
--- a/client/tests/unit/mobile/trip/MTaskSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MTaskSheet.test.tsx
@@ -272,7 +272,9 @@ describe('MTaskSheet', () => {
it('FE-MOB-TASK-018: keeps a stored category that is not in the offered list', async () => {
const { actions } = setup({ items: [todo({ category: 'Legacy' })], itemId: 42, categories: ['Admin'] })
- fireEvent.click(screen.getByRole('button', { name: 'Legacy' }))
+ // It has no pill to switch to, so it shows as the active label rather than a button.
+ expect(screen.getByText('Legacy')).toBeInTheDocument()
+ expect(screen.queryByRole('button', { name: 'Legacy' })).not.toBeInTheDocument()
fireEvent.click(screen.getByRole('button', { name: 'todo.detail.save' }))
await waitFor(() => expect(actions.updateTodoItem).toHaveBeenCalledWith(1, 42, expect.objectContaining({ category: 'Legacy' })))
@@ -288,7 +290,7 @@ describe('MTaskSheet', () => {
fireEvent.change(screen.getByPlaceholderText('todo.newCategory'), { target: { value: ' Docs ' } })
fireEvent.click(screen.getByRole('button', { name: 'common.add' }))
- expect(screen.getByRole('button', { name: 'Docs' })).toBeInTheDocument()
+ expect(screen.getByText('Docs')).toBeInTheDocument()
fireEvent.click(screen.getByRole('button', { name: 'todo.detail.create' }))
await waitFor(() => expect(actions.addTodoItem).toHaveBeenCalledWith(1, expect.objectContaining({ category: 'Docs' })))
})
@@ -299,15 +301,15 @@ describe('MTaskSheet', () => {
fireEvent.click(screen.getByRole('button', { name: /todo.addCategory/ }))
fireEvent.change(screen.getByPlaceholderText('todo.newCategory'), { target: { value: 'Docs' } })
fireEvent.keyDown(screen.getByPlaceholderText('todo.newCategory'), { key: 'Enter' })
- expect(screen.getByRole('button', { name: 'Docs' })).toBeInTheDocument()
+ expect(screen.getByText('Docs')).toBeInTheDocument()
fireEvent.click(screen.getByRole('button', { name: /todo.addCategory/ }))
fireEvent.change(screen.getByPlaceholderText('todo.newCategory'), { target: { value: 'Ignored' } })
fireEvent.keyDown(screen.getByPlaceholderText('todo.newCategory'), { key: 'Escape' })
expect(screen.queryByPlaceholderText('todo.newCategory')).not.toBeInTheDocument()
- expect(screen.queryByRole('button', { name: 'Ignored' })).not.toBeInTheDocument()
- expect(screen.getByRole('button', { name: 'Docs' })).toBeInTheDocument()
+ expect(screen.queryByText('Ignored')).not.toBeInTheDocument()
+ expect(screen.getByText('Docs')).toBeInTheDocument()
})
it('FE-MOB-TASK-021: keeps the current category when the draft is blank', () => {
diff --git a/client/tests/unit/mobile/trip/MTodoListTab.test.tsx b/client/tests/unit/mobile/trip/MTodoListTab.test.tsx
index ff2b6ae2b..d792badbc 100644
--- a/client/tests/unit/mobile/trip/MTodoListTab.test.tsx
+++ b/client/tests/unit/mobile/trip/MTodoListTab.test.tsx
@@ -9,7 +9,7 @@ import { buildPlanner, buildTripActions } from '../../../helpers/mobileTrip'
import { resetAllStores, seedStore } from '../../../helpers/store'
import { fireEvent, render, screen } from '../../../helpers/render'
-// FE-MOB-TODO-001 to FE-MOB-TODO-016
+// FE-MOB-TODO-001 to FE-MOB-TODO-019
// The sheet has its own suite; here it only has to report the props the tab feeds it.
vi.mock('../../../../src/mobile/screens/trip/tabs/MTaskSheet', () => ({
@@ -293,4 +293,27 @@ describe('MTodoListTab', () => {
expect(sheet()).toHaveAttribute('data-open', 'true')
expect(sheet()).toHaveAttribute('data-item-id', '42')
})
+
+ it('FE-MOB-TODO-018: a category named like a built-in filter keeps its own bucket', () => {
+ setup([
+ todo({ id: 1, name: 'Visa', category: 'done' }),
+ todo({ id: 2, name: 'Insurance', category: 'done', checked: 1 }),
+ todo({ id: 3, name: 'Boots' }),
+ ])
+
+ fireEvent.click(screen.getByRole('button', { name: 'done1' }))
+
+ expect(screen.getByText('Visa')).toBeInTheDocument()
+ expect(screen.getByText('Insurance')).toBeInTheDocument()
+ expect(screen.queryByText('Boots')).not.toBeInTheDocument()
+
+ fireEvent.click(screen.getByRole('button', { name: /todo.newItem/ }))
+ expect(sheet()).toHaveAttribute('data-default-category', 'done')
+ })
+
+ it('FE-MOB-TODO-019: shows an unparseable due date as it is stored', () => {
+ setup([todo({ id: 3, name: 'Book flights', due_date: 'sometime' })])
+
+ expect(screen.getByText('sometime')).toBeInTheDocument()
+ })
})
diff --git a/client/tests/unit/mobile/trip/MTransportFormSheet.test.tsx b/client/tests/unit/mobile/trip/MTransportFormSheet.test.tsx
index fb59e9d8d..be5ecf4a5 100644
--- a/client/tests/unit/mobile/trip/MTransportFormSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MTransportFormSheet.test.tsx
@@ -8,7 +8,7 @@ import { buildPlanner } from '../../../helpers/mobileTrip'
import { resetAllStores, seedStore } from '../../../helpers/store'
import { act, fireEvent, render, screen } from '../../../helpers/render'
-// FE-MOB-TRFRM-001 to FE-MOB-TRFRM-045
+// FE-MOB-TRFRM-001 to FE-MOB-TRFRM-046
//
// The sheet's own pickers (airport/location search, day select, time picker) and
// the embedded transit panel are replaced by minimal controlled stand-ins so the
@@ -448,6 +448,28 @@ describe('MTransportFormSheet', () => {
])
})
+ it('FE-MOB-TRFRM-046: a train row without a picked station no longer anchors the arrival', async () => {
+ const handleSaveTransport = makeSave()
+ renderSheet(makePlanner({ handleSaveTransport }))
+ fireEvent.click(screen.getByRole('button', { name: 'reservations.type.train' }))
+ typeTitle('Osaka departure')
+ setValue(locationInputs()[0], 'osaka')
+ setValue(daySelects()[0], '12')
+ setValue(timeInputs()[0], '07:45')
+ // The arrival row carries a day and a time but never gets a station.
+ setValue(daySelects()[1], '13')
+ setValue(timeInputs()[1], '09:12')
+
+ await submit()
+
+ const payload = handleSaveTransport.mock.calls[0][0]
+ expect(payload.endpoints).toEqual([expect.objectContaining({ role: 'from', name: 'Osaka Station' })])
+ expect(payload.day_id).toBe(12)
+ expect(payload.reservation_time).toBe('2026-05-02T07:45')
+ expect(payload.end_day_id).toBeNull()
+ expect(payload.reservation_end_time).toBeNull()
+ })
+
it('FE-MOB-TRFRM-043: removing a train stop restores the two-station route', () => {
renderSheet(makePlanner())
fireEvent.click(screen.getByRole('button', { name: 'reservations.type.train' }))
@@ -470,9 +492,10 @@ describe('MTransportFormSheet', () => {
renderSheet(makePlanner({ editingTransport }))
expect(locationInputs().map(i => i.value)).toEqual(['Osaka Station', 'Nara Station', 'Kyoto Station'])
- // The stop's own local_time seeds both its arrival and its departure.
+ // The stop's own local_time and local_date seed both its arrival and its departure —
+ // without metadata.legs the endpoint is the only record of the stop's day.
expect(timeInputs().map(i => i.value)).toEqual(['08:00', '08:40', '08:40', '09:35'])
- expect(daySelects().map(s => s.value)).toEqual(['12', '', '', '13'])
+ expect(daySelects().map(s => s.value)).toEqual(['12', '12', '12', '13'])
expect(screen.getAllByPlaceholderText('ICE 123')[0]).toHaveValue('JR 12')
expect(screen.getAllByPlaceholderText('42A')[0]).toHaveValue('5B')
})
diff --git a/client/tests/unit/mobile/trip/MTransportSheet.test.tsx b/client/tests/unit/mobile/trip/MTransportSheet.test.tsx
index 28da4cc5c..d91d60070 100644
--- a/client/tests/unit/mobile/trip/MTransportSheet.test.tsx
+++ b/client/tests/unit/mobile/trip/MTransportSheet.test.tsx
@@ -33,8 +33,6 @@ function makePlanner(overrides: Record<string, unknown> = {}) {
return buildPlanner({
reservations: [FLIGHT],
files: [],
- // The real planner exposes the visible connection ids as an array.
- visibleConnections: [],
...overrides,
} as unknown as Parameters<typeof buildPlanner>[0])
}
diff --git a/client/tests/unit/mobile/trip/MTransportsTab.test.tsx b/client/tests/unit/mobile/trip/MTransportsTab.test.tsx
index 4ea00ab67..17e5d078d 100644
--- a/client/tests/unit/mobile/trip/MTransportsTab.test.tsx
+++ b/client/tests/unit/mobile/trip/MTransportsTab.test.tsx
@@ -204,12 +204,14 @@ describe('MTransportsTab', () => {
expect(openFile).toHaveBeenCalledWith('/uploads/f/201', 'boarding-pass.pdf')
})
- it('FE-MOB-TRTAB-014: reveals a blurred confirmation code on tap', () => {
+ it('FE-MOB-TRTAB-014: reveals a blurred confirmation code through a real button', () => {
renderTab(planner({ settings: buildSettings({ time_format: '24h', blur_booking_codes: true }) }))
- const code = within(cardOf('HND to ITM')).getByText('ABC123')
+ // A button, not a bare div — the reveal has to be reachable by keyboard.
+ const code = within(cardOf('HND to ITM')).getByRole('button', { name: 'ABC123' })
expect(code).toHaveClass('blur-[4px]')
fireEvent.click(code)
expect(code).not.toHaveClass('blur-[4px]')
+ expect(code).toHaveAttribute('aria-pressed', 'true')
})
it('FE-MOB-TRTAB-015: opens the transport detail sheet from the row', () => {
diff --git a/client/tests/unit/mobile/trip/MTripLoadingSplash.test.tsx b/client/tests/unit/mobile/trip/MTripLoadingSplash.test.tsx
index 3d27394d6..d2cf7d22d 100644
--- a/client/tests/unit/mobile/trip/MTripLoadingSplash.test.tsx
+++ b/client/tests/unit/mobile/trip/MTripLoadingSplash.test.tsx
@@ -2,25 +2,36 @@ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { act, render, screen } from '../../../helpers/render'
import MTripLoadingSplash from '../../../../src/mobile/screens/trip/MTripLoadingSplash'
-// FE-MOB-SPLASH-001 to FE-MOB-SPLASH-010
+// FE-MOB-SPLASH-001 to FE-MOB-SPLASH-012
const STEP_MS = 1400
const origMatchMedia = window.matchMedia
+/** One shared query object per stub so a test can flip `matches` and notify. */
+let mediaQuery: { matches: boolean; listeners: Set<() => void> }
+
function stubReducedMotion(matches: boolean) {
+ mediaQuery = { matches, listeners: new Set() }
window.matchMedia = vi.fn().mockImplementation((query: string) => ({
- matches,
+ get matches() { return mediaQuery.matches },
media: query,
onchange: null,
addListener: vi.fn(),
removeListener: vi.fn(),
- addEventListener: vi.fn(),
- removeEventListener: vi.fn(),
+ addEventListener: (_type: string, fn: () => void) => mediaQuery.listeners.add(fn),
+ removeEventListener: (_type: string, fn: () => void) => mediaQuery.listeners.delete(fn),
dispatchEvent: vi.fn(),
})) as unknown as typeof window.matchMedia
}
+function setReducedMotion(matches: boolean) {
+ act(() => {
+ mediaQuery.matches = matches
+ mediaQuery.listeners.forEach(fn => fn())
+ })
+}
+
const tick = (ms: number) => act(() => { vi.advanceTimersByTime(ms) })
const dots = (container: HTMLElement) =>
@@ -124,6 +135,28 @@ describe('MTripLoadingSplash', () => {
expect(stage?.getAttribute('style')).toBeNull()
})
+ it('FE-MOB-SPLASH-011: follows the OS setting while the splash is up', () => {
+ const { container } = render(<MTripLoadingSplash title="Japan 2026" />)
+ expect(screen.getByText('Packing your bags...')).toBeInTheDocument()
+
+ setReducedMotion(true)
+
+ expect(screen.getByText('Loading place photos...')).toBeInTheDocument()
+ expect(activeDotIndex(container)).toBe(2)
+
+ tick(STEP_MS * 2)
+ expect(screen.getByText('Loading place photos...')).toBeInTheDocument()
+ })
+
+ it('FE-MOB-SPLASH-012: drops the media listener on unmount', () => {
+ const { unmount } = render(<MTripLoadingSplash title="Japan 2026" />)
+
+ expect(mediaQuery.listeners.size).toBe(1)
+ unmount()
+
+ expect(mediaQuery.listeners.size).toBe(0)
+ })
+
it('FE-MOB-SPLASH-010: clears its beat interval on unmount', () => {
const before = vi.getTimerCount()
const { unmount } = render(<MTripLoadingSplash title="Japan 2026" />)
diff --git a/client/tests/unit/mobile/trip/MTripShell.test.tsx b/client/tests/unit/mobile/trip/MTripShell.test.tsx
index 529a15665..5d731594e 100644
--- a/client/tests/unit/mobile/trip/MTripShell.test.tsx
+++ b/client/tests/unit/mobile/trip/MTripShell.test.tsx
@@ -230,8 +230,8 @@ describe('MTripShell', () => {
renderShell({ days } as Partial<TripPlanner>)
expect(screen.getByRole('button', { name: 'planner.dayN:1' })).toBeInTheDocument()
expect(screen.getByRole('button', { name: 'planner.dayN:2' })).toBeInTheDocument()
- // A day the server sent without a number still gets a chip.
- expect(screen.getByRole('button', { name: 'planner.dayN:0' })).toBeInTheDocument()
+ // A day the server sent without a number falls back to its position.
+ expect(screen.getByRole('button', { name: 'planner.dayN:3' })).toBeInTheDocument()
})
it('FE-MOB-SHELL-020: tapping another day selects it and fits the list view', () => {
diff --git a/client/tests/unit/mobile/trip/listsModel.test.ts b/client/tests/unit/mobile/trip/listsModel.test.ts
index 48f60a75e..17dbe1b57 100644
--- a/client/tests/unit/mobile/trip/listsModel.test.ts
+++ b/client/tests/unit/mobile/trip/listsModel.test.ts
@@ -154,10 +154,9 @@ describe('listsModel — to-do', () => {
expect(filterTodoItems(items, 'Nope', 7, TODAY)).toEqual([]);
});
- it('FE-MOB-LSTM-020: without a current user "my" collects the unassigned rows', () => {
- // Same comparison the desktop sidebar does (useTodoList.ts:74): a null user id
- // matches every unassigned item, unlike todoCounts which zeroes "my" instead.
- expect(filterTodoItems(items, 'my', null, TODAY).map(i => i.id)).toEqual([1, 3]);
+ it('FE-MOB-LSTM-020: without a current user "my" is empty, like the badge', () => {
+ expect(filterTodoItems(items, 'my', null, TODAY)).toEqual([]);
+ expect(filterTodoItems(items, 'my', null, TODAY)).toHaveLength(todoCounts(items, null, TODAY).my);
});
it('FE-MOB-LSTM-014: sortTodoRows floats overdue rows up and sinks done rows', () => {
diff --git a/client/tests/unit/mobile/trip/useMPlanTimeline.test.ts b/client/tests/unit/mobile/trip/useMPlanTimeline.test.ts
index c7c28470f..486990ffc 100644
--- a/client/tests/unit/mobile/trip/useMPlanTimeline.test.ts
+++ b/client/tests/unit/mobile/trip/useMPlanTimeline.test.ts
@@ -434,7 +434,7 @@ describe('useMPlanTimeline', () => {
expect(useTripStore.getState().reservations.map(r => r.day_positions)).toEqual([{ 2: 0.5 }, undefined])
})
- it('FE-MOB-PLTL-024: surfaces a failed reorder as an error toast', async () => {
+ it('FE-MOB-PLTL-024: surfaces a failed reorder as an error toast and refetches the day', async () => {
const actions = buildTripActions()
actions.reorderAssignments.mockRejectedValue(new Error('offline'))
const planner = makePlanner({ tripActions: actions })
@@ -442,6 +442,9 @@ describe('useMPlanTimeline', () => {
await act(async () => { result.current.moveRow(result.current.merged[0], 'down') })
await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('offline'))
expect(planner.updateRouteForDay).not.toHaveBeenCalled()
+ // The optimistic positions are dropped by refetching, not undone one by one.
+ expect(actions.refreshDays).toHaveBeenCalledWith(1)
+ expect(actions.loadReservations).toHaveBeenCalledWith(1)
})
it('FE-MOB-PLTL-025: falls back to the generic message for a non-Error failure', async () => {
diff --git a/client/tests/unit/mobile/vacay/MVacaySettingsSheet.test.tsx b/client/tests/unit/mobile/vacay/MVacaySettingsSheet.test.tsx
index 8ae795bd6..89fb8622b 100644
--- a/client/tests/unit/mobile/vacay/MVacaySettingsSheet.test.tsx
+++ b/client/tests/unit/mobile/vacay/MVacaySettingsSheet.test.tsx
@@ -454,6 +454,30 @@ describe('MVacaySettingsSheet', () => {
expect(deleteHolidayCalendar).toHaveBeenCalledWith(6);
});
+ it('FE-MOB-MVACSET-024d: a group calendar keeps its country and its region picker', async () => {
+ const updateHolidayCalendar = vi.fn(async (_id: number, _data: Record<string, unknown>) => {});
+ seedPlan(
+ buildPlan({
+ school_holidays_enabled: true,
+ holiday_calendars: [
+ { id: 7, plan_id: 1, region: 'NL|group:NL-NO', label: 'Noord', color: '#bbf7d0', sort_order: 0, type: 'school_holiday' },
+ ],
+ }),
+ { updateHolidayCalendar },
+ );
+ renderSheet();
+ await waitForCountries();
+
+ // The `|group:` suffix must not leak into the country, or the lookup comes back empty.
+ const country = screen.getByRole('combobox', { name: 'Select country' });
+ expect(country).toHaveValue('NL');
+ const region = await screen.findByRole('combobox', { name: 'Select region (optional)' });
+ expect(region).toHaveValue('NL|group:NL-NO');
+
+ fireEvent.change(region, { target: { value: 'NL|group:NL-ZU' } });
+ expect(updateHolidayCalendar).toHaveBeenCalledWith(7, { region: 'NL|group:NL-ZU' });
+ });
+
it('FE-MOB-MVACSET-024c: the school draft can be cancelled again', () => {
seedPlan(buildPlan({ school_holidays_enabled: true }));
renderSheet();
diff --git a/client/tests/unit/remoteEventHandler/assignments.test.ts b/client/tests/unit/remoteEventHandler/assignments.test.ts
index 7f6bd8f8f..09782180b 100644
--- a/client/tests/unit/remoteEventHandler/assignments.test.ts
+++ b/client/tests/unit/remoteEventHandler/assignments.test.ts
@@ -266,12 +266,13 @@ describe('remoteEventHandler > assignments', () => {
expect(useTripStore.getState().assignments['10'].map(a => a.id)).toEqual([2, 1]);
});
- it('FE-WSEVT-ASSIGN-016: assignment:reordered without orderedIds empties the day list', () => {
+ it('FE-WSEVT-ASSIGN-016: assignment:reordered without orderedIds leaves the day list alone', () => {
+ const existing = buildAssignment({ id: 1, day_id: 10 });
useTripStore.setState({
days: [buildDay({ id: 10 })],
- assignments: { '10': [buildAssignment({ id: 1, day_id: 10 })] },
+ assignments: { '10': [existing] },
});
useTripStore.getState().handleRemoteEvent({ type: 'assignment:reordered', dayId: 10 });
- expect(useTripStore.getState().assignments['10']).toEqual([]);
+ expect(useTripStore.getState().assignments['10']).toEqual([existing]);
});
});
diff --git a/client/tests/unit/remoteEventHandler/budget.test.ts b/client/tests/unit/remoteEventHandler/budget.test.ts
index 7b95a37c2..d1aa1ebbf 100644
--- a/client/tests/unit/remoteEventHandler/budget.test.ts
+++ b/client/tests/unit/remoteEventHandler/budget.test.ts
@@ -146,8 +146,9 @@ describe('remoteEventHandler > budget', () => {
useTripStore.getState().handleRemoteEvent({ type: 'budget:reordered', orderedIds: [3, 1] });
const { budgetItems } = useTripStore.getState();
expect(budgetItems.map(i => i.id)).toEqual([3, 1, 2]);
- // Only the listed ids get a fresh sort_order; the unlisted item keeps its own.
- expect(budgetItems.map(i => i.sort_order)).toEqual([0, 1, 1]);
+ // The whole array is reindexed, so re-sorting by sort_order reproduces the
+ // order that was just applied.
+ expect(budgetItems.map(i => i.sort_order)).toEqual([0, 1, 2]);
});
it('FE-WSEVT-BUDGET-011: an orderedIds entry for an unknown item is dropped', () => {
diff --git a/server/src/nest/plugins/registry/registry.service.ts b/server/src/nest/plugins/registry/registry.service.ts
index 225d76c87..0592f7dc5 100644
--- a/server/src/nest/plugins/registry/registry.service.ts
+++ b/server/src/nest/plugins/registry/registry.service.ts
@@ -118,6 +118,11 @@ export interface ManifestPreview {
icon: string | null;
requiredAddons: string[];
pluginDependencies: PluginDependency[];
+ /**
+ * The UI-facing slice of `capabilities`. A plugin that replaces planner tabs hides core
+ * UI, so the reviewer has to see it BEFORE installing, not only on the installed row.
+ */
+ capabilities: { widget?: { slot?: string }; tripPage?: { replaces?: string[] } };
}
let _cache: { data: Registry; expiresAt: number } | null = null;
@@ -749,6 +754,20 @@ function previewManifest(raw: unknown): ManifestPreview {
}))
.filter((d) => d.id && d.version)
: [];
+ const rawCaps = (m.capabilities && typeof m.capabilities === 'object' ? m.capabilities : {}) as Record<
+ string,
+ unknown
+ >;
+ const widget = (rawCaps.widget && typeof rawCaps.widget === 'object' ? rawCaps.widget : null) as {
+ slot?: unknown;
+ } | null;
+ const tripPage = (rawCaps.tripPage && typeof rawCaps.tripPage === 'object' ? rawCaps.tripPage : null) as {
+ replaces?: unknown;
+ } | null;
+ const capabilities: ManifestPreview['capabilities'] = {};
+ if (widget) capabilities.widget = typeof widget.slot === 'string' ? { slot: widget.slot } : {};
+ if (tripPage) capabilities.tripPage = { replaces: strings(tripPage.replaces) };
+
return {
permissions: strings(m.permissions),
egress: strings(m.egress),
@@ -758,6 +777,7 @@ function previewManifest(raw: unknown): ManifestPreview {
icon: typeof m.icon === 'string' ? m.icon : null,
requiredAddons: strings(m.requiredAddons),
pluginDependencies,
+ capabilities,
};
}
diff --git a/server/tests/integration/plugins/registry.test.ts b/server/tests/integration/plugins/registry.test.ts
index 000ad3756..8215ef00f 100644
--- a/server/tests/integration/plugins/registry.test.ts
+++ b/server/tests/integration/plugins/registry.test.ts
@@ -33,6 +33,7 @@ import { db as dbConn } from '../../../src/db/database';
import { DatabaseService } from '../../../src/nest/database/database.service';
import { PluginRegistryService, RegistryError, __clearRegistryCacheForTests } from '../../../src/nest/plugins/registry/registry.service';
+import type { ManifestPreview } from '../../../src/nest/plugins/registry/registry.service';
// ── tiny tar.gz builder (wraps the plugin in a codeload-style top dir) ────────
function tarHeader(name: string, size: number, typeflag = '0'): Buffer {
@@ -181,6 +182,27 @@ describe('PluginRegistryService', () => {
});
});
+ it('detail carries the UI-facing capabilities, so the review sheet can chip a tab takeover', async () => {
+ safeDownload.mockResolvedValue({
+ bytes: Buffer.from(JSON.stringify({
+ id: 'flight-tracker', permissions: [], egress: [],
+ capabilities: { widget: { slot: 'hero' }, tripPage: { replaces: ['places'], position: 3 }, settingsUi: true },
+ })),
+ sha256: 'unused',
+ });
+ const d = (await svc.detail('flight-tracker')) as { manifest: ManifestPreview };
+ expect(d.manifest.capabilities).toEqual({ widget: { slot: 'hero' }, tripPage: { replaces: ['places'] } });
+ });
+
+ it('detail leaves capabilities empty when the manifest declares none', async () => {
+ safeDownload.mockResolvedValue({
+ bytes: Buffer.from(JSON.stringify({ id: 'flight-tracker', permissions: [], capabilities: { widget: {} } })),
+ sha256: 'unused',
+ });
+ const d = (await svc.detail('flight-tracker')) as { manifest: ManifestPreview };
+ expect(d.manifest.capabilities).toEqual({ widget: {} });
+ });
+
it('detail soft-fails the manifest fetch (registry metadata still renders)', async () => {
safeDownload.mockRejectedValue(new Error('offline'));
const d = await svc.detail('flight-tracker');
diff --git a/shared/src/i18n/ar/admin.ts b/shared/src/i18n/ar/admin.ts
index 3e6aed420..08dac899d 100644
--- a/shared/src/i18n/ar/admin.ts
+++ b/shared/src/i18n/ar/admin.ts
@@ -177,6 +177,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'فشل تحميل القوالب',
'admin.packingTemplates.createError': 'فشل إنشاء القالب',
'admin.packingTemplates.deleteError': 'فشل حذف القالب',
+ 'admin.packingTemplates.deleteCategoryError': 'فشل حذف الفئة',
+ 'admin.packingTemplates.deleteItemError': 'فشل حذف العنصر',
'admin.packingTemplates.saveError': 'فشل الحفظ',
'admin.tabs.addons': 'الإضافات',
'admin.tabs.plugins': 'الإضافات الخارجية',
diff --git a/shared/src/i18n/ar/collab.ts b/shared/src/i18n/ar/collab.ts
index 3fcecac81..17f2d39c0 100644
--- a/shared/src/i18n/ar/collab.ts
+++ b/shared/src/i18n/ar/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'ابدأ بتسجيل الأفكار والخطط',
'collab.notes.all': 'الكل',
'collab.notes.titlePlaceholder': 'عنوان الملاحظة',
+ 'collab.notes.content': 'المحتوى',
+ 'collab.notes.removeFile': 'إزالة {name}',
'collab.notes.contentPlaceholder': 'اكتب شيئًا...',
'collab.notes.categoryPlaceholder': 'الفئة',
'collab.notes.newCategory': 'فئة جديدة...',
diff --git a/shared/src/i18n/ar/collection.ts b/shared/src/i18n/ar/collection.ts
index 926188b42..bb6f1e937 100644
--- a/shared/src/i18n/ar/collection.ts
+++ b/shared/src/i18n/ar/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'نسخ إلى رحلة',
'collections.copyN': 'نسخ {count} إلى رحلة',
'collections.copyToTripSearch': 'البحث عن الرحلات',
+ 'collections.searchLists': 'بحث في القوائم',
'collections.copyToTripConfirm': 'نسخ',
'collections.noTrips': 'لا توجد رحلات بعد',
'collections.alreadyInTrip': 'موجود بالفعل في هذه الرحلة',
diff --git a/shared/src/i18n/ar/common.ts b/shared/src/i18n/ar/common.ts
index db4f711f5..59435ea99 100644
--- a/shared/src/i18n/ar/common.ts
+++ b/shared/src/i18n/ar/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'تحديد الكل',
'common.deselectAll': 'إلغاء تحديد الكل',
'common.error': 'خطأ',
+ 'common.success': 'تم بنجاح',
'common.unknownError': 'خطأ غير معروف',
'common.tooManyAttempts': 'محاولات كثيرة جدًا. يرجى المحاولة لاحقًا.',
'common.back': 'رجوع',
diff --git a/shared/src/i18n/ar/places.ts b/shared/src/i18n/ar/places.ts
index 1839c771f..12769143c 100644
--- a/shared/src/i18n/ar/places.ts
+++ b/shared/src/i18n/ar/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'خط الطول (مثال: 2.3522)',
'places.formCategory': 'الفئة',
'places.noCategory': 'بلا فئة',
+ 'places.newCategory': 'فئة جديدة',
'places.categoryNamePlaceholder': 'اسم الفئة',
'places.formTime': 'الوقت',
'places.startTime': 'البداية',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'تغيير الصورة',
'places.removeImage': 'إزالة الصورة',
'places.imageUploadError': 'تعذّر رفع الصورة',
+ 'places.imageRemoveError': 'تعذّر إزالة الصورة',
};
export default places;
diff --git a/shared/src/i18n/ar/settings.ts b/shared/src/i18n/ar/settings.ts
index 2eaf93e4d..14a782a47 100644
--- a/shared/src/i18n/ar/settings.ts
+++ b/shared/src/i18n/ar/settings.ts
@@ -239,6 +239,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'تم تحديث صورة الملف الشخصي',
'settings.avatarRemoved': 'تمت إزالة صورة الملف الشخصي',
'settings.avatarError': 'فشل الرفع',
+ 'settings.avatarRemoveError': 'فشل الحذف',
'settings.mfa.title': 'المصادقة الثنائية (2FA)',
'settings.mfa.description':
'تضيف خطوة ثانية عند تسجيل الدخول. استخدم تطبيق مصادقة (Google Authenticator، Authy، إلخ).',
diff --git a/shared/src/i18n/ar/undo.ts b/shared/src/i18n/ar/undo.ts
index f3cefcac2..fe5e099c4 100644
--- a/shared/src/i18n/ar/undo.ts
+++ b/shared/src/i18n/ar/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'تم تبديل قفل المكان',
'undo.importGpx': 'استيراد GPX',
'undo.importKeyholeMarkup': 'استيراد KMZ/KML',
+ 'undo.importFiles': 'استيراد ملفات',
'undo.importGoogleList': 'استيراد خرائط Google',
'undo.importNaverList': 'استيراد خرائط Naver',
'undo.addPlace': 'تمت إضافة المكان',
diff --git a/shared/src/i18n/br/admin.ts b/shared/src/i18n/br/admin.ts
index eec822546..115b09307 100644
--- a/shared/src/i18n/br/admin.ts
+++ b/shared/src/i18n/br/admin.ts
@@ -156,6 +156,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Falha ao carregar modelos',
'admin.packingTemplates.createError': 'Falha ao criar modelo',
'admin.packingTemplates.deleteError': 'Falha ao excluir modelo',
+ 'admin.packingTemplates.deleteCategoryError': 'Falha ao excluir a categoria',
+ 'admin.packingTemplates.deleteItemError': 'Falha ao excluir o item',
'admin.packingTemplates.saveError': 'Falha ao salvar',
'admin.tabs.addons': 'Complementos',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/br/collab.ts b/shared/src/i18n/br/collab.ts
index cb6f0ab68..f882dfaa0 100644
--- a/shared/src/i18n/br/collab.ts
+++ b/shared/src/i18n/br/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Comece a registrar ideias e planos',
'collab.notes.all': 'Todas',
'collab.notes.titlePlaceholder': 'Título da nota',
+ 'collab.notes.content': 'Conteúdo',
+ 'collab.notes.removeFile': 'Remover {name}',
'collab.notes.contentPlaceholder': 'Escreva algo...',
'collab.notes.categoryPlaceholder': 'Categoria',
'collab.notes.newCategory': 'Nova categoria...',
diff --git a/shared/src/i18n/br/collection.ts b/shared/src/i18n/br/collection.ts
index 39cfc2f52..0e7515c73 100644
--- a/shared/src/i18n/br/collection.ts
+++ b/shared/src/i18n/br/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Copiar para viagem',
'collections.copyN': 'Copiar {count} para viagem',
'collections.copyToTripSearch': 'Buscar viagens',
+ 'collections.searchLists': 'Buscar listas',
'collections.copyToTripConfirm': 'Copiar',
'collections.noTrips': 'Nenhuma viagem ainda',
'collections.alreadyInTrip': 'Já está nesta viagem',
diff --git a/shared/src/i18n/br/common.ts b/shared/src/i18n/br/common.ts
index 494c915e4..6a75d6205 100644
--- a/shared/src/i18n/br/common.ts
+++ b/shared/src/i18n/br/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Selecionar tudo',
'common.deselectAll': 'Desmarcar tudo',
'common.error': 'Erro',
+ 'common.success': 'Sucesso',
'common.unknownError': 'Erro desconhecido',
'common.tooManyAttempts': 'Muitas tentativas. Tente novamente mais tarde.',
'common.back': 'Voltar',
diff --git a/shared/src/i18n/br/places.ts b/shared/src/i18n/br/places.ts
index be7407515..a358c74c8 100644
--- a/shared/src/i18n/br/places.ts
+++ b/shared/src/i18n/br/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Longitude (ex.: -46.6333)',
'places.formCategory': 'Categoria',
'places.noCategory': 'Sem categoria',
+ 'places.newCategory': 'Nova categoria',
'places.categoryNamePlaceholder': 'Nome da categoria',
'places.formTime': 'Horário',
'places.startTime': 'Início',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Alterar imagem',
'places.removeImage': 'Remover imagem',
'places.imageUploadError': 'Não foi possível enviar a imagem',
+ 'places.imageRemoveError': 'Não foi possível remover a imagem',
};
export default places;
diff --git a/shared/src/i18n/br/settings.ts b/shared/src/i18n/br/settings.ts
index 3ab49d78a..b28448d3f 100644
--- a/shared/src/i18n/br/settings.ts
+++ b/shared/src/i18n/br/settings.ts
@@ -148,6 +148,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Foto do perfil atualizada',
'settings.avatarRemoved': 'Foto do perfil removida',
'settings.avatarError': 'Falha no envio',
+ 'settings.avatarRemoveError': 'Falha ao remover',
'settings.mfa.title': 'Autenticação em duas etapas (2FA)',
'settings.mfa.description':
'Adiciona uma segunda etapa ao entrar com e-mail e senha. Use um app autenticador (Google Authenticator, Authy, etc.).',
diff --git a/shared/src/i18n/br/undo.ts b/shared/src/i18n/br/undo.ts
index b6fd2d796..c086d52a2 100644
--- a/shared/src/i18n/br/undo.ts
+++ b/shared/src/i18n/br/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Bloqueio do local alternado',
'undo.importGpx': 'Importação de GPX',
'undo.importKeyholeMarkup': 'Importação de KMZ/KML',
+ 'undo.importFiles': 'Importação de arquivos',
'undo.importGoogleList': 'Importação do Google Maps',
'undo.importNaverList': 'Importação do Naver Maps',
'undo.addPlace': 'Local adicionado',
diff --git a/shared/src/i18n/ca/admin.ts b/shared/src/i18n/ca/admin.ts
index 9e7d2505f..0c046c52a 100644
--- a/shared/src/i18n/ca/admin.ts
+++ b/shared/src/i18n/ca/admin.ts
@@ -160,6 +160,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Error en carregar les plantilles',
'admin.packingTemplates.createError': 'Error en crear la plantilla',
'admin.packingTemplates.deleteError': 'Error en eliminar la plantilla',
+ 'admin.packingTemplates.deleteCategoryError': 'No es pot eliminar la categoria',
+ 'admin.packingTemplates.deleteItemError': 'No es pot eliminar aquest element',
'admin.packingTemplates.saveError': 'Error en desar',
'admin.tabs.addons': 'Complements',
'admin.addons.title': 'Complements',
diff --git a/shared/src/i18n/ca/collab.ts b/shared/src/i18n/ca/collab.ts
index 84622eedf..9837842bf 100644
--- a/shared/src/i18n/ca/collab.ts
+++ b/shared/src/i18n/ca/collab.ts
@@ -29,6 +29,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Comença a capturar idees i plans',
'collab.notes.all': 'Totes',
'collab.notes.titlePlaceholder': 'Títol de la nota',
+ 'collab.notes.content': 'Contingut',
+ 'collab.notes.removeFile': 'Elimina {name}',
'collab.notes.contentPlaceholder': 'Escriu alguna cosa...',
'collab.notes.categoryPlaceholder': 'Categoria',
'collab.notes.newCategory': 'Categoria nova...',
diff --git a/shared/src/i18n/ca/collection.ts b/shared/src/i18n/ca/collection.ts
index a65521424..0c9c240a4 100644
--- a/shared/src/i18n/ca/collection.ts
+++ b/shared/src/i18n/ca/collection.ts
@@ -76,6 +76,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Copiar al viatge',
'collections.copyN': 'Copia {count} al viatge',
'collections.copyToTripSearch': 'Cercar viatges',
+ 'collections.searchLists': 'Cerca llistes',
'collections.copyToTripConfirm': 'Copiar',
'collections.noTrips': 'Encara no hi ha viatges',
'collections.alreadyInTrip': 'Ja es troba en aquest viatge',
diff --git a/shared/src/i18n/ca/common.ts b/shared/src/i18n/ca/common.ts
index d82228f17..34bf4e579 100644
--- a/shared/src/i18n/ca/common.ts
+++ b/shared/src/i18n/ca/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Seleccionar-ho tot',
'common.deselectAll': 'Rebutjar la sel·lecció',
'common.error': 'Error',
+ 'common.success': 'Èxit',
'common.unknownError': 'Error desconegut',
'common.tooManyAttempts': 'Massa intents. Torna a provar-ho més tard.',
'common.back': 'Enrere',
diff --git a/shared/src/i18n/ca/places.ts b/shared/src/i18n/ca/places.ts
index a246a5806..a0b562025 100644
--- a/shared/src/i18n/ca/places.ts
+++ b/shared/src/i18n/ca/places.ts
@@ -65,6 +65,7 @@ const places: TranslationStrings = {
'places.formLng': 'Longitud (p. ex. 2.3522)',
'places.formCategory': 'Categoria',
'places.noCategory': 'Sense categoria',
+ 'places.newCategory': 'Categoria nova',
'places.categoryNamePlaceholder': 'Nom de la categoria',
'places.formTime': 'Hora',
'places.startTime': 'Inici',
@@ -98,5 +99,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Canvia la imatge',
'places.removeImage': 'Elimina la imatge',
'places.imageUploadError': "No s'ha pogut pujar la imatge",
+ 'places.imageRemoveError': "No s'ha pogut eliminar la imatge",
};
export default places;
diff --git a/shared/src/i18n/ca/settings.ts b/shared/src/i18n/ca/settings.ts
index b57254c21..a543c7ca4 100644
--- a/shared/src/i18n/ca/settings.ts
+++ b/shared/src/i18n/ca/settings.ts
@@ -243,6 +243,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Foto de perfil actualitzada',
'settings.avatarRemoved': 'Foto de perfil eliminada',
'settings.avatarError': 'La pujada ha fallat',
+ 'settings.avatarRemoveError': "L'eliminació ha fallat",
'settings.bookingLabels': 'Etiquetes de rutes de reserves',
'settings.bookingLabelsHint': "Mostra noms d'estacions / aeroports al mapa. Desactivat, només es mostra la icona.",
'settings.currentPasswordRequired': 'La contrasenya actual és obligatòria',
diff --git a/shared/src/i18n/ca/undo.ts b/shared/src/i18n/ca/undo.ts
index 5fc5b50f9..4fda550da 100644
--- a/shared/src/i18n/ca/undo.ts
+++ b/shared/src/i18n/ca/undo.ts
@@ -13,6 +13,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Bloqueig de lloc activat/desactivat',
'undo.importGpx': 'Importació GPX',
'undo.importKeyholeMarkup': 'Importació KMZ/KML',
+ 'undo.importFiles': 'Importació de fitxers',
'undo.importGoogleList': 'Importació de Google Maps',
'undo.importNaverList': 'Importació de Naver Maps',
'undo.addPlace': 'Lloc afegit',
diff --git a/shared/src/i18n/cs/admin.ts b/shared/src/i18n/cs/admin.ts
index a71e9f905..80b1c51a4 100644
--- a/shared/src/i18n/cs/admin.ts
+++ b/shared/src/i18n/cs/admin.ts
@@ -157,6 +157,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Nepodařilo se načíst šablony',
'admin.packingTemplates.createError': 'Nepodařilo se vytvořit šablonu',
'admin.packingTemplates.deleteError': 'Nepodařilo se smazat šablonu',
+ 'admin.packingTemplates.deleteCategoryError': 'Nepodařilo se smazat kategorii',
+ 'admin.packingTemplates.deleteItemError': 'Nepodařilo se smazat položku',
'admin.packingTemplates.saveError': 'Uložení se nezdařilo',
'admin.tabs.addons': 'Doplňky',
'admin.tabs.plugins': 'Pluginy',
diff --git a/shared/src/i18n/cs/collab.ts b/shared/src/i18n/cs/collab.ts
index 47f942e1f..9ebc647e2 100644
--- a/shared/src/i18n/cs/collab.ts
+++ b/shared/src/i18n/cs/collab.ts
@@ -55,6 +55,8 @@ const collab: TranslationStrings = {
'collab.notes.attachFiles': 'Přiložit soubory',
'collab.notes.noCategoriesYet': 'Zatím žádné kategorie',
'collab.notes.emptyDesc': 'Vytvořte poznámku a začněte',
+ 'collab.notes.content': 'Obsah',
+ 'collab.notes.removeFile': 'Odebrat {name}',
'collab.notes.contentPlaceholder': 'Napište něco...',
'collab.notes.categoryPlaceholder': 'Kategorie',
'collab.notes.newCategory': 'Nová kategorie...',
diff --git a/shared/src/i18n/cs/collection.ts b/shared/src/i18n/cs/collection.ts
index 36a09d1c4..31447566b 100644
--- a/shared/src/i18n/cs/collection.ts
+++ b/shared/src/i18n/cs/collection.ts
@@ -80,6 +80,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Kopírovat do výletu',
'collections.copyN': 'Kopírovat {count} do výletu',
'collections.copyToTripSearch': 'Hledat výlety',
+ 'collections.searchLists': 'Hledat seznamy',
'collections.copyToTripConfirm': 'Kopírovat',
'collections.noTrips': 'Zatím žádné výlety',
'collections.alreadyInTrip': 'Již v tomto výletu',
diff --git a/shared/src/i18n/cs/common.ts b/shared/src/i18n/cs/common.ts
index 87bb1c387..e90aa2317 100644
--- a/shared/src/i18n/cs/common.ts
+++ b/shared/src/i18n/cs/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Vybrat vše',
'common.deselectAll': 'Zrušit výběr všeho',
'common.error': 'Chyba',
+ 'common.success': 'Úspěch',
'common.unknownError': 'Neznámá chyba',
'common.tooManyAttempts': 'Příliš mnoho pokusů. Zkuste to prosím znovu.',
'common.back': 'Zpět',
diff --git a/shared/src/i18n/cs/places.ts b/shared/src/i18n/cs/places.ts
index a215dea55..0c2da4527 100644
--- a/shared/src/i18n/cs/places.ts
+++ b/shared/src/i18n/cs/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Zeměpisná délka',
'places.formCategory': 'Kategorie',
'places.noCategory': 'Bez kategorie',
+ 'places.newCategory': 'Nová kategorie',
'places.categoryNamePlaceholder': 'Název kategorie',
'places.formTime': 'Čas',
'places.startTime': 'Od',
@@ -96,5 +97,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Změnit obrázek',
'places.removeImage': 'Odebrat obrázek',
'places.imageUploadError': 'Obrázek se nepodařilo nahrát',
+ 'places.imageRemoveError': 'Obrázek se nepodařilo odebrat',
};
export default places;
diff --git a/shared/src/i18n/cs/settings.ts b/shared/src/i18n/cs/settings.ts
index e03077b90..702073aa9 100644
--- a/shared/src/i18n/cs/settings.ts
+++ b/shared/src/i18n/cs/settings.ts
@@ -231,6 +231,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Profilový obrázek byl aktualizován',
'settings.avatarRemoved': 'Profilový obrázek byl odstraněn',
'settings.avatarError': 'Nahrávání se nezdařilo',
+ 'settings.avatarRemoveError': 'Odstranění se nezdařilo',
'settings.mfa.title': 'Dvoufaktorové ověření (2FA)',
'settings.mfa.description':
'Přidá druhý stupeň zabezpečení při přihlašování e-mailem a heslem. Použijte aplikaci (Google Authenticator, Authy apod.).',
diff --git a/shared/src/i18n/cs/undo.ts b/shared/src/i18n/cs/undo.ts
index 50cf5deed..59191b3c7 100644
--- a/shared/src/i18n/cs/undo.ts
+++ b/shared/src/i18n/cs/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Zámek místa přepnut',
'undo.importGpx': 'Import GPX',
'undo.importKeyholeMarkup': 'Import KMZ/KML',
+ 'undo.importFiles': 'Import souborů',
'undo.importGoogleList': 'Import z Google Maps',
'undo.importNaverList': 'Import z Naver Maps',
'undo.addPlace': 'Místo přidáno',
diff --git a/shared/src/i18n/de/admin.ts b/shared/src/i18n/de/admin.ts
index 2cecc0ef0..a2d316d3e 100644
--- a/shared/src/i18n/de/admin.ts
+++ b/shared/src/i18n/de/admin.ts
@@ -159,6 +159,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Vorlagen konnten nicht geladen werden',
'admin.packingTemplates.createError': 'Vorlage konnte nicht erstellt werden',
'admin.packingTemplates.deleteError': 'Vorlage konnte nicht gelöscht werden',
+ 'admin.packingTemplates.deleteCategoryError': 'Kategorie konnte nicht gelöscht werden',
+ 'admin.packingTemplates.deleteItemError': 'Eintrag konnte nicht gelöscht werden',
'admin.packingTemplates.saveError': 'Fehler beim Speichern',
'admin.tabs.addons': 'Addons',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/de/collab.ts b/shared/src/i18n/de/collab.ts
index 65fd88022..f5d2e643b 100644
--- a/shared/src/i18n/de/collab.ts
+++ b/shared/src/i18n/de/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Halte Ideen und Pläne fest',
'collab.notes.all': 'Alle',
'collab.notes.titlePlaceholder': 'Notiztitel',
+ 'collab.notes.content': 'Inhalt',
+ 'collab.notes.removeFile': '{name} entfernen',
'collab.notes.contentPlaceholder': 'Schreibe etwas...',
'collab.notes.categoryPlaceholder': 'Kategorie',
'collab.notes.newCategory': 'Neue Kategorie...',
diff --git a/shared/src/i18n/de/collection.ts b/shared/src/i18n/de/collection.ts
index 637381a3b..4ef41925b 100644
--- a/shared/src/i18n/de/collection.ts
+++ b/shared/src/i18n/de/collection.ts
@@ -82,6 +82,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'In Reise kopieren',
'collections.copyN': '{count} in Reise kopieren',
'collections.copyToTripSearch': 'Reisen suchen',
+ 'collections.searchLists': 'Listen suchen',
'collections.copyToTripConfirm': 'Kopieren',
'collections.noTrips': 'Noch keine Reisen',
'collections.alreadyInTrip': 'Bereits in dieser Reise',
diff --git a/shared/src/i18n/de/common.ts b/shared/src/i18n/de/common.ts
index 4b2495857..635d913dd 100644
--- a/shared/src/i18n/de/common.ts
+++ b/shared/src/i18n/de/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Alle auswählen',
'common.deselectAll': 'Alle abwählen',
'common.error': 'Fehler',
+ 'common.success': 'Erfolg',
'common.unknownError': 'Unbekannter Fehler',
'common.tooManyAttempts': 'Zu viele Versuche. Bitte versuchen Sie es später erneut.',
'common.back': 'Zurück',
diff --git a/shared/src/i18n/de/places.ts b/shared/src/i18n/de/places.ts
index f0fb73ba6..45a669029 100644
--- a/shared/src/i18n/de/places.ts
+++ b/shared/src/i18n/de/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Längengrad (z.B. 2.3522)',
'places.formCategory': 'Kategorie',
'places.noCategory': 'Keine Kategorie',
+ 'places.newCategory': 'Neue Kategorie',
'places.categoryNamePlaceholder': 'Kategoriename',
'places.formTime': 'Uhrzeit',
'places.startTime': 'Startzeit',
@@ -93,6 +94,7 @@ const places: TranslationStrings = {
'places.changeImage': 'Bild ändern',
'places.removeImage': 'Bild entfernen',
'places.imageUploadError': 'Bild konnte nicht hochgeladen werden',
+ 'places.imageRemoveError': 'Bild konnte nicht entfernt werden',
'places.addAnyway': 'Trotzdem hinzufügen',
'places.enrichOnImport': 'Orte über Google anreichern',
'places.enrichOnImportHint':
diff --git a/shared/src/i18n/de/settings.ts b/shared/src/i18n/de/settings.ts
index 08d82240f..044eefc03 100644
--- a/shared/src/i18n/de/settings.ts
+++ b/shared/src/i18n/de/settings.ts
@@ -237,6 +237,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Profilbild aktualisiert',
'settings.avatarRemoved': 'Profilbild entfernt',
'settings.avatarError': 'Fehler beim Hochladen',
+ 'settings.avatarRemoveError': 'Entfernen fehlgeschlagen',
'settings.mfa.title': 'Zwei-Faktor-Authentifizierung (2FA)',
'settings.mfa.description':
'Zusätzlicher Schritt bei der Anmeldung mit E-Mail und Passwort. Nutze eine Authenticator-App (Google Authenticator, Authy, …).',
diff --git a/shared/src/i18n/de/undo.ts b/shared/src/i18n/de/undo.ts
index f78b2967e..e1e9f8716 100644
--- a/shared/src/i18n/de/undo.ts
+++ b/shared/src/i18n/de/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Ortssperre umgeschaltet',
'undo.importGpx': 'GPX-Import',
'undo.importKeyholeMarkup': 'KMZ/KML-Import',
+ 'undo.importFiles': 'Datei-Import',
'undo.importGoogleList': 'Google Maps-Import',
'undo.importNaverList': 'Naver Maps-Import',
'undo.addPlace': 'Ort hinzugefügt',
diff --git a/shared/src/i18n/en/admin.ts b/shared/src/i18n/en/admin.ts
index 3fcaa67aa..e107cb8bd 100644
--- a/shared/src/i18n/en/admin.ts
+++ b/shared/src/i18n/en/admin.ts
@@ -211,6 +211,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Failed to load templates',
'admin.packingTemplates.createError': 'Failed to create template',
'admin.packingTemplates.deleteError': 'Failed to delete template',
+ 'admin.packingTemplates.deleteCategoryError': 'Failed to delete category',
+ 'admin.packingTemplates.deleteItemError': 'Failed to delete item',
'admin.packingTemplates.saveError': 'Failed to save',
'admin.tabs.addons': 'Addons',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/en/collab.ts b/shared/src/i18n/en/collab.ts
index 930131bed..c5192493e 100644
--- a/shared/src/i18n/en/collab.ts
+++ b/shared/src/i18n/en/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Start capturing ideas and plans',
'collab.notes.all': 'All',
'collab.notes.titlePlaceholder': 'Note title',
+ 'collab.notes.content': 'Content',
+ 'collab.notes.removeFile': 'Remove {name}',
'collab.notes.contentPlaceholder': 'Write something...',
'collab.notes.categoryPlaceholder': 'Category',
'collab.notes.newCategory': 'New category...',
diff --git a/shared/src/i18n/en/collection.ts b/shared/src/i18n/en/collection.ts
index 336c6d042..0c01078f2 100644
--- a/shared/src/i18n/en/collection.ts
+++ b/shared/src/i18n/en/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Copy to trip',
'collections.copyN': 'Copy {count} to trip',
'collections.copyToTripSearch': 'Search trips',
+ 'collections.searchLists': 'Search lists',
'collections.copyToTripConfirm': 'Copy',
'collections.noTrips': 'No trips yet',
'collections.alreadyInTrip': 'Already in this trip',
diff --git a/shared/src/i18n/en/common.ts b/shared/src/i18n/en/common.ts
index 0fbc50077..aada638ef 100644
--- a/shared/src/i18n/en/common.ts
+++ b/shared/src/i18n/en/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Select all',
'common.deselectAll': 'Deselect all',
'common.error': 'Error',
+ 'common.success': 'Success',
'common.unknownError': 'Unknown error',
'common.tooManyAttempts': 'Too many attempts. Please try again later.',
'common.back': 'Back',
diff --git a/shared/src/i18n/en/places.ts b/shared/src/i18n/en/places.ts
index db432c9f5..b9824a2bb 100644
--- a/shared/src/i18n/en/places.ts
+++ b/shared/src/i18n/en/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Longitude (e.g. 2.3522)',
'places.formCategory': 'Category',
'places.noCategory': 'No Category',
+ 'places.newCategory': 'New category',
'places.categoryNamePlaceholder': 'Category name',
'places.formTime': 'Time',
'places.startTime': 'Start',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Change image',
'places.removeImage': 'Remove image',
'places.imageUploadError': 'Could not upload image',
+ 'places.imageRemoveError': 'Could not remove image',
};
export default places;
diff --git a/shared/src/i18n/en/settings.ts b/shared/src/i18n/en/settings.ts
index 0fb2b0a3e..be1e0dcb6 100644
--- a/shared/src/i18n/en/settings.ts
+++ b/shared/src/i18n/en/settings.ts
@@ -280,6 +280,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Profile picture updated',
'settings.avatarRemoved': 'Profile picture removed',
'settings.avatarError': 'Upload failed',
+ 'settings.avatarRemoveError': 'Removal failed',
'settings.mfa.title': 'Two-factor authentication (2FA)',
'settings.mfa.description':
'Adds a second step when you sign in with email and password. Use an authenticator app (Google Authenticator, Authy, etc.).',
diff --git a/shared/src/i18n/en/undo.ts b/shared/src/i18n/en/undo.ts
index ad3420201..47d569dca 100644
--- a/shared/src/i18n/en/undo.ts
+++ b/shared/src/i18n/en/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Place lock toggled',
'undo.importGpx': 'GPX import',
'undo.importKeyholeMarkup': 'KMZ/KML import',
+ 'undo.importFiles': 'File import',
'undo.importGoogleList': 'Google Maps import',
'undo.importNaverList': 'Naver Maps import',
'undo.importBooking': 'Booking confirmation import',
diff --git a/shared/src/i18n/es/admin.ts b/shared/src/i18n/es/admin.ts
index eac11f0c0..ec89cf708 100644
--- a/shared/src/i18n/es/admin.ts
+++ b/shared/src/i18n/es/admin.ts
@@ -158,6 +158,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Error al cargar plantillas',
'admin.packingTemplates.createError': 'Error al crear plantilla',
'admin.packingTemplates.deleteError': 'Error al eliminar plantilla',
+ 'admin.packingTemplates.deleteCategoryError': 'No se pudo eliminar la categoría',
+ 'admin.packingTemplates.deleteItemError': 'No se pudo eliminar el elemento',
'admin.packingTemplates.saveError': 'Error al guardar',
'admin.tabs.addons': 'Complementos',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/es/collab.ts b/shared/src/i18n/es/collab.ts
index 18ada6bb5..9c9d10357 100644
--- a/shared/src/i18n/es/collab.ts
+++ b/shared/src/i18n/es/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Empieza a capturar ideas y planes',
'collab.notes.all': 'Todas',
'collab.notes.titlePlaceholder': 'Título de la nota',
+ 'collab.notes.content': 'Contenido',
+ 'collab.notes.removeFile': 'Quitar {name}',
'collab.notes.contentPlaceholder': 'Escribe algo...',
'collab.notes.categoryPlaceholder': 'Categoría',
'collab.notes.newCategory': 'Nueva categoría...',
diff --git a/shared/src/i18n/es/collection.ts b/shared/src/i18n/es/collection.ts
index 9d19820f7..3ad836d65 100644
--- a/shared/src/i18n/es/collection.ts
+++ b/shared/src/i18n/es/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Copiar al viaje',
'collections.copyN': 'Copiar {count} al viaje',
'collections.copyToTripSearch': 'Buscar viajes',
+ 'collections.searchLists': 'Buscar listas',
'collections.copyToTripConfirm': 'Copiar',
'collections.noTrips': 'Aún no hay viajes',
'collections.alreadyInTrip': 'Ya está en este viaje',
diff --git a/shared/src/i18n/es/common.ts b/shared/src/i18n/es/common.ts
index c9054afca..d7ee233ec 100644
--- a/shared/src/i18n/es/common.ts
+++ b/shared/src/i18n/es/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Seleccionar todo',
'common.deselectAll': 'Deseleccionar todo',
'common.error': 'Error',
+ 'common.success': 'Éxito',
'common.unknownError': 'Error desconocido',
'common.tooManyAttempts': 'Demasiados intentos. Inténtelo de nuevo más tarde.',
'common.back': 'Atrás',
diff --git a/shared/src/i18n/es/places.ts b/shared/src/i18n/es/places.ts
index 225673ef5..eab4386e1 100644
--- a/shared/src/i18n/es/places.ts
+++ b/shared/src/i18n/es/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Longitud (p. ej. 2.3522)',
'places.formCategory': 'Categoría',
'places.noCategory': 'Sin categoría',
+ 'places.newCategory': 'Nueva categoría',
'places.categoryNamePlaceholder': 'Nombre de la categoría',
'places.formTime': 'Hora',
'places.startTime': 'Inicio',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Cambiar imagen',
'places.removeImage': 'Eliminar imagen',
'places.imageUploadError': 'No se pudo subir la imagen',
+ 'places.imageRemoveError': 'No se pudo eliminar la imagen',
};
export default places;
diff --git a/shared/src/i18n/es/settings.ts b/shared/src/i18n/es/settings.ts
index 7b0ea00f3..2aa5b1690 100644
--- a/shared/src/i18n/es/settings.ts
+++ b/shared/src/i18n/es/settings.ts
@@ -260,6 +260,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Foto de perfil actualizada',
'settings.avatarRemoved': 'Foto de perfil eliminada',
'settings.avatarError': 'Falló la subida',
+ 'settings.avatarRemoveError': 'Error al eliminar',
'settings.bookingLabels': 'Etiquetas de rutas de reservas',
'settings.bookingLabelsHint':
'Muestra nombres de estaciones / aeropuertos en el mapa. Desactivado, solo se muestra el icono.',
diff --git a/shared/src/i18n/es/undo.ts b/shared/src/i18n/es/undo.ts
index d7e5d3129..b623b5c06 100644
--- a/shared/src/i18n/es/undo.ts
+++ b/shared/src/i18n/es/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Bloqueo de lugar activado/desactivado',
'undo.importGpx': 'Importación GPX',
'undo.importKeyholeMarkup': 'Importación KMZ/KML',
+ 'undo.importFiles': 'Importación de archivos',
'undo.importGoogleList': 'Importación de Google Maps',
'undo.importNaverList': 'Importación de Naver Maps',
'undo.addPlace': 'Lugar agregado',
diff --git a/shared/src/i18n/fr/admin.ts b/shared/src/i18n/fr/admin.ts
index 48bd486e5..50a09fa7d 100644
--- a/shared/src/i18n/fr/admin.ts
+++ b/shared/src/i18n/fr/admin.ts
@@ -160,6 +160,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Erreur de chargement des modèles',
'admin.packingTemplates.createError': 'Erreur de création du modèle',
'admin.packingTemplates.deleteError': 'Erreur de suppression du modèle',
+ 'admin.packingTemplates.deleteCategoryError': 'Échec de la suppression de la catégorie',
+ 'admin.packingTemplates.deleteItemError': 'Échec de la suppression de cet élément',
'admin.packingTemplates.saveError': 'Erreur de sauvegarde',
'admin.tabs.addons': 'Extensions',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/fr/collab.ts b/shared/src/i18n/fr/collab.ts
index ea2950254..20204e215 100644
--- a/shared/src/i18n/fr/collab.ts
+++ b/shared/src/i18n/fr/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Commencez à capturer vos idées et plans',
'collab.notes.all': 'Toutes',
'collab.notes.titlePlaceholder': 'Titre de la note',
+ 'collab.notes.content': 'Contenu',
+ 'collab.notes.removeFile': 'Retirer {name}',
'collab.notes.contentPlaceholder': 'Écrivez quelque chose…',
'collab.notes.categoryPlaceholder': 'Catégorie',
'collab.notes.newCategory': 'Nouvelle catégorie…',
diff --git a/shared/src/i18n/fr/collection.ts b/shared/src/i18n/fr/collection.ts
index fb798f417..5abb58d2e 100644
--- a/shared/src/i18n/fr/collection.ts
+++ b/shared/src/i18n/fr/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Copier vers un voyage',
'collections.copyN': 'Copier {count} vers un voyage',
'collections.copyToTripSearch': 'Rechercher des voyages',
+ 'collections.searchLists': 'Rechercher des listes',
'collections.copyToTripConfirm': 'Copier',
'collections.noTrips': 'Aucun voyage pour le moment',
'collections.alreadyInTrip': 'Déjà dans ce voyage',
diff --git a/shared/src/i18n/fr/common.ts b/shared/src/i18n/fr/common.ts
index dd4cc5160..53a07f391 100644
--- a/shared/src/i18n/fr/common.ts
+++ b/shared/src/i18n/fr/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Tout sélectionner',
'common.deselectAll': 'Tout désélectionner',
'common.error': 'Erreur',
+ 'common.success': 'Succès',
'common.unknownError': 'Erreur inconnue',
'common.tooManyAttempts': 'Trop de tentatives. Veuillez réessayer plus tard.',
'common.back': 'Retour',
diff --git a/shared/src/i18n/fr/places.ts b/shared/src/i18n/fr/places.ts
index 8a4ece4b4..af14a39fa 100644
--- a/shared/src/i18n/fr/places.ts
+++ b/shared/src/i18n/fr/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Longitude (ex. 2.3522)',
'places.formCategory': 'Catégorie',
'places.noCategory': 'Sans catégorie',
+ 'places.newCategory': 'Nouvelle catégorie',
'places.categoryNamePlaceholder': 'Nom de la catégorie',
'places.formTime': 'Heure',
'places.startTime': 'Début',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': "Changer l'image",
'places.removeImage': "Supprimer l'image",
'places.imageUploadError': "Impossible d'importer l'image",
+ 'places.imageRemoveError': "Impossible de supprimer l'image",
};
export default places;
diff --git a/shared/src/i18n/fr/settings.ts b/shared/src/i18n/fr/settings.ts
index a7be9c48a..e393538c5 100644
--- a/shared/src/i18n/fr/settings.ts
+++ b/shared/src/i18n/fr/settings.ts
@@ -265,6 +265,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Photo de profil mise à jour',
'settings.avatarRemoved': 'Photo de profil supprimée',
'settings.avatarError': "Échec de l'import",
+ 'settings.avatarRemoveError': 'Échec de la suppression',
'settings.bookingLabels': 'Étiquettes des itinéraires',
'settings.bookingLabelsHint':
"Affiche les noms des gares / aéroports sur la carte. Si désactivé, seule l'icône est affichée.",
diff --git a/shared/src/i18n/fr/undo.ts b/shared/src/i18n/fr/undo.ts
index b0d2dc57b..b1824314d 100644
--- a/shared/src/i18n/fr/undo.ts
+++ b/shared/src/i18n/fr/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Verrouillage du lieu modifié',
'undo.importGpx': 'Import GPX',
'undo.importKeyholeMarkup': 'Import KMZ/KML',
+ 'undo.importFiles': 'Import de fichiers',
'undo.importGoogleList': 'Import Google Maps',
'undo.importNaverList': 'Import Naver Maps',
'undo.addPlace': 'Lieu ajouté',
diff --git a/shared/src/i18n/gr/admin.ts b/shared/src/i18n/gr/admin.ts
index 78439b4d0..772821f89 100644
--- a/shared/src/i18n/gr/admin.ts
+++ b/shared/src/i18n/gr/admin.ts
@@ -205,6 +205,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Αποτυχία φόρτωσης προτύπων',
'admin.packingTemplates.createError': 'Αποτυχία δημιουργίας προτύπου',
'admin.packingTemplates.deleteError': 'Αποτυχία διαγραφής προτύπου',
+ 'admin.packingTemplates.deleteCategoryError': 'Αποτυχία διαγραφής κατηγορίας',
+ 'admin.packingTemplates.deleteItemError': 'Αποτυχία διαγραφής στοιχείου',
'admin.packingTemplates.saveError': 'Αποτυχία αποθήκευσης',
'admin.tabs.addons': 'Πρόσθετα',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/gr/collab.ts b/shared/src/i18n/gr/collab.ts
index 43f0bac19..561a067b6 100644
--- a/shared/src/i18n/gr/collab.ts
+++ b/shared/src/i18n/gr/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Ξεκινήστε να καταγράφετε ιδέες και σχέδια',
'collab.notes.all': 'Όλες',
'collab.notes.titlePlaceholder': 'Τίτλος σημείωσης',
+ 'collab.notes.content': 'Περιεχόμενο',
+ 'collab.notes.removeFile': 'Αφαίρεση {name}',
'collab.notes.contentPlaceholder': 'Γράψτε κάτι...',
'collab.notes.categoryPlaceholder': 'Κατηγορία',
'collab.notes.newCategory': 'Νέα κατηγορία...',
diff --git a/shared/src/i18n/gr/collection.ts b/shared/src/i18n/gr/collection.ts
index 7cfe467fb..4a452eff5 100644
--- a/shared/src/i18n/gr/collection.ts
+++ b/shared/src/i18n/gr/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Αντιγραφή σε ταξίδι',
'collections.copyN': 'Αντιγραφή {count} σε ταξίδι',
'collections.copyToTripSearch': 'Αναζήτηση ταξιδιών',
+ 'collections.searchLists': 'Αναζήτηση λιστών',
'collections.copyToTripConfirm': 'Αντιγραφή',
'collections.noTrips': 'Δεν υπάρχουν ταξίδια ακόμα',
'collections.alreadyInTrip': 'Υπάρχει ήδη σε αυτό το ταξίδι',
diff --git a/shared/src/i18n/gr/common.ts b/shared/src/i18n/gr/common.ts
index 549446ec7..1207bbf8c 100644
--- a/shared/src/i18n/gr/common.ts
+++ b/shared/src/i18n/gr/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Επιλογή όλων',
'common.deselectAll': 'Απο-επιλογή όλων',
'common.error': 'Σφάλμα',
+ 'common.success': 'Επιτυχία',
'common.unknownError': 'Άγνωστο σφάλμα',
'common.tooManyAttempts': 'Πολλαπλές προσπάθειες. Παρακαλώ δοκιμάστε αργότερα.',
'common.back': 'Πίσω',
diff --git a/shared/src/i18n/gr/places.ts b/shared/src/i18n/gr/places.ts
index 052460095..3bd47754f 100644
--- a/shared/src/i18n/gr/places.ts
+++ b/shared/src/i18n/gr/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Γεωγραφικό Μήκος (π.χ. 2.3522)',
'places.formCategory': 'Κατηγορία',
'places.noCategory': 'Χωρίς Κατηγορία',
+ 'places.newCategory': 'Νέα κατηγορία',
'places.categoryNamePlaceholder': 'Όνομα κατηγορίας',
'places.formTime': 'Ώρα',
'places.startTime': 'Έναρξη',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Αλλαγή εικόνας',
'places.removeImage': 'Αφαίρεση εικόνας',
'places.imageUploadError': 'Δεν ήταν δυνατή η μεταφόρτωση της εικόνας',
+ 'places.imageRemoveError': 'Δεν ήταν δυνατή η αφαίρεση της εικόνας',
};
export default places;
diff --git a/shared/src/i18n/gr/settings.ts b/shared/src/i18n/gr/settings.ts
index b7184d23d..8d668da3c 100644
--- a/shared/src/i18n/gr/settings.ts
+++ b/shared/src/i18n/gr/settings.ts
@@ -280,6 +280,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Η εικόνα προφίλ ενημερώθηκε',
'settings.avatarRemoved': 'Η εικόνα προφίλ αφαιρέθηκε',
'settings.avatarError': 'Η μεταφόρτωση απέτυχε',
+ 'settings.avatarRemoveError': 'Η αφαίρεση απέτυχε',
'settings.mfa.title': 'Έλεγχος ταυτότητας δύο παραγόντων (2FA)',
'settings.mfa.description':
'Προσθέτει ένα δεύτερο βήμα όταν συνδέεστε με email και κωδικό. Χρησιμοποιήστε μια εφαρμογή authenticator (Google Authenticator, Authy, κ.λπ.).',
diff --git a/shared/src/i18n/gr/undo.ts b/shared/src/i18n/gr/undo.ts
index 0de153f41..464ef0db2 100644
--- a/shared/src/i18n/gr/undo.ts
+++ b/shared/src/i18n/gr/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Το κλείδωμα τοποθεσίας εναλλάχθηκε',
'undo.importGpx': 'Εισαγωγή GPX',
'undo.importKeyholeMarkup': 'Εισαγωγή KMZ/KML',
+ 'undo.importFiles': 'Εισαγωγή αρχείων',
'undo.importGoogleList': 'Εισαγωγή Google Maps',
'undo.importNaverList': 'Εισαγωγή Naver Maps',
'undo.addPlace': 'Η τοποθεσία προστέθηκε',
diff --git a/shared/src/i18n/hu/admin.ts b/shared/src/i18n/hu/admin.ts
index 2c0b29a17..91bdf4eae 100644
--- a/shared/src/i18n/hu/admin.ts
+++ b/shared/src/i18n/hu/admin.ts
@@ -159,6 +159,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Nem sikerült betölteni a sablonokat',
'admin.packingTemplates.createError': 'Nem sikerült létrehozni a sablont',
'admin.packingTemplates.deleteError': 'Nem sikerült törölni a sablont',
+ 'admin.packingTemplates.deleteCategoryError': 'A kategória törlése nem sikerült',
+ 'admin.packingTemplates.deleteItemError': 'A tétel törlése nem sikerült',
'admin.packingTemplates.saveError': 'Nem sikerült menteni',
'admin.tabs.addons': 'Bővítmények',
'admin.tabs.plugins': 'Pluginok',
diff --git a/shared/src/i18n/hu/collab.ts b/shared/src/i18n/hu/collab.ts
index 175f44c99..1ebe551ff 100644
--- a/shared/src/i18n/hu/collab.ts
+++ b/shared/src/i18n/hu/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Rögzítsd az ötleteidet és terveidet',
'collab.notes.all': 'Összes',
'collab.notes.titlePlaceholder': 'Jegyzet címe',
+ 'collab.notes.content': 'Tartalom',
+ 'collab.notes.removeFile': '{name} eltávolítása',
'collab.notes.contentPlaceholder': 'Írj valamit...',
'collab.notes.categoryPlaceholder': 'Kategória',
'collab.notes.newCategory': 'Új kategória...',
diff --git a/shared/src/i18n/hu/collection.ts b/shared/src/i18n/hu/collection.ts
index 8ea1e9386..a50b815eb 100644
--- a/shared/src/i18n/hu/collection.ts
+++ b/shared/src/i18n/hu/collection.ts
@@ -82,6 +82,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Másolás utazásba',
'collections.copyN': '{count} másolása utazásba',
'collections.copyToTripSearch': 'Utazások keresése',
+ 'collections.searchLists': 'Listák keresése',
'collections.copyToTripConfirm': 'Másolás',
'collections.noTrips': 'Még nincsenek utazások',
'collections.alreadyInTrip': 'Már ebben az utazásban van',
diff --git a/shared/src/i18n/hu/common.ts b/shared/src/i18n/hu/common.ts
index 4796e1a45..779b0100e 100644
--- a/shared/src/i18n/hu/common.ts
+++ b/shared/src/i18n/hu/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Mindet kiválaszt',
'common.deselectAll': 'Összes kijelölés megszüntetése',
'common.error': 'Hiba',
+ 'common.success': 'Sikeres',
'common.unknownError': 'Ismeretlen hiba',
'common.tooManyAttempts': 'Túl sok próbálkozás. Kérjük, próbálja újra később.',
'common.back': 'Vissza',
diff --git a/shared/src/i18n/hu/places.ts b/shared/src/i18n/hu/places.ts
index b667b076d..22aa26916 100644
--- a/shared/src/i18n/hu/places.ts
+++ b/shared/src/i18n/hu/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Hosszúsági fok (pl. 2.3522)',
'places.formCategory': 'Kategória',
'places.noCategory': 'Nincs kategória',
+ 'places.newCategory': 'Új kategória',
'places.categoryNamePlaceholder': 'Kategória neve',
'places.formTime': 'Időpont',
'places.startTime': 'Kezdés',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Kép módosítása',
'places.removeImage': 'Kép eltávolítása',
'places.imageUploadError': 'Nem sikerült feltölteni a képet',
+ 'places.imageRemoveError': 'Nem sikerült eltávolítani a képet',
};
export default places;
diff --git a/shared/src/i18n/hu/settings.ts b/shared/src/i18n/hu/settings.ts
index 4f9e81894..620fbff60 100644
--- a/shared/src/i18n/hu/settings.ts
+++ b/shared/src/i18n/hu/settings.ts
@@ -233,6 +233,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Profilkép frissítve',
'settings.avatarRemoved': 'Profilkép eltávolítva',
'settings.avatarError': 'Feltöltés sikertelen',
+ 'settings.avatarRemoveError': 'Eltávolítás sikertelen',
'settings.mfa.title': 'Kétfaktoros hitelesítés (2FA)',
'settings.mfa.description':
'Egy második lépést ad a bejelentkezéshez e-mail és jelszó használatakor. Használj hitelesítő alkalmazást (Google Authenticator, Authy stb.).',
diff --git a/shared/src/i18n/hu/undo.ts b/shared/src/i18n/hu/undo.ts
index 2dc889096..c3e340357 100644
--- a/shared/src/i18n/hu/undo.ts
+++ b/shared/src/i18n/hu/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Hely zárolása váltva',
'undo.importGpx': 'GPX importálás',
'undo.importKeyholeMarkup': 'KMZ/KML importálás',
+ 'undo.importFiles': 'Fájlimportálás',
'undo.importGoogleList': 'Google Maps importálás',
'undo.importNaverList': 'Naver Maps importálás',
'undo.addPlace': 'Hely hozzáadva',
diff --git a/shared/src/i18n/id/admin.ts b/shared/src/i18n/id/admin.ts
index a4b706f5c..299f6a14a 100644
--- a/shared/src/i18n/id/admin.ts
+++ b/shared/src/i18n/id/admin.ts
@@ -201,6 +201,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Gagal memuat template',
'admin.packingTemplates.createError': 'Gagal membuat template',
'admin.packingTemplates.deleteError': 'Gagal menghapus template',
+ 'admin.packingTemplates.deleteCategoryError': 'Gagal menghapus kategori',
+ 'admin.packingTemplates.deleteItemError': 'Gagal menghapus item',
'admin.packingTemplates.saveError': 'Gagal menyimpan',
'admin.tabs.addons': 'Addon',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/id/collab.ts b/shared/src/i18n/id/collab.ts
index fba5868b2..5266b5b79 100644
--- a/shared/src/i18n/id/collab.ts
+++ b/shared/src/i18n/id/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Mulai catat ide dan rencana',
'collab.notes.all': 'Semua',
'collab.notes.titlePlaceholder': 'Judul catatan',
+ 'collab.notes.content': 'Konten',
+ 'collab.notes.removeFile': 'Hapus {name}',
'collab.notes.contentPlaceholder': 'Tulis sesuatu...',
'collab.notes.categoryPlaceholder': 'Kategori',
'collab.notes.newCategory': 'Kategori baru...',
diff --git a/shared/src/i18n/id/collection.ts b/shared/src/i18n/id/collection.ts
index ecb68da0d..fdf61f3a0 100644
--- a/shared/src/i18n/id/collection.ts
+++ b/shared/src/i18n/id/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Salin ke perjalanan',
'collections.copyN': 'Salin {count} ke perjalanan',
'collections.copyToTripSearch': 'Cari perjalanan',
+ 'collections.searchLists': 'Cari daftar',
'collections.copyToTripConfirm': 'Salin',
'collections.noTrips': 'Belum ada perjalanan',
'collections.alreadyInTrip': 'Sudah ada di perjalanan ini',
diff --git a/shared/src/i18n/id/common.ts b/shared/src/i18n/id/common.ts
index 042e5d59c..bb3bbd258 100644
--- a/shared/src/i18n/id/common.ts
+++ b/shared/src/i18n/id/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Pilih semua',
'common.deselectAll': 'Batalkan semua pilihan',
'common.error': 'Kesalahan',
+ 'common.success': 'Berhasil',
'common.unknownError': 'Kesalahan tidak diketahui',
'common.tooManyAttempts': 'Terlalu banyak percobaan. Coba lagi nanti.',
'common.back': 'Kembali',
diff --git a/shared/src/i18n/id/places.ts b/shared/src/i18n/id/places.ts
index 0c50323dc..54b3e6e05 100644
--- a/shared/src/i18n/id/places.ts
+++ b/shared/src/i18n/id/places.ts
@@ -66,6 +66,7 @@ const places: TranslationStrings = {
'places.formLng': 'Bujur (mis. 2.3522)',
'places.formCategory': 'Kategori',
'places.noCategory': 'Tanpa Kategori',
+ 'places.newCategory': 'Kategori baru',
'places.categoryNamePlaceholder': 'Nama kategori',
'places.formTime': 'Waktu',
'places.startTime': 'Mulai',
@@ -96,5 +97,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Ganti gambar',
'places.removeImage': 'Hapus gambar',
'places.imageUploadError': 'Tidak dapat mengunggah gambar',
+ 'places.imageRemoveError': 'Tidak dapat menghapus gambar',
};
export default places;
diff --git a/shared/src/i18n/id/settings.ts b/shared/src/i18n/id/settings.ts
index b861c38d8..fea22a539 100644
--- a/shared/src/i18n/id/settings.ts
+++ b/shared/src/i18n/id/settings.ts
@@ -269,6 +269,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Foto profil diperbarui',
'settings.avatarRemoved': 'Foto profil dihapus',
'settings.avatarError': 'Gagal mengunggah',
+ 'settings.avatarRemoveError': 'Gagal menghapus',
'settings.mfa.title': 'Autentikasi dua faktor (2FA)',
'settings.mfa.description':
'Menambahkan langkah kedua saat masuk dengan email dan kata sandi. Gunakan aplikasi autentikator (Google Authenticator, Authy, dll.).',
diff --git a/shared/src/i18n/id/undo.ts b/shared/src/i18n/id/undo.ts
index 5ff9844fd..eaa7328b7 100644
--- a/shared/src/i18n/id/undo.ts
+++ b/shared/src/i18n/id/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Kunci tempat diubah',
'undo.importGpx': 'Impor GPX',
'undo.importKeyholeMarkup': 'Impor KMZ/KML',
+ 'undo.importFiles': 'Impor file',
'undo.importGoogleList': 'Impor Google Maps',
'undo.importNaverList': 'Impor Naver Maps',
'undo.addPlace': 'Tempat ditambahkan',
diff --git a/shared/src/i18n/it/admin.ts b/shared/src/i18n/it/admin.ts
index c21a42953..70ddfa5f5 100644
--- a/shared/src/i18n/it/admin.ts
+++ b/shared/src/i18n/it/admin.ts
@@ -158,6 +158,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Impossibile caricare i modelli',
'admin.packingTemplates.createError': 'Impossibile creare il modello',
'admin.packingTemplates.deleteError': 'Impossibile eliminare il modello',
+ 'admin.packingTemplates.deleteCategoryError': 'Impossibile eliminare la categoria',
+ 'admin.packingTemplates.deleteItemError': 'Impossibile eliminare la voce',
'admin.packingTemplates.saveError': 'Impossibile salvare',
'admin.tabs.addons': 'Moduli',
'admin.tabs.plugins': 'Plugin',
diff --git a/shared/src/i18n/it/collab.ts b/shared/src/i18n/it/collab.ts
index f503dd25c..42f22063d 100644
--- a/shared/src/i18n/it/collab.ts
+++ b/shared/src/i18n/it/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Inizia a raccogliere idee e programmi',
'collab.notes.all': 'Tutte',
'collab.notes.titlePlaceholder': 'Titolo della nota',
+ 'collab.notes.content': 'Contenuto',
+ 'collab.notes.removeFile': 'Rimuovi {name}',
'collab.notes.contentPlaceholder': 'Scrivi qualcosa...',
'collab.notes.categoryPlaceholder': 'Categoria',
'collab.notes.newCategory': 'Nuova categoria...',
diff --git a/shared/src/i18n/it/collection.ts b/shared/src/i18n/it/collection.ts
index 657b2eb6f..8fd929d64 100644
--- a/shared/src/i18n/it/collection.ts
+++ b/shared/src/i18n/it/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Copia nel viaggio',
'collections.copyN': 'Copia {count} nel viaggio',
'collections.copyToTripSearch': 'Cerca viaggi',
+ 'collections.searchLists': 'Cerca elenchi',
'collections.copyToTripConfirm': 'Copia',
'collections.noTrips': 'Ancora nessun viaggio',
'collections.alreadyInTrip': 'Già in questo viaggio',
diff --git a/shared/src/i18n/it/common.ts b/shared/src/i18n/it/common.ts
index 575547eb1..04851d402 100644
--- a/shared/src/i18n/it/common.ts
+++ b/shared/src/i18n/it/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Seleziona tutto',
'common.deselectAll': 'Deseleziona tutto',
'common.error': 'Errore',
+ 'common.success': 'Successo',
'common.unknownError': 'Errore sconosciuto',
'common.tooManyAttempts': 'Troppi tentativi. Riprova più tardi.',
'common.back': 'Indietro',
diff --git a/shared/src/i18n/it/places.ts b/shared/src/i18n/it/places.ts
index 02047a534..8922e4b1f 100644
--- a/shared/src/i18n/it/places.ts
+++ b/shared/src/i18n/it/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Longitudine (es. 2.3522)',
'places.formCategory': 'Categoria',
'places.noCategory': 'Nessuna categoria',
+ 'places.newCategory': 'Nuova categoria',
'places.categoryNamePlaceholder': 'Nome categoria',
'places.formTime': 'Ora',
'places.startTime': 'Inizio',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Cambia immagine',
'places.removeImage': 'Rimuovi immagine',
'places.imageUploadError': "Impossibile caricare l'immagine",
+ 'places.imageRemoveError': "Impossibile rimuovere l'immagine",
};
export default places;
diff --git a/shared/src/i18n/it/settings.ts b/shared/src/i18n/it/settings.ts
index 3c36c659d..1d855bea8 100644
--- a/shared/src/i18n/it/settings.ts
+++ b/shared/src/i18n/it/settings.ts
@@ -234,6 +234,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Immagine del profilo aggiornata',
'settings.avatarRemoved': 'Immagine del profilo rimossa',
'settings.avatarError': 'Impossibile caricare',
+ 'settings.avatarRemoveError': 'Rimozione non riuscita',
'settings.mfa.title': 'Autenticazione a due fattori (2FA)',
'settings.mfa.description':
"Aggiunge un secondo passaggio quando accedi con email e password. Usa un'app authenticator (Google Authenticator, Authy, ecc.).",
diff --git a/shared/src/i18n/it/undo.ts b/shared/src/i18n/it/undo.ts
index 3394fba28..cf0d82a85 100644
--- a/shared/src/i18n/it/undo.ts
+++ b/shared/src/i18n/it/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Blocco luogo modificato',
'undo.importGpx': 'Importazione GPX',
'undo.importKeyholeMarkup': 'Importazione KMZ/KML',
+ 'undo.importFiles': 'Importazione file',
'undo.importGoogleList': 'Importazione Google Maps',
'undo.importNaverList': 'Importazione Naver Maps',
'undo.addPlace': 'Luogo aggiunto',
diff --git a/shared/src/i18n/ja/admin.ts b/shared/src/i18n/ja/admin.ts
index 04141a4d5..e19384ce6 100644
--- a/shared/src/i18n/ja/admin.ts
+++ b/shared/src/i18n/ja/admin.ts
@@ -190,6 +190,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'テンプレートの読み込みに失敗しました',
'admin.packingTemplates.createError': 'テンプレートの作成に失敗しました',
'admin.packingTemplates.deleteError': 'テンプレートの削除に失敗しました',
+ 'admin.packingTemplates.deleteCategoryError': 'カテゴリを削除できませんでした',
+ 'admin.packingTemplates.deleteItemError': 'アイテムを削除できませんでした',
'admin.packingTemplates.saveError': '保存に失敗しました',
'admin.tabs.addons': 'アドオン',
'admin.tabs.plugins': 'プラグイン',
diff --git a/shared/src/i18n/ja/collab.ts b/shared/src/i18n/ja/collab.ts
index ff1f62c9d..9d217bb09 100644
--- a/shared/src/i18n/ja/collab.ts
+++ b/shared/src/i18n/ja/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'アイデアや計画を書き留めましょう',
'collab.notes.all': 'すべて',
'collab.notes.titlePlaceholder': 'ノートのタイトル',
+ 'collab.notes.content': '内容',
+ 'collab.notes.removeFile': '{name} を削除',
'collab.notes.contentPlaceholder': '内容を入力…',
'collab.notes.categoryPlaceholder': 'カテゴリ',
'collab.notes.newCategory': '新しいカテゴリ…',
diff --git a/shared/src/i18n/ja/collection.ts b/shared/src/i18n/ja/collection.ts
index 6be2f0196..1b76ab26f 100644
--- a/shared/src/i18n/ja/collection.ts
+++ b/shared/src/i18n/ja/collection.ts
@@ -80,6 +80,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': '旅行にコピー',
'collections.copyN': '{count}件を旅行にコピー',
'collections.copyToTripSearch': '旅行を検索',
+ 'collections.searchLists': 'リストを検索',
'collections.copyToTripConfirm': 'コピー',
'collections.noTrips': 'まだ旅行がありません',
'collections.alreadyInTrip': 'この旅行にすでにあります',
diff --git a/shared/src/i18n/ja/common.ts b/shared/src/i18n/ja/common.ts
index 2fc8d231a..d904e9e57 100644
--- a/shared/src/i18n/ja/common.ts
+++ b/shared/src/i18n/ja/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'すべて選択',
'common.deselectAll': 'すべて解除',
'common.error': 'エラー',
+ 'common.success': '成功',
'common.unknownError': '不明なエラー',
'common.tooManyAttempts': '試行回数が多すぎます。時間をおいて再度お試しください。',
'common.back': '戻る',
diff --git a/shared/src/i18n/ja/places.ts b/shared/src/i18n/ja/places.ts
index 659ac6d4b..b98476604 100644
--- a/shared/src/i18n/ja/places.ts
+++ b/shared/src/i18n/ja/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': '経度(例:2.3522)',
'places.formCategory': 'カテゴリ',
'places.noCategory': 'カテゴリなし',
+ 'places.newCategory': '新しいカテゴリ',
'places.categoryNamePlaceholder': 'カテゴリ名',
'places.formTime': '時間',
'places.startTime': '開始',
@@ -96,5 +97,6 @@ const places: TranslationStrings = {
'places.changeImage': '画像を変更',
'places.removeImage': '画像を削除',
'places.imageUploadError': '画像をアップロードできませんでした',
+ 'places.imageRemoveError': '画像を削除できませんでした',
};
export default places;
diff --git a/shared/src/i18n/ja/settings.ts b/shared/src/i18n/ja/settings.ts
index bb1c05119..ea0b74aa5 100644
--- a/shared/src/i18n/ja/settings.ts
+++ b/shared/src/i18n/ja/settings.ts
@@ -245,6 +245,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'プロフィール画像を更新しました',
'settings.avatarRemoved': 'プロフィール画像を削除しました',
'settings.avatarError': 'アップロードに失敗しました',
+ 'settings.avatarRemoveError': '削除に失敗しました',
'settings.mfa.title': '二要素認証(2FA)',
'settings.mfa.description': 'サインイン時に追加の認証を行います。',
'settings.mfa.requiredByPolicy': '管理者により2FAが必須です。',
diff --git a/shared/src/i18n/ja/undo.ts b/shared/src/i18n/ja/undo.ts
index 2b458a8ac..c8b9a1e88 100644
--- a/shared/src/i18n/ja/undo.ts
+++ b/shared/src/i18n/ja/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': '場所のロックを切り替え',
'undo.importGpx': 'GPXをインポート',
'undo.importKeyholeMarkup': 'KMZ/KMLをインポート',
+ 'undo.importFiles': 'ファイルインポート',
'undo.importGoogleList': 'Googleマップをインポート',
'undo.importNaverList': 'Naverマップをインポート',
'undo.addPlace': '場所を追加',
diff --git a/shared/src/i18n/ko/admin.ts b/shared/src/i18n/ko/admin.ts
index 56f298180..927638ad5 100644
--- a/shared/src/i18n/ko/admin.ts
+++ b/shared/src/i18n/ko/admin.ts
@@ -196,6 +196,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': '템플릿 불러오기 실패',
'admin.packingTemplates.createError': '템플릿 생성 실패',
'admin.packingTemplates.deleteError': '템플릿 삭제 실패',
+ 'admin.packingTemplates.deleteCategoryError': '카테고리를 삭제하지 못했습니다',
+ 'admin.packingTemplates.deleteItemError': '항목을 삭제하지 못했습니다',
'admin.packingTemplates.saveError': '저장 실패',
'admin.tabs.addons': '애드온',
'admin.tabs.plugins': '플러그인',
diff --git a/shared/src/i18n/ko/collab.ts b/shared/src/i18n/ko/collab.ts
index 35ebce8e1..58e4d709e 100644
--- a/shared/src/i18n/ko/collab.ts
+++ b/shared/src/i18n/ko/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': '아이디어와 계획을 기록하세요',
'collab.notes.all': '전체',
'collab.notes.titlePlaceholder': '메모 제목',
+ 'collab.notes.content': '내용',
+ 'collab.notes.removeFile': '{name} 제거',
'collab.notes.contentPlaceholder': '내용을 입력하세요...',
'collab.notes.categoryPlaceholder': '카테고리',
'collab.notes.newCategory': '새 카테고리...',
diff --git a/shared/src/i18n/ko/collection.ts b/shared/src/i18n/ko/collection.ts
index a563d72ac..ebe824ebe 100644
--- a/shared/src/i18n/ko/collection.ts
+++ b/shared/src/i18n/ko/collection.ts
@@ -80,6 +80,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': '여행에 복사',
'collections.copyN': '{count}개를 여행에 복사',
'collections.copyToTripSearch': '여행 검색',
+ 'collections.searchLists': '목록 검색',
'collections.copyToTripConfirm': '복사',
'collections.noTrips': '아직 여행이 없습니다',
'collections.alreadyInTrip': '이미 이 여행에 있습니다',
diff --git a/shared/src/i18n/ko/common.ts b/shared/src/i18n/ko/common.ts
index 7fddfcdcc..e91d9ac01 100644
--- a/shared/src/i18n/ko/common.ts
+++ b/shared/src/i18n/ko/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': '전체 선택',
'common.deselectAll': '전체 해제',
'common.error': '오류',
+ 'common.success': '성공',
'common.unknownError': '알 수 없는 오류',
'common.tooManyAttempts': '시도 횟수가 너무 많습니다. 잠시 후 다시 시도해 주세요.',
'common.back': '뒤로',
diff --git a/shared/src/i18n/ko/places.ts b/shared/src/i18n/ko/places.ts
index 3c512a194..1c27967fa 100644
--- a/shared/src/i18n/ko/places.ts
+++ b/shared/src/i18n/ko/places.ts
@@ -66,6 +66,7 @@ const places: TranslationStrings = {
'places.formLng': '경도 (예: 2.3522)',
'places.formCategory': '카테고리',
'places.noCategory': '카테고리 없음',
+ 'places.newCategory': '새 카테고리',
'places.categoryNamePlaceholder': '카테고리 이름',
'places.formTime': '시간',
'places.startTime': '시작',
@@ -95,5 +96,6 @@ const places: TranslationStrings = {
'places.changeImage': '이미지 변경',
'places.removeImage': '이미지 제거',
'places.imageUploadError': '이미지를 업로드할 수 없습니다',
+ 'places.imageRemoveError': '이미지를 제거할 수 없습니다',
};
export default places;
diff --git a/shared/src/i18n/ko/settings.ts b/shared/src/i18n/ko/settings.ts
index de6d1feb0..97e671573 100644
--- a/shared/src/i18n/ko/settings.ts
+++ b/shared/src/i18n/ko/settings.ts
@@ -259,6 +259,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': '프로필 사진이 업데이트되었습니다',
'settings.avatarRemoved': '프로필 사진이 삭제되었습니다',
'settings.avatarError': '업로드 실패',
+ 'settings.avatarRemoveError': '삭제 실패',
'settings.mfa.title': '2단계 인증 (2FA)',
'settings.mfa.description':
'이메일 및 비밀번호로 로그인할 때 두 번째 단계를 추가합니다. 인증 앱 (Google Authenticator, Authy 등)을 사용하세요.',
diff --git a/shared/src/i18n/ko/undo.ts b/shared/src/i18n/ko/undo.ts
index 3ac8128bd..a4674feb6 100644
--- a/shared/src/i18n/ko/undo.ts
+++ b/shared/src/i18n/ko/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': '장소 잠금이 변경되었습니다',
'undo.importGpx': 'GPX 가져오기',
'undo.importKeyholeMarkup': 'KMZ/KML 가져오기',
+ 'undo.importFiles': '파일 가져오기',
'undo.importGoogleList': 'Google Maps 가져오기',
'undo.importNaverList': '네이버 지도 가져오기',
'undo.addPlace': '장소가 추가되었습니다',
diff --git a/shared/src/i18n/nl/admin.ts b/shared/src/i18n/nl/admin.ts
index 36fdd90bb..40083b475 100644
--- a/shared/src/i18n/nl/admin.ts
+++ b/shared/src/i18n/nl/admin.ts
@@ -159,6 +159,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Fout bij laden van sjablonen',
'admin.packingTemplates.createError': 'Fout bij aanmaken van sjabloon',
'admin.packingTemplates.deleteError': 'Fout bij verwijderen van sjabloon',
+ 'admin.packingTemplates.deleteCategoryError': 'Categorie verwijderen mislukt',
+ 'admin.packingTemplates.deleteItemError': 'Item verwijderen mislukt',
'admin.packingTemplates.saveError': 'Fout bij opslaan',
'admin.tabs.addons': 'Add-ons',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/nl/collab.ts b/shared/src/i18n/nl/collab.ts
index 831e4e69a..cf7ad91d7 100644
--- a/shared/src/i18n/nl/collab.ts
+++ b/shared/src/i18n/nl/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Begin met het vastleggen van ideeën en plannen',
'collab.notes.all': 'Alle',
'collab.notes.titlePlaceholder': 'Notitietitel',
+ 'collab.notes.content': 'Inhoud',
+ 'collab.notes.removeFile': '{name} verwijderen',
'collab.notes.contentPlaceholder': 'Schrijf iets...',
'collab.notes.categoryPlaceholder': 'Categorie',
'collab.notes.newCategory': 'Nieuwe categorie...',
diff --git a/shared/src/i18n/nl/collection.ts b/shared/src/i18n/nl/collection.ts
index b110c09e2..7535fd8bc 100644
--- a/shared/src/i18n/nl/collection.ts
+++ b/shared/src/i18n/nl/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Naar reis kopiëren',
'collections.copyN': '{count} naar reis kopiëren',
'collections.copyToTripSearch': 'Reizen zoeken',
+ 'collections.searchLists': 'Lijsten zoeken',
'collections.copyToTripConfirm': 'Kopiëren',
'collections.noTrips': 'Nog geen reizen',
'collections.alreadyInTrip': 'Al in deze reis',
diff --git a/shared/src/i18n/nl/common.ts b/shared/src/i18n/nl/common.ts
index 66cf87fdc..3be76cce7 100644
--- a/shared/src/i18n/nl/common.ts
+++ b/shared/src/i18n/nl/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Alles selecteren',
'common.deselectAll': 'Alles deselecteren',
'common.error': 'Fout',
+ 'common.success': 'Gelukt',
'common.unknownError': 'Onbekende fout',
'common.tooManyAttempts': 'Te veel pogingen. Probeer het later opnieuw.',
'common.back': 'Terug',
diff --git a/shared/src/i18n/nl/places.ts b/shared/src/i18n/nl/places.ts
index 02288805c..907050f7b 100644
--- a/shared/src/i18n/nl/places.ts
+++ b/shared/src/i18n/nl/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Lengtegraad (bijv. 2.3522)',
'places.formCategory': 'Categorie',
'places.noCategory': 'Geen categorie',
+ 'places.newCategory': 'Nieuwe categorie',
'places.categoryNamePlaceholder': 'Categorienaam',
'places.formTime': 'Tijd',
'places.startTime': 'Starttijd',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Afbeelding wijzigen',
'places.removeImage': 'Afbeelding verwijderen',
'places.imageUploadError': 'Afbeelding uploaden mislukt',
+ 'places.imageRemoveError': 'Afbeelding verwijderen mislukt',
};
export default places;
diff --git a/shared/src/i18n/nl/settings.ts b/shared/src/i18n/nl/settings.ts
index de4fec5e5..1a38d27b6 100644
--- a/shared/src/i18n/nl/settings.ts
+++ b/shared/src/i18n/nl/settings.ts
@@ -262,6 +262,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Profielfoto bijgewerkt',
'settings.avatarRemoved': 'Profielfoto verwijderd',
'settings.avatarError': 'Uploaden mislukt',
+ 'settings.avatarRemoveError': 'Verwijderen mislukt',
'settings.bookingLabels': 'Routelabels voor boekingen',
'settings.bookingLabelsHint': 'Toon station- / luchthavennamen op de kaart. Indien uit, alleen het icoon.',
'settings.notifyVersionAvailable': 'Nieuwe versie beschikbaar',
diff --git a/shared/src/i18n/nl/undo.ts b/shared/src/i18n/nl/undo.ts
index 13eb49cf1..bdb704b21 100644
--- a/shared/src/i18n/nl/undo.ts
+++ b/shared/src/i18n/nl/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Vergrendeling locatie gewijzigd',
'undo.importGpx': 'GPX-import',
'undo.importKeyholeMarkup': 'KMZ/KML-import',
+ 'undo.importFiles': 'Bestandsimport',
'undo.importGoogleList': 'Google Maps-import',
'undo.importNaverList': 'Naver Maps-import',
'undo.addPlace': 'Locatie toegevoegd',
diff --git a/shared/src/i18n/pl/admin.ts b/shared/src/i18n/pl/admin.ts
index c03ea8d9b..314fe3477 100644
--- a/shared/src/i18n/pl/admin.ts
+++ b/shared/src/i18n/pl/admin.ts
@@ -152,6 +152,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Nie udało się załadować szablonów',
'admin.packingTemplates.createError': 'Nie udało się utworzyć szablonu',
'admin.packingTemplates.deleteError': 'Nie udało się usunąć szablonu',
+ 'admin.packingTemplates.deleteCategoryError': 'Nie udało się usunąć kategorii',
+ 'admin.packingTemplates.deleteItemError': 'Nie udało się usunąć pozycji',
'admin.packingTemplates.saveError': 'Nie udało się zapisać szablonu',
'admin.tabs.addons': 'Dodatki',
'admin.tabs.plugins': 'Wtyczki',
diff --git a/shared/src/i18n/pl/collab.ts b/shared/src/i18n/pl/collab.ts
index f57bedeaa..fcaf04751 100644
--- a/shared/src/i18n/pl/collab.ts
+++ b/shared/src/i18n/pl/collab.ts
@@ -36,6 +36,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Zapisuj pomysły i plany',
'collab.notes.all': 'Wszystkie',
'collab.notes.titlePlaceholder': 'Tytuł notatki',
+ 'collab.notes.content': 'Treść',
+ 'collab.notes.removeFile': 'Usuń {name}',
'collab.notes.contentPlaceholder': 'Napisz coś...',
'collab.notes.categoryPlaceholder': 'Kategoria',
'collab.notes.newCategory': 'Nowa kategoria...',
diff --git a/shared/src/i18n/pl/collection.ts b/shared/src/i18n/pl/collection.ts
index 2eedd1724..569421b3a 100644
--- a/shared/src/i18n/pl/collection.ts
+++ b/shared/src/i18n/pl/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Kopiuj do podróży',
'collections.copyN': 'Kopiuj {count} do podróży',
'collections.copyToTripSearch': 'Szukaj podróży',
+ 'collections.searchLists': 'Szukaj list',
'collections.copyToTripConfirm': 'Kopiuj',
'collections.noTrips': 'Brak podróży',
'collections.alreadyInTrip': 'Już w tej podróży',
diff --git a/shared/src/i18n/pl/common.ts b/shared/src/i18n/pl/common.ts
index ec6fc8d1c..b8ff42ccf 100644
--- a/shared/src/i18n/pl/common.ts
+++ b/shared/src/i18n/pl/common.ts
@@ -12,6 +12,7 @@ const common: TranslationStrings = {
'common.add': 'Dodaj',
'common.loading': 'Ładowanie...',
'common.error': 'Błąd',
+ 'common.success': 'Sukces',
'common.unknownError': 'Nieznany błąd',
'common.tooManyAttempts': 'Zbyt wiele prób. Spróbuj ponownie później.',
'common.back': 'Wstecz',
diff --git a/shared/src/i18n/pl/places.ts b/shared/src/i18n/pl/places.ts
index 76f8b6602..f2eb89bc0 100644
--- a/shared/src/i18n/pl/places.ts
+++ b/shared/src/i18n/pl/places.ts
@@ -58,6 +58,7 @@ const places: TranslationStrings = {
'places.formLng': 'Długość (np. 2.3522)',
'places.formCategory': 'Kategoria',
'places.noCategory': 'Brak kategorii',
+ 'places.newCategory': 'Nowa kategoria',
'places.categoryNamePlaceholder': 'Nazwa kategorii',
'places.formTime': 'Godzina',
'places.startTime': 'Początek',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Zmień zdjęcie',
'places.removeImage': 'Usuń zdjęcie',
'places.imageUploadError': 'Nie udało się przesłać zdjęcia',
+ 'places.imageRemoveError': 'Nie udało się usunąć zdjęcia',
};
export default places;
diff --git a/shared/src/i18n/pl/settings.ts b/shared/src/i18n/pl/settings.ts
index 1c660fcbc..3e6867f5d 100644
--- a/shared/src/i18n/pl/settings.ts
+++ b/shared/src/i18n/pl/settings.ts
@@ -229,6 +229,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Zdjęcie profilowe zostało zaktualizowane',
'settings.avatarRemoved': 'Zdjęcie profilowe zostało usunięte',
'settings.avatarError': 'Przesyłanie nie powiodło się',
+ 'settings.avatarRemoveError': 'Usuwanie nie powiodło się',
'settings.mfa.title': 'Uwierzytelnianie dwuskładnikowe (2FA)',
'settings.mfa.description':
'Dodaje drugi krok, kiedy logujesz się e-mailem i hasłem. Użyj aplikacji uwierzytelniającej (Google Authenticator, Authy, itp.).',
diff --git a/shared/src/i18n/pl/undo.ts b/shared/src/i18n/pl/undo.ts
index fbab2ab02..6f62e4577 100644
--- a/shared/src/i18n/pl/undo.ts
+++ b/shared/src/i18n/pl/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Blokada przełączona',
'undo.importGpx': 'Import GPX',
'undo.importKeyholeMarkup': 'Import KMZ/KML',
+ 'undo.importFiles': 'Import plików',
'undo.importGoogleList': 'Import Google Maps',
'undo.importNaverList': 'Import Naver Maps',
'undo.addPlace': 'Miejsce dodane',
diff --git a/shared/src/i18n/ru/admin.ts b/shared/src/i18n/ru/admin.ts
index 329220d20..de0976dcb 100644
--- a/shared/src/i18n/ru/admin.ts
+++ b/shared/src/i18n/ru/admin.ts
@@ -159,6 +159,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Ошибка загрузки шаблонов',
'admin.packingTemplates.createError': 'Ошибка создания шаблона',
'admin.packingTemplates.deleteError': 'Ошибка удаления шаблона',
+ 'admin.packingTemplates.deleteCategoryError': 'Не удалось удалить категорию',
+ 'admin.packingTemplates.deleteItemError': 'Не удалось удалить элемент',
'admin.packingTemplates.saveError': 'Ошибка сохранения',
'admin.tabs.addons': 'Дополнения',
'admin.tabs.plugins': 'Плагины',
diff --git a/shared/src/i18n/ru/collab.ts b/shared/src/i18n/ru/collab.ts
index 65647cdbd..d735ae4b2 100644
--- a/shared/src/i18n/ru/collab.ts
+++ b/shared/src/i18n/ru/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Начните записывать идеи и планы',
'collab.notes.all': 'Все',
'collab.notes.titlePlaceholder': 'Название заметки',
+ 'collab.notes.content': 'Содержание',
+ 'collab.notes.removeFile': 'Удалить {name}',
'collab.notes.contentPlaceholder': 'Напишите что-нибудь...',
'collab.notes.categoryPlaceholder': 'Категория',
'collab.notes.newCategory': 'Новая категория...',
diff --git a/shared/src/i18n/ru/collection.ts b/shared/src/i18n/ru/collection.ts
index ecd8bd7e8..8853f76a0 100644
--- a/shared/src/i18n/ru/collection.ts
+++ b/shared/src/i18n/ru/collection.ts
@@ -80,6 +80,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Скопировать в поездку',
'collections.copyN': 'Скопировать {count} в поездку',
'collections.copyToTripSearch': 'Поиск поездок',
+ 'collections.searchLists': 'Поиск списков',
'collections.copyToTripConfirm': 'Скопировать',
'collections.noTrips': 'Пока нет поездок',
'collections.alreadyInTrip': 'Уже в этой поездке',
diff --git a/shared/src/i18n/ru/common.ts b/shared/src/i18n/ru/common.ts
index ec6ac5510..b3bc27e9d 100644
--- a/shared/src/i18n/ru/common.ts
+++ b/shared/src/i18n/ru/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Выбрать всё',
'common.deselectAll': 'Снять выделение со всех',
'common.error': 'Ошибка',
+ 'common.success': 'Успешно',
'common.unknownError': 'Неизвестная ошибка',
'common.tooManyAttempts': 'Слишком много попыток. Попробуйте позже.',
'common.back': 'Назад',
diff --git a/shared/src/i18n/ru/places.ts b/shared/src/i18n/ru/places.ts
index d1265c233..67bae622c 100644
--- a/shared/src/i18n/ru/places.ts
+++ b/shared/src/i18n/ru/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Долгота (напр. 2.3522)',
'places.formCategory': 'Категория',
'places.noCategory': 'Без категории',
+ 'places.newCategory': 'Новая категория',
'places.categoryNamePlaceholder': 'Название категории',
'places.formTime': 'Время',
'places.startTime': 'Начало',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Изменить изображение',
'places.removeImage': 'Удалить изображение',
'places.imageUploadError': 'Не удалось загрузить изображение',
+ 'places.imageRemoveError': 'Не удалось удалить изображение',
};
export default places;
diff --git a/shared/src/i18n/ru/settings.ts b/shared/src/i18n/ru/settings.ts
index eef299244..f79c202a1 100644
--- a/shared/src/i18n/ru/settings.ts
+++ b/shared/src/i18n/ru/settings.ts
@@ -260,6 +260,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Фото профиля обновлено',
'settings.avatarRemoved': 'Фото профиля удалено',
'settings.avatarError': 'Ошибка загрузки',
+ 'settings.avatarRemoveError': 'Ошибка удаления',
'settings.bookingLabels': 'Подписи маршрутов бронирований',
'settings.bookingLabelsHint':
'Отображает названия станций / аэропортов на карте. Если выключено, показывается только значок.',
diff --git a/shared/src/i18n/ru/undo.ts b/shared/src/i18n/ru/undo.ts
index 914c3cb13..61e0009b4 100644
--- a/shared/src/i18n/ru/undo.ts
+++ b/shared/src/i18n/ru/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Блокировка места изменена',
'undo.importGpx': 'Импорт GPX',
'undo.importKeyholeMarkup': 'Импорт KMZ/KML',
+ 'undo.importFiles': 'Импорт файлов',
'undo.importGoogleList': 'Импорт из Google Maps',
'undo.importNaverList': 'Импорт из Naver Maps',
'undo.addPlace': 'Место добавлено',
diff --git a/shared/src/i18n/sv/admin.ts b/shared/src/i18n/sv/admin.ts
index eb99aee97..04c77b23f 100644
--- a/shared/src/i18n/sv/admin.ts
+++ b/shared/src/i18n/sv/admin.ts
@@ -215,6 +215,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Det gick inte att ladda mallarna',
'admin.packingTemplates.createError': 'Det gick inte att skapa mallen',
'admin.packingTemplates.deleteError': 'Det gick inte att ta bort mallen',
+ 'admin.packingTemplates.deleteCategoryError': 'Det gick inte att ta bort kategorin',
+ 'admin.packingTemplates.deleteItemError': 'Det gick inte att ta bort objektet',
'admin.packingTemplates.saveError': 'Det gick inte att spara',
'admin.tabs.addons': 'Tillägg',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/sv/collab.ts b/shared/src/i18n/sv/collab.ts
index 668e381b4..b879180d8 100644
--- a/shared/src/i18n/sv/collab.ts
+++ b/shared/src/i18n/sv/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Börja samla in idéer och planer',
'collab.notes.all': 'Alla',
'collab.notes.titlePlaceholder': 'Noterings titel',
+ 'collab.notes.content': 'Innehåll',
+ 'collab.notes.removeFile': 'Ta bort {name}',
'collab.notes.contentPlaceholder': 'Skriv något...',
'collab.notes.categoryPlaceholder': 'Kategori',
'collab.notes.newCategory': 'Ny kategori...',
diff --git a/shared/src/i18n/sv/collection.ts b/shared/src/i18n/sv/collection.ts
index dea11f656..1a2210a64 100644
--- a/shared/src/i18n/sv/collection.ts
+++ b/shared/src/i18n/sv/collection.ts
@@ -80,6 +80,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Kopiera till resa',
'collections.copyN': 'Kopiera {count} till resa',
'collections.copyToTripSearch': 'Sök resor',
+ 'collections.searchLists': 'Sök listor',
'collections.copyToTripConfirm': 'Kopiera',
'collections.noTrips': 'Inga resor ännu',
'collections.alreadyInTrip': 'Redan i den här resan',
diff --git a/shared/src/i18n/sv/common.ts b/shared/src/i18n/sv/common.ts
index ab7c6099f..60efcedcd 100644
--- a/shared/src/i18n/sv/common.ts
+++ b/shared/src/i18n/sv/common.ts
@@ -28,6 +28,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Välj alla',
'common.deselectAll': 'Avmarkera alla',
'common.error': 'Fel',
+ 'common.success': 'Klart',
'common.unknownError': 'Okänt fel',
'common.tooManyAttempts': 'För många försök. Försök igen senare.',
'common.back': 'Tillbaka',
diff --git a/shared/src/i18n/sv/places.ts b/shared/src/i18n/sv/places.ts
index 4b5e2c700..9f8d0418d 100644
--- a/shared/src/i18n/sv/places.ts
+++ b/shared/src/i18n/sv/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Longitud (t.ex. 2.3522)',
'places.formCategory': 'Kategori',
'places.noCategory': 'Ingen kategori',
+ 'places.newCategory': 'Ny kategori',
'places.categoryNamePlaceholder': 'Kategorinamn',
'places.formTime': 'Tid',
'places.startTime': 'Börjar',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Byt bild',
'places.removeImage': 'Ta bort bild',
'places.imageUploadError': 'Det gick inte att ladda upp bilden',
+ 'places.imageRemoveError': 'Det gick inte att ta bort bilden',
};
export default places;
diff --git a/shared/src/i18n/sv/settings.ts b/shared/src/i18n/sv/settings.ts
index 88724c0bb..7c7d710cd 100644
--- a/shared/src/i18n/sv/settings.ts
+++ b/shared/src/i18n/sv/settings.ts
@@ -276,6 +276,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Profilbilden har uppdaterats',
'settings.avatarRemoved': 'Profilbilden har tagits bort',
'settings.avatarError': 'Uppladdning misslyckades',
+ 'settings.avatarRemoveError': 'Borttagningen misslyckades',
'settings.mfa.title': 'Tvåfaktorsautentisering (2FA)',
'settings.mfa.description':
'Lägger till ett extra steg när du loggar in med e-postadress och lösenord. Använd en autentiseringsapp (Google Authenticator, Authy m.fl.).',
diff --git a/shared/src/i18n/sv/undo.ts b/shared/src/i18n/sv/undo.ts
index 1d97995a0..c868870d7 100644
--- a/shared/src/i18n/sv/undo.ts
+++ b/shared/src/i18n/sv/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Plats lås växlad',
'undo.importGpx': 'GPX importering',
'undo.importKeyholeMarkup': 'KMZ/KML importering',
+ 'undo.importFiles': 'Filimport',
'undo.importGoogleList': 'Google Maps importering',
'undo.importNaverList': 'Naver Maps importering',
'undo.importBooking': 'Boknings godkännande importering',
diff --git a/shared/src/i18n/tr/admin.ts b/shared/src/i18n/tr/admin.ts
index 0c720d6e7..898e18397 100644
--- a/shared/src/i18n/tr/admin.ts
+++ b/shared/src/i18n/tr/admin.ts
@@ -203,6 +203,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Şablonlar yüklenemedi',
'admin.packingTemplates.createError': 'Şablon oluşturulamadı',
'admin.packingTemplates.deleteError': 'Şablon silinemedi',
+ 'admin.packingTemplates.deleteCategoryError': 'Kategori silinemedi',
+ 'admin.packingTemplates.deleteItemError': 'Öğe silinemedi',
'admin.packingTemplates.saveError': 'Kaydedilemedi',
'admin.tabs.addons': 'Eklentiler',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/tr/collab.ts b/shared/src/i18n/tr/collab.ts
index 8b7d2e197..e8e8a1387 100644
--- a/shared/src/i18n/tr/collab.ts
+++ b/shared/src/i18n/tr/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Fikir ve planları kaydetmeye başlayın',
'collab.notes.all': 'Tüm',
'collab.notes.titlePlaceholder': 'Not başlığı',
+ 'collab.notes.content': 'İçerik',
+ 'collab.notes.removeFile': '{name} kaldır',
'collab.notes.contentPlaceholder': 'Bir şeyler yazın...',
'collab.notes.categoryPlaceholder': 'Kategori',
'collab.notes.newCategory': 'Yeni kategori...',
diff --git a/shared/src/i18n/tr/collection.ts b/shared/src/i18n/tr/collection.ts
index 474899262..6e4771a71 100644
--- a/shared/src/i18n/tr/collection.ts
+++ b/shared/src/i18n/tr/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Geziye kopyala',
'collections.copyN': '{count} öğeyi geziye kopyala',
'collections.copyToTripSearch': 'Gezi ara',
+ 'collections.searchLists': 'Listelerde ara',
'collections.copyToTripConfirm': 'Kopyala',
'collections.noTrips': 'Henüz gezi yok',
'collections.alreadyInTrip': 'Bu gezide zaten var',
diff --git a/shared/src/i18n/tr/common.ts b/shared/src/i18n/tr/common.ts
index 82331b839..7f6baf00f 100644
--- a/shared/src/i18n/tr/common.ts
+++ b/shared/src/i18n/tr/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Tümünü seç',
'common.deselectAll': 'Seçimi kaldır',
'common.error': 'Hata',
+ 'common.success': 'Başarılı',
'common.unknownError': 'Bilinmeyen hata',
'common.tooManyAttempts': 'Çok fazla deneme. Lütfen daha sonra tekrar deneyin.',
'common.back': 'Geri',
diff --git a/shared/src/i18n/tr/places.ts b/shared/src/i18n/tr/places.ts
index d1aa418b8..242ff6fa4 100644
--- a/shared/src/i18n/tr/places.ts
+++ b/shared/src/i18n/tr/places.ts
@@ -69,6 +69,7 @@ const places: TranslationStrings = {
'places.formLng': 'Boylam (ör. 2,3522)',
'places.formCategory': 'Kategori',
'places.noCategory': 'Kategori Yok',
+ 'places.newCategory': 'Yeni kategori',
'places.categoryNamePlaceholder': 'Kategori adı',
'places.formTime': 'Zaman',
'places.startTime': 'Başlangıç',
@@ -99,5 +100,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Görseli değiştir',
'places.removeImage': 'Görseli kaldır',
'places.imageUploadError': 'Görsel yüklenemedi',
+ 'places.imageRemoveError': 'Görsel kaldırılamadı',
};
export default places;
diff --git a/shared/src/i18n/tr/settings.ts b/shared/src/i18n/tr/settings.ts
index 7b7db816e..995905d4b 100644
--- a/shared/src/i18n/tr/settings.ts
+++ b/shared/src/i18n/tr/settings.ts
@@ -264,6 +264,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Profil resmi güncellendi',
'settings.avatarRemoved': 'Profil resmi kaldırıldı',
'settings.avatarError': 'Yükleme başarısız oldu',
+ 'settings.avatarRemoveError': 'Kaldırma başarısız oldu',
'settings.mfa.title': 'İki faktörlü kimlik doğrulama (2FA)',
'settings.mfa.description':
'E-posta ve şifreyle oturum açtığınızda ikinci bir adım ekler. Bir kimlik doğrulama uygulaması kullanın (Google Authenticator, Authy vb.).',
diff --git a/shared/src/i18n/tr/undo.ts b/shared/src/i18n/tr/undo.ts
index 2194c310f..f3fc60772 100644
--- a/shared/src/i18n/tr/undo.ts
+++ b/shared/src/i18n/tr/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Yer kilidi değiştirildi',
'undo.importGpx': 'GPX içe aktarma',
'undo.importKeyholeMarkup': 'KMZ/KML içe aktarma',
+ 'undo.importFiles': 'Dosya içe aktarma',
'undo.importGoogleList': 'Google Haritalar içe aktarma',
'undo.importNaverList': 'Naver Haritalar içe aktarma',
'undo.addPlace': 'Yer eklendi',
diff --git a/shared/src/i18n/uk/admin.ts b/shared/src/i18n/uk/admin.ts
index 6e5ccd032..32e9af8e3 100644
--- a/shared/src/i18n/uk/admin.ts
+++ b/shared/src/i18n/uk/admin.ts
@@ -159,6 +159,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Помилка завантаження шаблонів',
'admin.packingTemplates.createError': 'Помилка створення шаблону',
'admin.packingTemplates.deleteError': 'Помилка видалення шаблону',
+ 'admin.packingTemplates.deleteCategoryError': 'Не вдалося видалити категорію',
+ 'admin.packingTemplates.deleteItemError': 'Не вдалося видалити елемент',
'admin.packingTemplates.saveError': 'Помилка збереження',
'admin.tabs.addons': 'Дополнения',
'admin.tabs.plugins': 'Плагіни',
diff --git a/shared/src/i18n/uk/collab.ts b/shared/src/i18n/uk/collab.ts
index 5f706c710..6589ea970 100644
--- a/shared/src/i18n/uk/collab.ts
+++ b/shared/src/i18n/uk/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Почніть записувати ідеї та плани',
'collab.notes.all': 'Усі',
'collab.notes.titlePlaceholder': 'Назва нотатки',
+ 'collab.notes.content': 'Зміст',
+ 'collab.notes.removeFile': 'Видалити {name}',
'collab.notes.contentPlaceholder': 'Напишіть щось...',
'collab.notes.categoryPlaceholder': 'Категорія',
'collab.notes.newCategory': 'Нова категорія...',
diff --git a/shared/src/i18n/uk/collection.ts b/shared/src/i18n/uk/collection.ts
index ea268dbe0..20ab0855c 100644
--- a/shared/src/i18n/uk/collection.ts
+++ b/shared/src/i18n/uk/collection.ts
@@ -80,6 +80,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Скопіювати в подорож',
'collections.copyN': 'Скопіювати {count} у подорож',
'collections.copyToTripSearch': 'Пошук подорожей',
+ 'collections.searchLists': 'Пошук списків',
'collections.copyToTripConfirm': 'Скопіювати',
'collections.noTrips': 'Поки немає подорожей',
'collections.alreadyInTrip': 'Уже в цій подорожі',
diff --git a/shared/src/i18n/uk/common.ts b/shared/src/i18n/uk/common.ts
index 2e0ded74e..74af732c9 100644
--- a/shared/src/i18n/uk/common.ts
+++ b/shared/src/i18n/uk/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Вибрати все',
'common.deselectAll': 'Зняти виділення з усіх',
'common.error': 'Помилка',
+ 'common.success': 'Успішно',
'common.unknownError': 'Невідома помилка',
'common.tooManyAttempts': 'Занадто багато спроб. Спробуйте пізніше.',
'common.back': 'Назад',
diff --git a/shared/src/i18n/uk/places.ts b/shared/src/i18n/uk/places.ts
index 3aff953dc..594d91185 100644
--- a/shared/src/i18n/uk/places.ts
+++ b/shared/src/i18n/uk/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Довгота (наприклад, 2.3522)',
'places.formCategory': 'Категорія',
'places.noCategory': 'Без категорії',
+ 'places.newCategory': 'Нова категорія',
'places.categoryNamePlaceholder': 'Назва категорії',
'places.formTime': 'Час',
'places.startTime': 'Початок',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Змінити зображення',
'places.removeImage': 'Видалити зображення',
'places.imageUploadError': 'Не вдалося завантажити зображення',
+ 'places.imageRemoveError': 'Не вдалося видалити зображення',
};
export default places;
diff --git a/shared/src/i18n/uk/settings.ts b/shared/src/i18n/uk/settings.ts
index a1825e7f4..0b24c1a05 100644
--- a/shared/src/i18n/uk/settings.ts
+++ b/shared/src/i18n/uk/settings.ts
@@ -256,6 +256,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Фото профілю оновлено',
'settings.avatarRemoved': 'Фото профілю видалено',
'settings.avatarError': 'Помилка завантаження',
+ 'settings.avatarRemoveError': 'Помилка видалення',
'settings.bookingLabels': 'Підписи маршрутів бронювань',
'settings.bookingLabelsHint': 'Показує назви станцій / аеропортів на карті. Якщо вимкнено, показується лише значок.',
'settings.notifyVersionAvailable': 'Доступна нова версія',
diff --git a/shared/src/i18n/uk/undo.ts b/shared/src/i18n/uk/undo.ts
index 090636c88..977cc1196 100644
--- a/shared/src/i18n/uk/undo.ts
+++ b/shared/src/i18n/uk/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Блокування місця змінено',
'undo.importGpx': 'Імпорт GPX',
'undo.importKeyholeMarkup': 'Імпорт KMZ/KML',
+ 'undo.importFiles': 'Імпорт файлів',
'undo.importGoogleList': 'Імпорт з Google Maps',
'undo.importNaverList': 'Імпорт з Naver Maps',
'undo.addPlace': 'Місце додано',
diff --git a/shared/src/i18n/vi/admin.ts b/shared/src/i18n/vi/admin.ts
index afd79b1fb..12fc0e797 100644
--- a/shared/src/i18n/vi/admin.ts
+++ b/shared/src/i18n/vi/admin.ts
@@ -214,6 +214,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': 'Không tải được mẫu',
'admin.packingTemplates.createError': 'Không tạo được mẫu',
'admin.packingTemplates.deleteError': 'Không xóa được mẫu',
+ 'admin.packingTemplates.deleteCategoryError': 'Không thể xóa danh mục',
+ 'admin.packingTemplates.deleteItemError': 'Không thể xóa mục',
'admin.packingTemplates.saveError': 'Không lưu được',
'admin.tabs.addons': 'Tiện ích bổ sung',
'admin.tabs.plugins': 'Plugins',
diff --git a/shared/src/i18n/vi/collab.ts b/shared/src/i18n/vi/collab.ts
index a77a589be..dca0a5131 100644
--- a/shared/src/i18n/vi/collab.ts
+++ b/shared/src/i18n/vi/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': 'Bắt đầu nắm bắt ý tưởng và kế hoạch',
'collab.notes.all': 'Tất cả',
'collab.notes.titlePlaceholder': 'tiêu đề ghi chú',
+ 'collab.notes.content': 'Nội dung',
+ 'collab.notes.removeFile': 'Xóa {name}',
'collab.notes.contentPlaceholder': 'Viết một cái gì đó...',
'collab.notes.categoryPlaceholder': 'Loại',
'collab.notes.newCategory': 'Thể loại mới...',
diff --git a/shared/src/i18n/vi/collection.ts b/shared/src/i18n/vi/collection.ts
index d8210e4f6..8fbfa82d1 100644
--- a/shared/src/i18n/vi/collection.ts
+++ b/shared/src/i18n/vi/collection.ts
@@ -81,6 +81,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': 'Sao chép vào chuyến đi',
'collections.copyN': 'Sao chép {count} vào chuyến đi',
'collections.copyToTripSearch': 'Tìm chuyến đi',
+ 'collections.searchLists': 'Tìm danh sách',
'collections.copyToTripConfirm': 'Sao chép',
'collections.noTrips': 'Chưa có chuyến đi nào',
'collections.alreadyInTrip': 'Đã có trong chuyến đi này',
diff --git a/shared/src/i18n/vi/common.ts b/shared/src/i18n/vi/common.ts
index 4eb8dba08..9c1493ef7 100644
--- a/shared/src/i18n/vi/common.ts
+++ b/shared/src/i18n/vi/common.ts
@@ -28,6 +28,7 @@ const common: TranslationStrings = {
'common.selectAll': 'Chọn tất cả',
'common.deselectAll': 'Bỏ chọn tất cả',
'common.error': 'Lỗi',
+ 'common.success': 'Thành công',
'common.unknownError': 'Lỗi không xác định',
'common.tooManyAttempts': 'Quá nhiều nỗ lực. Vui lòng thử lại sau.',
'common.back': 'Quay lại',
diff --git a/shared/src/i18n/vi/places.ts b/shared/src/i18n/vi/places.ts
index dea1b4013..a5c6382f1 100644
--- a/shared/src/i18n/vi/places.ts
+++ b/shared/src/i18n/vi/places.ts
@@ -67,6 +67,7 @@ const places: TranslationStrings = {
'places.formLng': 'Kinh độ (ví dụ: 2,3522)',
'places.formCategory': 'Loại',
'places.noCategory': 'Không có danh mục',
+ 'places.newCategory': 'Danh mục mới',
'places.categoryNamePlaceholder': 'Tên danh mục',
'places.formTime': 'Thời gian',
'places.startTime': 'Bắt đầu',
@@ -97,5 +98,6 @@ const places: TranslationStrings = {
'places.changeImage': 'Đổi ảnh',
'places.removeImage': 'Xóa ảnh',
'places.imageUploadError': 'Không thể tải ảnh lên',
+ 'places.imageRemoveError': 'Không thể xóa ảnh',
};
export default places;
diff --git a/shared/src/i18n/vi/settings.ts b/shared/src/i18n/vi/settings.ts
index 962f4cb89..96526e7dc 100644
--- a/shared/src/i18n/vi/settings.ts
+++ b/shared/src/i18n/vi/settings.ts
@@ -278,6 +278,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': 'Đã cập nhật ảnh hồ sơ',
'settings.avatarRemoved': 'Đã xóa ảnh hồ sơ',
'settings.avatarError': 'Tải lên không thành công',
+ 'settings.avatarRemoveError': 'Xóa không thành công',
'settings.mfa.title': 'Xác thực hai yếu tố (2FA)',
'settings.mfa.description':
'Thêm bước thứ hai khi bạn đăng nhập bằng email và mật khẩu. Sử dụng ứng dụng xác thực (Google Authenticator, Authy, v.v.).',
diff --git a/shared/src/i18n/vi/undo.ts b/shared/src/i18n/vi/undo.ts
index 113787d76..ae136ca2f 100644
--- a/shared/src/i18n/vi/undo.ts
+++ b/shared/src/i18n/vi/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': 'Đã bật khóa địa điểm',
'undo.importGpx': 'GPX nhập khẩu',
'undo.importKeyholeMarkup': 'KMZ/KML nhập khẩu',
+ 'undo.importFiles': 'Nhập tệp',
'undo.importGoogleList': 'Google Maps nhập khẩu',
'undo.importNaverList': 'Nhập bản đồ Naver',
'undo.importBooking': 'Nhập xác nhận đặt chỗ',
diff --git a/shared/src/i18n/zh-TW/admin.ts b/shared/src/i18n/zh-TW/admin.ts
index b23e34c0b..148e35acc 100644
--- a/shared/src/i18n/zh-TW/admin.ts
+++ b/shared/src/i18n/zh-TW/admin.ts
@@ -193,6 +193,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': '載入模板失敗',
'admin.packingTemplates.createError': '建立模板失敗',
'admin.packingTemplates.deleteError': '刪除模板失敗',
+ 'admin.packingTemplates.deleteCategoryError': '刪除分類失敗',
+ 'admin.packingTemplates.deleteItemError': '刪除項目失敗',
'admin.packingTemplates.saveError': '儲存失敗',
'admin.tabs.addons': '擴充套件',
'admin.tabs.plugins': '外掛',
diff --git a/shared/src/i18n/zh-TW/collab.ts b/shared/src/i18n/zh-TW/collab.ts
index 782855444..7ac828658 100644
--- a/shared/src/i18n/zh-TW/collab.ts
+++ b/shared/src/i18n/zh-TW/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': '開始記錄想法和計劃',
'collab.notes.all': '全部',
'collab.notes.titlePlaceholder': '筆記標題',
+ 'collab.notes.content': '內容',
+ 'collab.notes.removeFile': '移除 {name}',
'collab.notes.contentPlaceholder': '寫點什麼...',
'collab.notes.categoryPlaceholder': '分類',
'collab.notes.newCategory': '新建分類...',
diff --git a/shared/src/i18n/zh-TW/collection.ts b/shared/src/i18n/zh-TW/collection.ts
index 9e6c03ab8..6d49f4d4c 100644
--- a/shared/src/i18n/zh-TW/collection.ts
+++ b/shared/src/i18n/zh-TW/collection.ts
@@ -80,6 +80,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': '複製到行程',
'collections.copyN': '將 {count} 個複製到行程',
'collections.copyToTripSearch': '搜尋行程',
+ 'collections.searchLists': '搜尋清單',
'collections.copyToTripConfirm': '複製',
'collections.noTrips': '尚無行程',
'collections.alreadyInTrip': '已在此行程中',
diff --git a/shared/src/i18n/zh-TW/common.ts b/shared/src/i18n/zh-TW/common.ts
index ffd1bb19a..d3349ffef 100644
--- a/shared/src/i18n/zh-TW/common.ts
+++ b/shared/src/i18n/zh-TW/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': '全選',
'common.deselectAll': '取消全選',
'common.error': '錯誤',
+ 'common.success': '成功',
'common.unknownError': '未知錯誤',
'common.tooManyAttempts': '嘗試次數過多,請稍後再試。',
'common.back': '返回',
diff --git a/shared/src/i18n/zh-TW/places.ts b/shared/src/i18n/zh-TW/places.ts
index 78ed2a239..15645fedb 100644
--- a/shared/src/i18n/zh-TW/places.ts
+++ b/shared/src/i18n/zh-TW/places.ts
@@ -66,6 +66,7 @@ const places: TranslationStrings = {
'places.formLng': '經度(如 2.3522)',
'places.formCategory': '分類',
'places.noCategory': '無分類',
+ 'places.newCategory': '新增分類',
'places.categoryNamePlaceholder': '分類名稱',
'places.formTime': '時間',
'places.startTime': '開始',
@@ -93,5 +94,6 @@ const places: TranslationStrings = {
'places.changeImage': '變更圖片',
'places.removeImage': '移除圖片',
'places.imageUploadError': '無法上傳圖片',
+ 'places.imageRemoveError': '無法刪除圖片',
};
export default places;
diff --git a/shared/src/i18n/zh-TW/settings.ts b/shared/src/i18n/zh-TW/settings.ts
index 0dbc09fc5..c13198a4e 100644
--- a/shared/src/i18n/zh-TW/settings.ts
+++ b/shared/src/i18n/zh-TW/settings.ts
@@ -280,6 +280,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': '頭像已更新',
'settings.avatarRemoved': '頭像已移除',
'settings.avatarError': '上傳失敗',
+ 'settings.avatarRemoveError': '刪除失敗',
'settings.bookingLabels': '預訂路線標籤',
'settings.bookingLabelsHint': '在地圖上顯示車站 / 機場名稱。關閉時僅顯示圖示。',
'settings.currency': '顯示貨幣',
diff --git a/shared/src/i18n/zh-TW/undo.ts b/shared/src/i18n/zh-TW/undo.ts
index 5847176d5..261997c0e 100644
--- a/shared/src/i18n/zh-TW/undo.ts
+++ b/shared/src/i18n/zh-TW/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': '地點鎖定已切換',
'undo.importGpx': 'GPX 匯入',
'undo.importKeyholeMarkup': 'KMZ/KML 匯入',
+ 'undo.importFiles': '檔案匯入',
'undo.importGoogleList': 'Google 地圖匯入',
'undo.importNaverList': 'Naver 地圖匯入',
'undo.addPlace': '地點已新增',
diff --git a/shared/src/i18n/zh/admin.ts b/shared/src/i18n/zh/admin.ts
index 25e25bcc5..a883a17cc 100644
--- a/shared/src/i18n/zh/admin.ts
+++ b/shared/src/i18n/zh/admin.ts
@@ -153,6 +153,8 @@ const admin: TranslationStrings = {
'admin.packingTemplates.loadError': '加载模板失败',
'admin.packingTemplates.createError': '创建模板失败',
'admin.packingTemplates.deleteError': '删除模板失败',
+ 'admin.packingTemplates.deleteCategoryError': '删除分类失败',
+ 'admin.packingTemplates.deleteItemError': '删除项目失败',
'admin.packingTemplates.saveError': '保存失败',
'admin.tabs.addons': '扩展',
'admin.tabs.plugins': '插件',
diff --git a/shared/src/i18n/zh/collab.ts b/shared/src/i18n/zh/collab.ts
index 25a3e93c4..7d1fb3d2c 100644
--- a/shared/src/i18n/zh/collab.ts
+++ b/shared/src/i18n/zh/collab.ts
@@ -37,6 +37,8 @@ const collab: TranslationStrings = {
'collab.notes.emptyHint': '开始记录想法和计划',
'collab.notes.all': '全部',
'collab.notes.titlePlaceholder': '笔记标题',
+ 'collab.notes.content': '内容',
+ 'collab.notes.removeFile': '移除 {name}',
'collab.notes.contentPlaceholder': '写点什么...',
'collab.notes.categoryPlaceholder': '分类',
'collab.notes.newCategory': '新建分类...',
diff --git a/shared/src/i18n/zh/collection.ts b/shared/src/i18n/zh/collection.ts
index 82a815195..62e36bcec 100644
--- a/shared/src/i18n/zh/collection.ts
+++ b/shared/src/i18n/zh/collection.ts
@@ -80,6 +80,7 @@ const collection: TranslationStrings = {
'collections.copyToTripTitle': '复制到行程',
'collections.copyN': '将 {count} 个复制到行程',
'collections.copyToTripSearch': '搜索行程',
+ 'collections.searchLists': '搜索清单',
'collections.copyToTripConfirm': '复制',
'collections.noTrips': '还没有行程',
'collections.alreadyInTrip': '已在此行程中',
diff --git a/shared/src/i18n/zh/common.ts b/shared/src/i18n/zh/common.ts
index 54bc708b9..bbe871a2c 100644
--- a/shared/src/i18n/zh/common.ts
+++ b/shared/src/i18n/zh/common.ts
@@ -16,6 +16,7 @@ const common: TranslationStrings = {
'common.selectAll': '全选',
'common.deselectAll': '取消全选',
'common.error': '错误',
+ 'common.success': '成功',
'common.unknownError': '未知错误',
'common.tooManyAttempts': '尝试次数过多,请稍后再试。',
'common.back': '返回',
diff --git a/shared/src/i18n/zh/places.ts b/shared/src/i18n/zh/places.ts
index dede32522..a09e679ef 100644
--- a/shared/src/i18n/zh/places.ts
+++ b/shared/src/i18n/zh/places.ts
@@ -66,6 +66,7 @@ const places: TranslationStrings = {
'places.formLng': '经度(如 2.3522)',
'places.formCategory': '分类',
'places.noCategory': '无分类',
+ 'places.newCategory': '新建分类',
'places.categoryNamePlaceholder': '分类名称',
'places.formTime': '时间',
'places.startTime': '开始',
@@ -93,5 +94,6 @@ const places: TranslationStrings = {
'places.changeImage': '更换图片',
'places.removeImage': '移除图片',
'places.imageUploadError': '无法上传图片',
+ 'places.imageRemoveError': '无法删除图片',
};
export default places;
diff --git a/shared/src/i18n/zh/settings.ts b/shared/src/i18n/zh/settings.ts
index 207165a81..12a3c9e1e 100644
--- a/shared/src/i18n/zh/settings.ts
+++ b/shared/src/i18n/zh/settings.ts
@@ -245,6 +245,7 @@ const settings: TranslationStrings = {
'settings.avatarUploaded': '头像已更新',
'settings.avatarRemoved': '头像已移除',
'settings.avatarError': '上传失败',
+ 'settings.avatarRemoveError': '删除失败',
'settings.bookingLabels': '预订路线标签',
'settings.bookingLabelsHint': '在地图上显示车站 / 机场名称。关闭时仅显示图标。',
'settings.notifyVersionAvailable': '有新版本可用',
diff --git a/shared/src/i18n/zh/undo.ts b/shared/src/i18n/zh/undo.ts
index c7683de23..a99444e69 100644
--- a/shared/src/i18n/zh/undo.ts
+++ b/shared/src/i18n/zh/undo.ts
@@ -14,6 +14,7 @@ const undo: TranslationStrings = {
'undo.lock': '地点锁定已切换',
'undo.importGpx': 'GPX 导入',
'undo.importKeyholeMarkup': 'KMZ/KML 导入',
+ 'undo.importFiles': '文件导入',
'undo.importGoogleList': 'Google 地图导入',
'undo.importNaverList': 'Naver 地图导入',
'undo.addPlace': '地点已添加',