@justai/cuts 0.67.0 → 0.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Toolbar.astro +33 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justai/cuts",
3
- "version": "0.67.0",
3
+ "version": "0.68.0",
4
4
  "description": "A persona's named parts \u2014 the page shell that holds them, and the cuts themselves.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
package/src/Toolbar.astro CHANGED
@@ -50,13 +50,33 @@ interface Props {
50
50
  // destination, and justai.pro is above it (sending the parent "home" to a child platform is
51
51
  // the wrong direction). Every other persona keeps it.
52
52
  home?: boolean;
53
+ // What the title strip says when the Kernel or the Posts cut is the one at the toolbar line.
54
+ //
55
+ // OMIT THEM AND NOTHING MOVES: the strip keeps naming the persona and its handle, which is right
56
+ // almost everywhere. On a leaf the kernel IS the persona — the strip reading "QR Code" while you
57
+ // use qr replaces the profile header that scrolled away, and "App" would be strictly less.
58
+ //
59
+ // app.zone is the exception the pair exists for, and the reason is structural rather than a matter
60
+ // of taste: it is the one persona whose kernel is NOT itself. Its kernel is a catalogue of the
61
+ // others, and its profile header — a few pixels above — already says app.zone. So the strip spends
62
+ // its only line repeating what the visitor can see. There it says "Apps" and "Posts" instead.
63
+ //
64
+ // BOTH OR NEITHER, deliberately. Half an override would need this file to reproduce the other
65
+ // half's default, which means copying core's `.pname` / `.handle` selectors into a second place
66
+ // that nothing keeps in step. The strip is one line and its vocabulary should be one kind of
67
+ // thing — names or sections, not one of each — so the API says so out loud.
68
+ kernelTitle?: string;
69
+ postsTitle?: string;
53
70
  }
54
71
  import BackToZone from "./BackToZone.astro";
55
- const { sectionsLabel, profileLabel, kernelLabel, postsLabel, home = true, files = true, filesLabel = "Files" } = Astro.props;
72
+ const { sectionsLabel, profileLabel, kernelLabel, postsLabel, home = true, files = true, filesLabel = "Files", kernelTitle, postsTitle } = Astro.props;
56
73
  import AuthMount from "./AuthMount.astro";
57
74
  ---
58
75
 
59
- <header class="toolbar">
76
+ <!-- The two titles reach the script as data attributes rather than through `define:vars`, which would
77
+ make this script inline and it has an import. Astro drops an attribute whose value is undefined,
78
+ so a persona that passes neither leaves no trace in the markup at all. -->
79
+ <header class="toolbar" data-kernel-title={kernelTitle} data-posts-title={postsTitle}>
60
80
  <div class="tb-row">
61
81
  <div class="tb-left">
62
82
  {home && <BackToZone />}
@@ -216,5 +236,15 @@ import AuthMount from "./AuthMount.astro";
216
236
  // The defaults ARE this cut's contract — the three cut ids, `nav<Cut>`, `#tbTitle`/`#tbTitleText`,
217
237
  // `.toolbar`, `#below` — so a persona using the shell passes nothing at all.
218
238
  import { personaScroll } from "@justai/core";
219
- personaScroll();
239
+ // Both or neither — see the props above. When both are set the strip names the SECTIONS; core's
240
+ // default, which names the persona and its handle, is left entirely alone otherwise. Nothing here
241
+ // reproduces that default, which is the point: `.pname` and `.handle` stay core's business.
242
+ const bar = document.querySelector(".toolbar") as HTMLElement | null;
243
+ const kt = bar?.dataset.kernelTitle;
244
+ const pt = bar?.dataset.postsTitle;
245
+ personaScroll(
246
+ kt && pt
247
+ ? { titleFor: (id: string) => (id === "kernel" ? kt : id === "posts" ? pt : "") }
248
+ : undefined,
249
+ );
220
250
  </script>