feat(desktop): tag each sidebar project row with data-sessions-project
The merged data-attributes only exposed data-sessions-project on the sessions wrapper once a project was entered, so in the project overview (and every other mode) the attribute was absent. Put it on each project overview row too, carrying that row's project id, so a custom skin can target an individual project from the list — the parallel to the entered wrapper's attribute.
This commit is contained in:
committed by
brooklyn!
parent
d8d7cc068d
commit
c7a243d785
@@ -86,4 +86,10 @@ describe('ProjectOverviewRow', () => {
|
||||
|
||||
expect(onNewSession).toHaveBeenCalledWith(null)
|
||||
})
|
||||
|
||||
it('tags the row with data-sessions-project so a skin can target one project', () => {
|
||||
const { container } = render(<ProjectOverviewRow project={project} />)
|
||||
|
||||
expect(container.querySelector('[data-sessions-project="p1"]')).toBeTruthy()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -158,7 +158,11 @@ export function ProjectOverviewRow({
|
||||
)
|
||||
|
||||
return (
|
||||
<div className={cn(dragging && 'relative z-10')} ref={ref} style={style}>
|
||||
// Tag each project sibling with its id so a custom skin can target one
|
||||
// project in the overview — the parallel to the entered-project wrapper's
|
||||
// `data-sessions-project` (index.tsx), which only fires once you've drilled
|
||||
// in. Here it's present on every row of the list.
|
||||
<div className={cn(dragging && 'relative z-10')} data-sessions-project={project.id} ref={ref} style={style}>
|
||||
{/* Home has no per-project actions, so it gets no right-click menu. */}
|
||||
{project.isNoProject ? (
|
||||
shell
|
||||
|
||||
Reference in New Issue
Block a user