@@ -14,6 +14,7 @@ import {
1414 EntityTypeIcon ,
1515 LinkTypeIcon ,
1616} from "@hashintel/design-system" ;
17+ import { TextMark } from "@hashintel/ds-components" ;
1718import { useEntityTypeFormContext } from "@hashintel/type-editor" ;
1819
1920import { EditEmojiIconButton } from "../../../../shared/edit-emoji-icon-button" ;
@@ -105,9 +106,10 @@ export const EntityTypeHeader = ({
105106 direction = "row"
106107 alignItems = "center"
107108 justifyContent = "space-between"
109+ mb = { 3 }
108110 >
109- < Stack direction = "row" alignItems = "center" gap = { 5 } >
110- < Stack direction = "row" alignItems = "flex-start" mt = { 1 } mb = { 3 } >
111+ < Stack direction = "row" alignItems = "center" gap = { 5 } minWidth = { 0 } >
112+ < Stack direction = "row" alignItems = "flex-start" mt = { 1 } minWidth = { 0 } >
111113 { entityTypeNameSize !== null && (
112114 < Controller
113115 control = { control }
@@ -158,14 +160,14 @@ export const EntityTypeHeader = ({
158160 }
159161 sx = { {
160162 position : "relative" ,
161- top : entityTypeNameSize . lineHeight / 2 - 22 ,
163+ top : entityTypeNameSize . lineHeight / 2 - 25 ,
162164 } }
163165 />
164166 ) ;
165167 } }
166168 />
167169 ) }
168- < Box sx = { { position : "relative" , ml : 2.5 } } >
170+ < Box sx = { { ml : 2.5 , minWidth : 0 } } >
169171 < Tooltip
170172 placement = "top-start"
171173 componentsProps = { {
@@ -195,39 +197,37 @@ export const EntityTypeHeader = ({
195197 variant = "h1"
196198 fontWeight = "bold"
197199 ref = { entityTypeNameTextRef }
198- sx = { {
199- lineHeight : 1.2 ,
200- } }
200+ sx = { { overflow : "hidden" , textOverflow : "ellipsis" } }
201201 >
202202 { entityTypeSchema . title }
203+ { isInSlide && (
204+ < TextMark >
205+ < Link
206+ href = {
207+ generateLinkParameters ( entityTypeSchema . $id ) . href
208+ }
209+ sx = { { ml : 2.5 } }
210+ target = "_blank"
211+ >
212+ < ArrowUpRightFromSquareRegularIcon
213+ sx = { {
214+ fill : ( { palette } ) => palette . blue [ 50 ] ,
215+ fontSize : 24 ,
216+ verticalAlign : "middle" ,
217+ // Nudge the icon up slightly relative to the
218+ // text, without affecting line-box layout
219+ position : "relative" ,
220+ top : - 8 ,
221+ "&:hover" : {
222+ fill : ( { palette } ) => palette . blue [ 60 ] ,
223+ } ,
224+ } }
225+ />
226+ </ Link >
227+ </ TextMark >
228+ ) }
203229 </ Typography >
204230 </ Tooltip >
205- { isInSlide && entityTypeNameSize !== null && (
206- < Link
207- href = { generateLinkParameters ( entityTypeSchema . $id ) . href }
208- sx = { {
209- position : "absolute" ,
210- left : entityTypeNameSize . lastLineWidth + 20 ,
211- /**
212- * The vertical center of the text plus offset half the icon size
213- */
214- top :
215- entityTypeNameSize . lastLineTop +
216- ( entityTypeNameSize . lineHeight / 2 - 12 ) ,
217- } }
218- target = "_blank"
219- >
220- < ArrowUpRightFromSquareRegularIcon
221- sx = { {
222- fill : ( { palette } ) => palette . blue [ 50 ] ,
223- fontSize : 24 ,
224- "&:hover" : {
225- fill : ( { palette } ) => palette . blue [ 70 ] ,
226- } ,
227- } }
228- />
229- </ Link >
230- ) }
231231 </ Box >
232232 </ Stack >
233233 < Stack
@@ -236,7 +236,7 @@ export const EntityTypeHeader = ({
236236 gap = { 1.5 }
237237 sx = { { position : "relative" , top : 5 } }
238238 >
239- < EntityTypePlural isLinkType = { isLink } readonly = { isReadonly } />
239+ < EntityTypePlural readonly = { isReadonly } />
240240 { isLink && < EntityTypeInverse readonly = { isReadonly } /> }
241241 </ Stack >
242242 </ Stack >
@@ -245,6 +245,8 @@ export const EntityTypeHeader = ({
245245 onClick = { ( ) => setShowExtendTypeModal ( true ) }
246246 variant = "secondary"
247247 size = "small"
248+ // Don't let the button get squeezed by long header content
249+ sx = { { flexShrink : 0 , ml : 2 } }
248250 >
249251 Extend < ArrowUpRightIcon sx = { { fontSize : 16 , ml : 1.5 } } />
250252 </ Button >
0 commit comments