ReviewOS

also looking at this

loghqorg/loghq

A read-scoped project key, so a Stacks dashboard can read logs without a person's credentials

#15
Merged glennmichael123 wants to merge feat/read-scoped-project-key into main
9 files +537 -17
tests/unit/button-vocabulary.test.tsmodified+7-2
Changes to tests/unit/button-vocabulary.test.ts
@@ -151,6 +151,11 @@ describe('settings button vocabulary', () => {
151151describe('settings Button adoption', () => {
152152 const SITES = [
153153 { paint: 'btn-danger btn-sm', name: 'Rotate', bindings: ['loading'] },
154 // The read key's pair (#14). Issue doubles as Replace once a key exists, so
155 // its label is reactive — through `:label`, never `:text`, which writes
156 // textContent and would erase the spinner this file exists to protect.
157 { paint: 'btn-quiet btn-sm', name: 'Issue key', bindings: ['loading', 'label'] },
158 { paint: 'btn-danger btn-sm', name: 'Revoke', bindings: ['loading'] },
154159 { paint: 'btn-cta btn-solid', name: 'Invite', bindings: ['loading'] },
155160 { paint: 'btn-cta btn-solid', name: 'Add channel', bindings: ['loading'] },
156161 { paint: 'flex-none whitespace-nowrap btn-cta btn-danger', name: '', bindings: ['loading'] },
@@ -167,7 +172,7 @@ describe('settings Button adoption', () => {
167172 // </Button>, swallowing half the file. Strip comments before matching markup.
168173 const calls = markup.match(/<Button\b[\s\S]*?<\/Button>/g) ?? []
169174
170 test('there are exactly five, and none of them re-states a paint', () => {
175 test('there are exactly as many as are registered, and none re-states a paint', () => {
171176 expect(calls).toHaveLength(SITES.length)
172177 for (const [i, call] of calls.entries()) {
173178 expect(/className="([^"]*)"/.exec(call)?.[1]).toBe(SITES[i].paint)
@@ -183,7 +188,7 @@ describe('settings Button adoption', () => {
183188 for (const [i, call] of calls.entries()) {
184189 const dependencies = new Set<string>()
185190 const html = await processComponents(call, {
186 __stx_client_signal_names: ['rotating', 'inviting', 'adding', 'archiving', 'modalBusy', 'modalReady', 'modalConfirmLabel'],
191 __stx_client_signal_names: ['rotating', 'inviting', 'adding', 'archiving', 'modalBusy', 'modalReady', 'modalConfirmLabel', 'readKeyBusy', 'hasReadKey'],
187192 __importedComponents: new Map([['button', resolve(ROOT, 'node_modules/@stacksjs/components/src/ui/button/Button.stx')]]),
188193 }, FILE, { componentsDir: resolve(ROOT, 'resources/components') }, dependencies)
189194