Skip to content

feat(design): the portal's parts - #853

Closed
mortondev wants to merge 1 commit into
feat/portal-design-v2-phase4-own-wordingfrom
feat/portal-design-v2-phase5-parts
Closed

mortondev wants to merge 1 commit into
feat/portal-design-v2-phase4-own-wordingfrom
feat/portal-design-v2-phase5-parts

Conversation

@mortondev

@mortondev mortondev commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

The twentieth of the stack that builds a new design engine for the portal, and the first of phase 5. A workspace's own CSS can style the portal by part name, [data-qb-part="post-card"], rather than by class names that change with the code. Behind the portalDesignV2 flag; the attributes are inert on their own.

The twelve parts

Part Where States (data-state)
header the bar on every portal page
logo logo or initial and name, linking home
nav-item each page and link in the menu active
band the band behind a headline
headline a page's headline
home-block a block on Home, with data-qb-block naming its type
composer the feed's composer (collapsed and open) and Home's Share an idea open
post-card a post in the feed done
post-title a card's title
vote-button the vote box on a card, on a post and in Home's Top ideas voted
status-badge a post's status
filter-panel the feed's filters beside it

The manifest

lib/shared/design/parts.ts lists each part's description, states, the tokens that style it (the design's existing --qb-* tokens, such as --qb-card-padding and --qb-vote-active) and the files that draw it. PART_ALIASES keeps a renamed part's old name working for at least a minor release; rewritePartAliases() applies them.

The contract

parts.test.ts fails when a listed part disappears from the files that draw it, when a listed state is no longer set, when a component marks a part the manifest does not list, or when a documented token is not one the design declares.

Verification

  • On the local Juniper workspace (Home on), all twelve parts render across /, /feedback and a post, with active on the current menu item, open on a composer being written in and voted where the visitor voted.
  • The contract test checked by removing a part's marker: it fails.
  • The core bench holds every request count and script ceiling. Each card now carries its part names, so the portal home's document grows by about 8 KB uncompressed; doc:portal-home and doc:portal-home+session take their readings (129.4 and 150.7 KB). The other document sweeps hold.

@mortondev
mortondev added this pull request to stack #833 October 31, 2026 05:37
A workspace's CSS can style the portal by part name rather than by class
names that change with the code: [data-qb-part="post-card"].

- Twelve parts are marked: header, logo, nav-item, band, headline,
  home-block, composer, post-card, post-title, vote-button, status-badge
  and filter-panel. States are data-state: active for the current menu
  item, open for a composer being written in, voted for a voted vote box,
  done for a post whose status is complete or closed.
- lib/shared/design/parts.ts lists each part's states, the tokens that style
  it and the files that draw it, with aliases for renamed parts and
  rewritePartAliases, which keeps old names working.
- A contract test keeps every listed part marked where it is drawn, with
  its states, fails on a part the manifest does not list, and checks each
  documented token is one the design declares.

Every card now carries its part names, so the portal home's HTML ceilings
take their new readings.
@mortondev

Copy link
Copy Markdown
Member Author

Condensed into #879. The stack is now five PRs, #878 to #882; this branch is kept as it was.

@mortondev mortondev closed this Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant