Skip to content

Commit 2198e85

Browse files
zwickCopilot
andauthored
Add visible fields to project views (#2988)
* Add visible fields to project views Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1421a5d5-fdce-4c0e-9528-56d555ec30d4 * Fail fast and surface orphaned views on project view writes Reject roadmap layouts before enumerating project fields in both the create and update paths, and verify view ownership before resolving visible fields on update, so rejected requests no longer pay for a paginated field listing. Skip the follow-up filter mutation when the filter is explicitly null, since a new view has no filter to clear, and include the created view ID when cleanup after a failed filter mutation also fails so the caller can recover the orphaned view. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1421a5d5-fdce-4c0e-9528-56d555ec30d4
1 parent d6cab97 commit 2198e85

7 files changed

Lines changed: 880 additions & 441 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1141,8 +1141,8 @@ The following sets of tools are available:
11411141
- `title`: The project title. Required for 'create_project' method. (string, optional)
11421142
- `updated_field`: The field/value to apply, using {"id": 123, "value": ...} or {"name": "Status", "value": ...}; null clears the field. Required for 'update_project_item' and 'update_project_items', where one top-level field/value applies to every item in a batch. For 'update_project_item' SINGLE_SELECT fields, the name form accepts option names; the ID form expects an option ID. (object, optional)
11431143
- `view_id`: Project view node ID for update or delete; must belong to owner/project_number. (string, optional)
1144-
- `visible_field_names`: Field names for table or board creation; mutually exclusive with visible_fields. (string[], optional)
1145-
- `visible_fields`: Field database IDs for table or board creation; mutually exclusive with visible_field_names. (string[], optional)
1144+
- `visible_field_names`: Ordered project field names to show on create or replace on update; omit on update to preserve, or pass [] to reset. Mutually exclusive with visible_fields. Roadmap accepts only []. (string[], optional)
1145+
- `visible_fields`: Ordered project field database IDs to show on create or replace on update; omit on update to preserve, or pass [] to reset. Mutually exclusive with visible_field_names. Roadmap accepts only []. (string[], optional)
11461146

11471147
</details>
11481148

pkg/github/__toolsnaps__/projects_write.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@
257257
"type": "string"
258258
},
259259
"visible_field_names": {
260-
"description": "Field names for table or board creation; mutually exclusive with visible_fields.",
260+
"description": "Ordered project field names to show on create or replace on update; omit on update to preserve, or pass [] to reset. Mutually exclusive with visible_fields. Roadmap accepts only [].",
261261
"items": {
262262
"type": "string"
263263
},
264264
"type": "array"
265265
},
266266
"visible_fields": {
267-
"description": "Field database IDs for table or board creation; mutually exclusive with visible_field_names.",
267+
"description": "Ordered project field database IDs to show on create or replace on update; omit on update to preserve, or pass [] to reset. Mutually exclusive with visible_field_names. Roadmap accepts only [].",
268268
"items": {
269269
"type": "string"
270270
},

pkg/github/minimal_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ type MinimalProjectView struct {
439439
Name string `json:"name"`
440440
Layout string `json:"layout"`
441441
Filter string `json:"filter"`
442-
VisibleFields []int64 `json:"visible_fields,omitempty"`
442+
VisibleFields []int64 `json:"visible_fields"`
443443
}
444444

445445
type MinimalProjectItem struct {

0 commit comments

Comments
 (0)