Move open-record-in to object metadata and member preference (#23614)

Replaces the per-view "Open in" setting with a two-level model,
following up on #23422 / #23424 and superseding the closed #23446 and
#23457:

- `objectMetadata.openRecordIn`: `SIDE_PANEL` | `RECORD_PAGE` |
`USER_CHOICE` (default `USER_CHOICE`)
- `workspaceMember.openRecordIn`: `SIDE_PANEL` | `RECORD_PAGE` (default
`SIDE_PANEL`), editable in Settings > Experience

The rule: records open where the member prefers, unless the object pins
them, and never in a panel there is no room for (mobile always resolves
to the record page).

## Why

Having the setting on views, objects and members at once was heavy, and
view-level resolution was fragile: a chip rendered outside a view
(notes, front components, kanban cards pointing at another object) had
no view to read from, which is the class of bug behind #23422.
Resolution is now context-free: it needs only the object, the current
member and the viewport, so chips behave identically everywhere by
construction.

## Changes

**Object level**
- New `openRecordIn` enum column on `objectMetadata`, editable through
`updateOneObject` and surfaced in Settings > Data model > Object >
Layout ("Open records in": Member preference / Side Panel / Record Page)
- Standard definitions pin `workflow`, `workflowVersion`, `dashboard`
and `messageCampaign` to the record page (matching the previously
hardcoded list) and `calendarEvent` to the side panel (it has no curated
record page); everything else, including `workflowRun`, follows the
member preference
- Apps can set it in `defineObject()` via the object manifest

**Member level**
- New `openRecordIn` standard field on `workspaceMember`, persisted
through the existing settings path (same as `colorScheme`) and exposed
in Settings > Experience

**View level (deprecated)**
- `view.openRecordIn` is no longer read or written by the frontend; the
"Open in" entry is gone from the view options dropdown
- The column, DTO field and inputs are kept for one release for API
compatibility: the output field carries a `deprecationReason`, the
inputs keep accepting the value with a `Deprecated:` description (NestJS
silently drops input fields that have a `deprecationReason`, which would
have been a breaking change)

**Upgrade (2.27)**
- Fast instance command adds the `objectMetadata.openRecordIn` column
defaulting to `USER_CHOICE`
- Workspace command adds the `workspaceMember.openRecordIn` field
- Workspace command seeds the object column from the standard
definitions (any non-`USER_CHOICE` value), then lifts deliberate
per-view record page choices onto objects the definitions don't pin

**Debt removed**
- `canOpenObjectInSidePanel` hardcoded object list and its test
- `ObjectOptionsDropdownLayoutOpenInContent` and the `layoutOpenIn`
dropdown wiring
- `DefaultViewOpenRecordIn`
- Context-store/view-based resolution in `useResolveOpenRecordIn` (now
reads object metadata + member + viewport)
- Front components no longer guess from the current view: an explicit
side-panel call honours a pinned object and the viewport, nothing else

## Verification

- Ran the three upgrade commands against a live database: column
created, the pinned standard objects seeded per workspace (record page
pins plus calendarEvent to side panel), member field backfilled to
`SIDE_PANEL`; seed rerun is a no-op
- Seed command verified on a simulated pre-upgrade workspace (index view
set to record page on company): pins the standard objects plus company,
idempotent on rerun
- Both packages typecheck and lint clean; affected unit suites and the
application sync, view creation and metadata cache integration specs
pass

---------

Co-authored-by: Thomas des Francs <tdesfrancs@gmail.com>
This commit is contained in:
Félix Malfait
2026-07-31 18:28:55 +02:00
committed by GitHub
parent 6f361a9bf2
commit f663cd3c68
116 changed files with 2395 additions and 1544 deletions
@@ -8,7 +8,7 @@
align-items: flex-end;
justify-content: flex-end;
box-sizing: border-box;
width: 160px;
width: 100%;
height: 80px;
padding-top: var(--t-spacing-6);
padding-left: var(--t-spacing-6);
@@ -47,7 +47,7 @@
.mixedColorSchemeSegment {
position: relative;
display: flex;
width: 160px;
width: 100%;
height: 80px;
border-radius: var(--t-border-radius-md);
overflow: hidden;
@@ -60,10 +60,11 @@ export const ColorSchemeCard = ({
variant,
selected,
onClick,
className,
}: ColorSchemeCardProps) => {
if (variant === 'System') {
return (
<div className={styles.container}>
<div className={clsx(styles.container, className)}>
<div
className={styles.mixedColorSchemeSegment}
role={isDefined(onClick) ? 'button' : undefined}
@@ -92,7 +93,7 @@ export const ColorSchemeCard = ({
}
return (
<div className={styles.container}>
<div className={clsx(styles.container, className)}>
<ColorSchemeSegment variant={variant} onClick={onClick} />
<div
className={styles.checkmarkContainer}
@@ -1,6 +1,7 @@
.container {
display: flex;
flex-direction: row;
width: 100%;
> * + * {
margin-left: var(--t-spacing-4);
@@ -8,12 +9,22 @@
@include respond-to(mobile) {
overflow: scroll;
.cardContainer {
flex: 0 0 160px;
}
}
}
.cardContainer {
display: flex;
flex: 1 1 0;
flex-direction: column;
min-width: 0;
}
.card {
width: 100%;
}
.label {
@@ -1,6 +1,7 @@
declare const classNames: {
readonly container: 'container';
readonly cardContainer: 'cardContainer';
readonly card: 'card';
readonly label: 'label';
};
export default classNames;
@@ -26,6 +26,7 @@ export const ColorSchemePicker = ({
<div className={clsx(styles.container, className)}>
<div className={styles.cardContainer}>
<ColorSchemeCard
className={styles.card}
onClick={() => onChange('Light')}
variant="Light"
selected={value === 'Light'}
@@ -34,6 +35,7 @@ export const ColorSchemePicker = ({
</div>
<div className={styles.cardContainer}>
<ColorSchemeCard
className={styles.card}
onClick={() => onChange('Dark')}
variant="Dark"
selected={value === 'Dark'}
@@ -42,6 +44,7 @@ export const ColorSchemePicker = ({
</div>
<div className={styles.cardContainer}>
<ColorSchemeCard
className={styles.card}
onClick={() => onChange('System')}
variant="System"
selected={value === 'System'}