Remove numeric positions from project responses (#61771)

## What changed

Remove `position` from app-server `Project` responses, the thread-store project model, and generated schemas and SDK types.

Document that clients should use the returned project order and that `beforeProjectId` places a moved project before another project, or appends it when omitted or null.

GitOrigin-RevId: 5de481e13f524c03260b7fed5c74874f051d6f30
This commit is contained in:
Anton Panasenko
2026-11-16 08:47:49 +00:00
committed by copyberry
parent 98e1584a08
commit 75fc67e8f4
10 changed files with 3 additions and 17 deletions
@@ -19397,10 +19397,6 @@
"name": {
"type": "string"
},
"position": {
"format": "int64",
"type": "integer"
},
"recencyAt": {
"description": "Newest non-archived member thread's recency, in Unix seconds; null when none exist.",
"format": "int64",
@@ -19425,7 +19421,6 @@
"id",
"metadata",
"name",
"position",
"roots",
"updatedAt"
],
@@ -15351,10 +15351,6 @@
"name": {
"type": "string"
},
"position": {
"format": "int64",
"type": "integer"
},
"recencyAt": {
"description": "Newest non-archived member thread's recency, in Unix seconds; null when none exist.",
"format": "int64",
@@ -15379,7 +15375,6 @@
"id",
"metadata",
"name",
"position",
"roots",
"updatedAt"
],
@@ -3,7 +3,7 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { ProjectRoot } from "./ProjectRoot";
export type Project = { id: string, name: string, roots: Array<ProjectRoot>, metadata: { [key in string]?: string }, position: number, createdAt: number, updatedAt: number,
export type Project = { id: string, name: string, roots: Array<ProjectRoot>, metadata: { [key in string]?: string }, createdAt: number, updatedAt: number,
/**
* Newest non-archived member thread's recency, in Unix seconds; null when none exist.
*/
@@ -25,8 +25,6 @@ pub struct Project {
pub roots: Vec<ProjectRoot>,
pub metadata: BTreeMap<String, String>,
#[ts(type = "number")]
pub position: i64,
#[ts(type = "number")]
pub created_at: i64,
#[ts(type = "number")]
pub updated_at: i64,
@@ -52,6 +50,7 @@ pub struct ProjectListParams {
#[ts(optional = nullable)]
pub limit: Option<u32>,
/// Defaults to position. Recency sorting always places empty projects last.
/// Use the returned order; numeric positions are not exposed in project responses.
#[ts(optional = nullable)]
pub sort_key: Option<ProjectSortKey>,
/// Requires sortKey. Defaults to asc for position and desc for recencyAt.
@@ -144,6 +143,7 @@ pub struct ProjectUpdateResponse {
#[ts(export_to = "v2/")]
pub struct ProjectMoveParams {
pub project_id: String,
/// Place the project before this ID, or append it when omitted or null.
#[ts(optional = nullable)]
pub before_project_id: Option<String>,
}
@@ -377,7 +377,6 @@ fn api_project(project: StoredProject) -> Result<Project, JSONRPCErrorError> {
})
.collect::<Result<_, JSONRPCErrorError>>()?,
metadata: project.metadata,
position: project.position,
created_at: project.created_at_ms / 1000,
updated_at: project.updated_at_ms / 1000,
recency_at: project
@@ -184,7 +184,6 @@ fn stored_project(project: codex_state::Project) -> StoredProject {
.map(|root| StoredProjectRoot { path: root.path })
.collect(),
metadata: project.metadata,
position: project.position,
created_at_ms: project.created_at_ms,
updated_at_ms: project.updated_at_ms,
recency_at_ms: project.recency_at_ms,
-1
View File
@@ -13,7 +13,6 @@ pub struct StoredProject {
pub name: String,
pub roots: Vec<StoredProjectRoot>,
pub metadata: BTreeMap<String, String>,
pub position: i64,
pub created_at_ms: i64,
pub updated_at_ms: i64,
pub recency_at_ms: Option<i64>,
@@ -9978,7 +9978,6 @@ class Project(BaseModel):
id: str
metadata: dict[str, str]
name: str
position: int
recency_at: Annotated[
int | None,
Field(