MemberJunction / MemberJunction/MJ
Records region: new-record tabs open pinned and therefore have no close button
- Dominant language
- TSQL
- Stars
- 29
- Forks
- 6
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 323
Description
## What
Under the records style, a **new (unsaved) record opens pinned** (#4154):
```ts
// NavigationService, new-record path
IsPinned: options?.pinTab || tabsMode,
```
Pinned tabs have no close button:
```css
/* packages/Angular/Explorer/explorer-core/src/lib/shell/components/tabs/tab-container.component.css */
/* Pinned tabs never show close button (the pin control replaces it) */
mj-tab-container .lm_header .lm_tab.pinned .lm_close_tab { display: none !important; }
```
So creating a record and then abandoning it takes two steps — click the thumbtack to unpin, *then* close — and the close affordance is simply absent until the user works out what the thumbtack does. #4154 flags this explicitly as a UX call worth revisiting.
## Why the pin may be redundant
The stated purpose of pinning is to keep unsaved work out of the replacement pool. The edit-mode guard already does that:
`BaseFormComponent.ngOnInit` starts edit mode for any unsaved record —
```ts
if (this.record) {
if (!this.record.IsSaved) {
this.StartEditMode();
}
```
— so `IsEditing()` is already `true` for a new record, and `RecordsRegionTabFilter` already excludes it.
## The residual value of the pin
There is a genuine window: `IsEditing()` reads through `@ViewChild(SingleRecordComponent)` → `@ViewChild(MjEntityFormHostComponent)` → `Form.EditMode`. Between the tab opening and those view children resolving, `IsEditing()` returns `false` and the tab is briefly in the pool. Pinning closes that window deterministically.
So this is a real trade-off, not a mistake: a short pre-init race against a permanently missing close affordance on every new-record tab.
## Options
1. Leave unpinned and rely on the edit guard, accepting the race.
2. Keep the pin but show the close button on pinned tabs (or on pinned *new-record* tabs specifically).
3. Keep as-is and document the unpin-then-close gesture.
Found while reviewing #4154. Behavior is as designed and disclosed; this is the revisit the PR invites.
Contributor guide
Assessment
This issue has not been assessed yet.