@brokenrubik/app-shell
v0.2.1
Published
BrokenRubik app shell: the App Rail that links the BR apps, its app catalog and design tokens (BR Admin Library).
Readme
@brokenrubik/app-shell
The App Rail shared by every BrokenRubik app, from Seba's BR Admin Library in Figma: the
app catalog (ids, names, URLs, app-* colors, glyphs, rail order), <AppRail> in plain React +
CSS (no Next, no Tailwind), its per-person settings, and the helpers that reuse one tab per app.
The rail is the same in every app: Proma, Harvest, DocuBuilder, Folio and, below the divider, Twenty. Each person can hide entries and add shortcuts of their own from the "+" tile; that choice applies in every BR app of the browser. Why: ADR-002.
Install
pnpm add @brokenrubik/app-shell # npm install @brokenrubik/app-shellFrom npm, like @brokenrubik/ui: no token, no git. Coming from 0.1 (git tags, rail settings in
each app): docs/migrating-to-0.2.md.
Use
import { AppRail, claimAppWindow } from '@brokenrubik/app-shell';
import '@brokenrubik/app-shell/styles.css';
useEffect(() => claimAppWindow('timma'), []); // once, at boot
<AppRail
current="timma"
locale={locale} // en, es, pt (es-AR…); the rail's own text
currentHref="/"
onCurrentClick={goHome} // optional client-side navigation
collapsed={sidebarCollapsed}
nav={collapsedNav}
footer={collapsedFooter}
/>;That is the whole integration: no list of apps, no URLs, no settings page. The current app shows
first and highlighted, even if it is not in the rail yet (Timma, Mara). customizable={false}
hides the "+".
The rail uses the host's shadcn-style tokens (--sidebar, --sidebar-foreground,
--sidebar-border, --highlight, --app-<id>; the settings modal --popover, --border,
--primary…) with the library's values as fallbacks. Guests never get a rail: that is the app's
call (don't render it). Hiding a tile is not access control.
Preferences (hidden apps, shortcuts) live in the br-rail cookie on cloud.brokenrubik.dev,
readable by every BR app under that domain. Per browser; elsewhere (localhost) the cookie is the
host's own. Up to 12 shortcuts.
Develop
pnpm install
pnpm check # types, tests, build, pnpm audit --prod --audit-level=highdist/ is not committed. Changing the rail (adding, swapping or removing an app) = an edit to
src/catalog.ts (glyph in src/assets/) + a MINOR release.
Release
- Add the version's section to
CHANGELOG.mdand bumpversioninpackage.json. pnpm check, commit,git push origin main, thengit tag -a vX.Y.Z -m "app-shell vX.Y.Z"andgit push origin vX.Y.Z.
The tag runs the Release workflow: checks, npm publish (trusted publishing) and the GitHub
release with the CHANGELOG section as notes.
- Approve the publish on npmjs.com. The trusted publisher has stage publish permission:
the workflow runs
npm stage publish, and the version waits (npm shows a0.0.0-stageplaceholder) until someone with 2FA approves it on the package's page. Only then isX.Y.Zinstallable andlatest. The GitHub release is already there.
Push the tag in its own git push after the commit is on main: a tag pushed together with the
commit that changes a workflow may not trigger it (it happened with v0.2.0). Never npm publish
by hand (only 0.2.0 was, to create the package). Apps on ^0.x take the new version on their
next install.
