fsanyoto commited on
Commit
fe4ab8d
·
verified ·
1 Parent(s): 40a47c8

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,6 +1,12 @@
1
  {
2
- "current": "v43 (e2ba461)",
3
  "releases": [
 
 
 
 
 
 
4
  {
5
  "version": "v43",
6
  "sha": "e2ba461",
 
1
  {
2
+ "current": "v44 (a7877aa)",
3
  "releases": [
4
+ {
5
+ "version": "v44",
6
+ "sha": "a7877aa",
7
+ "date": "2026-08-23",
8
+ "subject": "Hotfix: allow renaming the active Map view"
9
+ },
10
  {
11
  "version": "v43",
12
  "sha": "e2ba461",
VERSION CHANGED
@@ -1 +1 @@
1
- v43 (e2ba461)
 
1
+ v44 (a7877aa)
web/src/customer-grid/CustomerGrid.tsx CHANGED
@@ -4380,15 +4380,15 @@ function CustomerGridSurface({
4380
  const renameView = useCallback(
4381
  (id: string, name: string) => {
4382
  const view = views.find((item) => item.id === id);
4383
- if (view) {
4384
  const acceptedName = uniqueDisplayName(
4385
  name,
4386
  views.filter((item) => item.id !== id).map((item) => item.name)
4387
  );
4388
- persistView({ ...view, name: acceptedName });
4389
  }
4390
  },
4391
- [views, persistView]
4392
  );
4393
  /**
4394
  * I12 (contract C3) — freeze/unfreeze a view's DISPLAY MODE.
@@ -6367,11 +6367,18 @@ function CustomerGridSurface({
6367
  // Item 11c — is the menu's field the current frozen boundary (its Pin would be a no-op)?
6368
  const menuVisIndex = menuField ? visibleKeys.indexOf(menuField.key) : -1;
6369
  const menuPinnedTo = menuVisIndex >= 0 && frozenN > 1 && menuVisIndex + 1 === frozenN;
 
 
 
 
6370
  // Item 10 — the toolbar's mode switcher (grid-only on windowed tables, see displayMode).
6371
  const modeControl = serverWindowed || embedded || isQueryPreview ? undefined : (
6372
  <ModeSwitch
6373
  mode={displayMode}
6374
  onMode={setDisplayMode}
 
 
 
6375
  // I12 (C3) — a locked view's mode is frozen, so the switcher stops being a switcher.
6376
  // The field pickers beside it stay: C3 freezes the MODE, and a kanban's stack field is
6377
  // config, not mode ("filters/sorts/columns stay editable").
 
4380
  const renameView = useCallback(
4381
  (id: string, name: string) => {
4382
  const view = views.find((item) => item.id === id);
4383
+ if (view && mayEditView(view, viewer)) {
4384
  const acceptedName = uniqueDisplayName(
4385
  name,
4386
  views.filter((item) => item.id !== id).map((item) => item.name)
4387
  );
4388
+ if (acceptedName !== view.name) persistView({ ...view, name: acceptedName });
4389
  }
4390
  },
4391
+ [views, persistView, viewer]
4392
  );
4393
  /**
4394
  * I12 (contract C3) — freeze/unfreeze a view's DISPLAY MODE.
 
6367
  // Item 11c — is the menu's field the current frozen boundary (its Pin would be a no-op)?
6368
  const menuVisIndex = menuField ? visibleKeys.indexOf(menuField.key) : -1;
6369
  const menuPinnedTo = menuVisIndex >= 0 && frozenN > 1 && menuVisIndex + 1 === frozenN;
6370
+ const renameActiveView = useCallback(
6371
+ (name: string) => renameView(activeViewId, name),
6372
+ [activeViewId, renameView]
6373
+ );
6374
  // Item 10 — the toolbar's mode switcher (grid-only on windowed tables, see displayMode).
6375
  const modeControl = serverWindowed || embedded || isQueryPreview ? undefined : (
6376
  <ModeSwitch
6377
  mode={displayMode}
6378
  onMode={setDisplayMode}
6379
+ viewName={activeView?.name}
6380
+ canRenameView={!!activeView && mayEditView(activeView, viewer)}
6381
+ onRenameView={renameActiveView}
6382
  // I12 (C3) — a locked view's mode is frozen, so the switcher stops being a switcher.
6383
  // The field pickers beside it stay: C3 freezes the MODE, and a kanban's stack field is
6384
  // config, not mode ("filters/sorts/columns stay editable").
web/src/customer-grid/viewModes.tsx CHANGED
@@ -85,10 +85,49 @@ function IconDayCells() {
85
 
86
  // ------------------------------------------------------------- the switcher
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  export function ModeSwitch({
89
  mode,
90
  onMode,
91
  locked = false,
 
 
 
92
  dateField,
93
  dateChoices,
94
  stackField,
@@ -111,6 +150,11 @@ export function ModeSwitch({
111
  * stay editable"), so removing those too would be a broader lock than the contract grants.
112
  */
113
  locked?: boolean;
 
 
 
 
 
114
  /** The calendar's effective date field (resolved by the caller). */
115
  dateField?: Field;
116
  dateChoices: Field[];
@@ -179,21 +223,23 @@ export function ModeSwitch({
179
  already used by every other popover in this toolbar; `cg-radio-row` is the row). */
180
  <div
181
  className="cg-pop-body"
182
- /* ⛔ W29-T77 — `flexDirection` IS THE WHOLE FIX, and its absence is why the two
183
- groups shipped STACKED. `.cg-pop-body` already declares `display:flex` AND
184
- `flex-direction: column` (index.css:1227); restating `display:flex` inline
185
- overrode nothing, so the class's column default won and the "two columns"
186
- layout rendered as one. Measured on the deployed Space via `getComputedStyle`
187
- — the groups at x=497/y=95 and x=497/y=348, same x.
188
- ⚠ [[wrong-parent-not-broken-control]]: every control inside was correct, and
189
- the membership and labels were correct too. Only the axis was wrong. */
190
- style={{
191
- display: "flex",
192
- flexDirection: "row",
193
- gap: 18,
194
- alignItems: "flex-start",
195
- }}
196
  >
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  {CREATABLE_GROUPS.map((group) => (
198
  <div key={group.label} style={{ minWidth: 130 }}>
199
  <div className="cg-pop-title">{group.label}</div>
@@ -218,6 +264,14 @@ export function ModeSwitch({
218
  ))}
219
  </div>
220
  ))}
 
 
 
 
 
 
 
 
221
  </div>
222
  )}
223
  </Popover>
 
85
 
86
  // ------------------------------------------------------------- the switcher
87
 
88
+ function ViewRenameForm({
89
+ viewName,
90
+ onRename,
91
+ close,
92
+ }: {
93
+ viewName: string;
94
+ onRename: (name: string) => void;
95
+ close: () => void;
96
+ }) {
97
+ const [draft, setDraft] = useState(viewName);
98
+ return (
99
+ <form
100
+ className="cg-mode-rename"
101
+ onSubmit={(event) => {
102
+ event.preventDefault();
103
+ const next = draft.trim();
104
+ if (!next) return;
105
+ onRename(next);
106
+ close();
107
+ }}
108
+ >
109
+ <div className="cg-pop-title">Rename view</div>
110
+ <div className="cg-mode-rename-row">
111
+ <input
112
+ className="cg-input"
113
+ aria-label="View name"
114
+ value={draft}
115
+ onChange={(event) => setDraft(event.target.value)}
116
+ autoFocus
117
+ />
118
+ <button type="submit" className="cg-btn cg-btn--primary">Save</button>
119
+ </div>
120
+ </form>
121
+ );
122
+ }
123
+
124
  export function ModeSwitch({
125
  mode,
126
  onMode,
127
  locked = false,
128
+ viewName,
129
+ canRenameView = false,
130
+ onRenameView,
131
  dateField,
132
  dateChoices,
133
  stackField,
 
150
  * stay editable"), so removing those too would be a broader lock than the contract grants.
151
  */
152
  locked?: boolean;
153
+ /** The current saved view name, used by the rename door in this toolbar control. */
154
+ viewName?: string;
155
+ /** Courtesy gate; the host remains the write authority. */
156
+ canRenameView?: boolean;
157
+ onRenameView?: (name: string) => void;
158
  /** The calendar's effective date field (resolved by the caller). */
159
  dateField?: Field;
160
  dateChoices: Field[];
 
223
  already used by every other popover in this toolbar; `cg-radio-row` is the row). */
224
  <div
225
  className="cg-pop-body"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
226
  >
227
+ <div
228
+ className="cg-mode-options"
229
+ /* ⛔ W29-T77 — `flexDirection` IS THE WHOLE FIX, and its absence is why the two
230
+ groups shipped STACKED. `.cg-pop-body` already declares `display:flex` AND
231
+ `flex-direction: column` (index.css:1227); the nested options row therefore
232
+ needs its own explicit horizontal axis. Measured on the deployed Space with
233
+ `getComputedStyle` — the groups at x=497/y=95 and x=497/y=348, same x.
234
+ ⚠ [[wrong-parent-not-broken-control]]: every control inside was correct, and
235
+ the membership and labels were correct too. Only the axis was wrong. */
236
+ style={{
237
+ display: "flex",
238
+ flexDirection: "row",
239
+ gap: 18,
240
+ alignItems: "flex-start",
241
+ }}
242
+ >
243
  {CREATABLE_GROUPS.map((group) => (
244
  <div key={group.label} style={{ minWidth: 130 }}>
245
  <div className="cg-pop-title">{group.label}</div>
 
264
  ))}
265
  </div>
266
  ))}
267
+ </div>
268
+ {canRenameView && onRenameView && viewName !== undefined && (
269
+ <ViewRenameForm
270
+ viewName={viewName}
271
+ onRename={onRenameView}
272
+ close={close}
273
+ />
274
+ )}
275
  </div>
276
  )}
277
  </Popover>
web/src/index.css CHANGED
@@ -4093,6 +4093,23 @@ body > .cg-overlay {
4093
  wrapper and the per-mode field select remain. */
4094
  .cg-modes { display: inline-flex; align-items: center; gap: 6px; }
4095
  .cg-mode-field { max-width: 150px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4096
  .cg-mode-empty {
4097
  padding: 28px 16px;
4098
  color: #6a6f78;
 
4093
  wrapper and the per-mode field select remain. */
4094
  .cg-modes { display: inline-flex; align-items: center; gap: 6px; }
4095
  .cg-mode-field { max-width: 150px; }
4096
+ .cg-mode-rename {
4097
+ display: flex;
4098
+ flex-direction: column;
4099
+ gap: 6px;
4100
+ margin-top: 8px;
4101
+ padding-top: 8px;
4102
+ border-top: 1px solid var(--lp-line);
4103
+ }
4104
+ .cg-mode-rename .cg-pop-title { padding: 0 8px; }
4105
+ .cg-mode-rename-row {
4106
+ display: flex;
4107
+ align-items: center;
4108
+ gap: 6px;
4109
+ padding: 0 8px 2px;
4110
+ }
4111
+ .cg-mode-rename-row .cg-input { min-width: 0; flex: 1 1 auto; }
4112
+ .cg-mode-rename-row .cg-btn { flex: 0 0 auto; }
4113
  .cg-mode-empty {
4114
  padding: 28px 16px;
4115
  color: #6a6f78;