Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,14 @@ export async function minimalNextDevframeHub(
})

// The hub no longer synthesizes built-in docks — a high-level integration
// registers the viewer's native views it wants. `~builtin` views default
// their category to `~builtin`, so this Settings tab sorts last on its own.
// registers the viewer's native views it wants, declaring the `~builtin`
// category itself so this Settings tab groups and sorts last.
context.docks.register({
type: '~builtin',
id: '~settings',
title: 'Settings',
icon: 'ph:gear-duotone',
category: '~builtin',
})

// Demo devframes alongside the dogfooded built-in plugin packages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('minimal-next-devframe-hub (example)', () => {
const dockIds = docks.map(d => d.id)
expect(dockIds).toContain('next-demo-tool')
// The hub synthesizes no built-in docks; the integration registers the
// settings tab itself, and `~builtin` views default to the `~builtin` category.
// settings tab itself, declaring the `~builtin` category explicitly.
expect(dockIds).toContain('~settings')
expect(docks.find(d => d.id === '~settings')?.category).toBe('~builtin')
// The dogfooded built-in plugin packages mount their own docks.
Expand Down
7 changes: 4 additions & 3 deletions packages/hub/src/node/__tests__/host-docks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ describe('devframeDockHost grouping', () => {
})
})

describe('devframeDockHost ~builtin category default', () => {
describe('devframeDockHost ~builtin category', () => {
it('returns no docks until an integration registers one', () => {
const host = new DevframeDocksHost(createContext())
expect(host.values()).toEqual([])
})

it('defaults a ~builtin view without a category to the ~builtin category', () => {
it('preserves a ~builtin view without a category untouched', () => {
const host = new DevframeDocksHost(createContext())
host.register({
type: '~builtin',
Expand All @@ -206,7 +206,8 @@ describe('devframeDockHost ~builtin category default', () => {
})

const entry = host.values()[0]
expect(entry).toMatchObject({ id: '~settings', type: '~builtin', category: '~builtin' })
expect(entry).toMatchObject({ id: '~settings', type: '~builtin' })
expect(entry.category).toBeUndefined()
})

it('preserves an explicit category on a ~builtin view', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export declare class DevframeDocksHost implements DevframeDocksHost$1 {
update: (_: Partial<T>) => void;
};
update(_: DevframeDockUserEntry): void;
private withBuiltinCategory;
private validateGroupMembership;
private prepareRemoteRegistration;
}
Expand Down
1 change: 0 additions & 1 deletion tests/__snapshots__/tsnapi/@devframes/hub/node.snapshot.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class DevframeDocksHost {
resolveDevServerOrigin() {}
register(_, _) {}
update(_) {}
withBuiltinCategory(_) {}
validateGroupMembership(_) {}
prepareRemoteRegistration(_) {}
}
Expand Down
Loading