| 1127 |
1216
|
|
"""
|
| 1128 |
1217
|
|
end
|
| 1129 |
1218
|
|
|
|
1219
|
+ |
defp component_demo(%{item: %{slug: "openagents-repo-tabs"}} = assigns) do
|
|
1220
|
+ |
~H"""
|
|
1221
|
+ |
<div class="space-y-3">
|
|
1222
|
+ |
<p class="text-sm text-base-content/60">
|
|
1223
|
+ |
Seven links, not seven tabs. Each one changes the URL, so the selected entry
|
|
1224
|
+ |
is marked with <code>aria-current="page"</code>
|
|
1225
|
+ |
and the underline follows that attribute. Giving these a tab role would promise
|
|
1226
|
+ |
panels that swap in place, and a reader who accepted the promise and reached for
|
|
1227
|
+ |
the arrow keys would get nothing.
|
|
1228
|
+ |
</p>
|
|
1229
|
+ |
<UI.repo_tabs>
|
|
1230
|
+ |
<:tab icon="code" href="#code" current>Code</:tab>
|
|
1231
|
+ |
<:tab icon="empty-circle" href="#issues" count={12}>Issues</:tab>
|
|
1232
|
+ |
<:tab icon="pull-request-open" href="#pulls" count={3}>Pull requests</:tab>
|
|
1233
|
+ |
<:tab icon="cube" href="#projects">Projects</:tab>
|
|
1234
|
+ |
<:tab icon="book-open" href="#wiki">Wiki</:tab>
|
|
1235
|
+ |
<:tab icon="chart" href="#insights">Insights</:tab>
|
|
1236
|
+ |
<:tab icon="settings-cog" href="#settings">Settings</:tab>
|
|
1237
|
+ |
</UI.repo_tabs>
|
|
1238
|
+ |
<p class="text-sm text-base-content/60">
|
|
1239
|
+ |
The count sits in its own element rather than inside the word, so "Issues" stays
|
|
1240
|
+ |
findable by that word alone, the number keeps its own weight, and a narrow screen
|
|
1241
|
+ |
can drop it without anyone rewriting the label. The destinations here are page
|
|
1242
|
+ |
anchors, because the catalog has nowhere real to send you.
|
|
1243
|
+ |
</p>
|
|
1244
|
+ |
</div>
|
|
1245
|
+ |
"""
|
|
1246
|
+ |
end
|
|
1247
|
+ |
|
|
1248
|
+ |
defp component_demo(%{item: %{slug: "openagents-repo-view"}} = assigns) do
|
|
1249
|
+ |
assigns =
|
|
1250
|
+ |
assigns
|
|
1251
|
+ |
|> assign(:entries, @demo_repo_entries)
|
|
1252
|
+ |
|> assign(:contributors, @demo_repo_contributors)
|
|
1253
|
+ |
|
|
1254
|
+ |
~H"""
|
|
1255
|
+ |
<div class="space-y-3">
|
|
1256
|
+ |
<p class="text-sm text-base-content/60">
|
|
1257
|
+ |
Everything above, assembled: the owner trail from <code>breadcrumb/1</code>, the sections from <code>repo_tabs/1</code>, the tree from <code>file_table/1</code>, and the rail from <code>repo_about/1</code>. The frame
|
|
1258
|
+ |
itself is the only thing this component owns, which is why the three pieces arrive
|
|
1259
|
+ |
as slots — a surface that wants a commit list where the tree usually goes passes
|
|
1260
|
+ |
one, and no flag is added here.
|
|
1261
|
+ |
</p>
|
|
1262
|
+ |
<div class="-mx-6">
|
|
1263
|
+ |
<UI.repo_view
|
|
1264
|
+ |
owner="OpenAgentsInc"
|
|
1265
|
+ |
repo="openagents.com"
|
|
1266
|
+ |
owner_path={~p"/components/openagents-repo-view"}
|
|
1267
|
+ |
>
|
|
1268
|
+ |
<:tabs>
|
|
1269
|
+ |
<UI.repo_tabs>
|
|
1270
|
+ |
<:tab icon="code" href="#code" current>Code</:tab>
|
|
1271
|
+ |
<:tab icon="empty-circle" href="#issues" count={12}>Issues</:tab>
|
|
1272
|
+ |
<:tab icon="pull-request-open" href="#pulls" count={3}>Pull requests</:tab>
|
|
1273
|
+ |
<:tab icon="cube" href="#projects">Projects</:tab>
|
|
1274
|
+ |
<:tab icon="book-open" href="#wiki">Wiki</:tab>
|
|
1275
|
+ |
<:tab icon="chart" href="#insights">Insights</:tab>
|
|
1276
|
+ |
<:tab icon="settings-cog" href="#settings">Settings</:tab>
|
|
1277
|
+ |
</UI.repo_tabs>
|
|
1278
|
+ |
</:tabs>
|
|
1279
|
+ |
|
|
1280
|
+ |
<UI.file_table
|
|
1281
|
+ |
owner="OpenAgentsInc"
|
|
1282
|
+ |
repo="openagents.com"
|
|
1283
|
+ |
ref="main"
|
|
1284
|
+ |
entries={@entries}
|
|
1285
|
+ |
branches={2}
|
|
1286
|
+ |
tags={0}
|
|
1287
|
+ |
commits={234}
|
|
1288
|
+ |
>
|
|
1289
|
+ |
<:actions>
|
|
1290
|
+ |
<UI.input
|
|
1291
|
+ |
id="demo-go-to-file"
|
|
1292
|
+ |
type="text"
|
|
1293
|
+ |
name="go-to-file"
|
|
1294
|
+ |
placeholder="Go to file"
|
|
1295
|
+ |
aria-label="Go to file"
|
|
1296
|
+ |
class="input file-table__search"
|
|
1297
|
+ |
/>
|
|
1298
|
+ |
<UI.button size={:sm}>Add file</UI.button>
|
|
1299
|
+ |
<UI.button variant={:primary} size={:sm}>Code</UI.button>
|
|
1300
|
+ |
</:actions>
|
|
1301
|
+ |
<:commit>
|
|
1302
|
+ |
<UI.avatar size={:sm} fallback="A" label="AtlantisPleb" />
|
|
1303
|
+ |
<strong>AtlantisPleb</strong>
|
|
1304
|
+ |
<span>Group the agent's surfaces under her name</span>
|
|
1305
|
+ |
<code>86416fc</code>
|
|
1306
|
+ |
<span>15 minutes ago</span>
|
|
1307
|
+ |
</:commit>
|
|
1308
|
+ |
</UI.file_table>
|
|
1309
|
+ |
|
|
1310
|
+ |
<:about>
|
|
1311
|
+ |
<UI.repo_about description="The Agent Forge" license="AGPL-3.0" contributors={2}>
|
|
1312
|
+ |
<:link icon="link" href="https://openagents.com">openagents.com</:link>
|
|
1313
|
+ |
<:link icon="book" navigate="/docs">Readme</:link>
|
|
1314
|
+ |
<:link icon="text" navigate="/changelog">Activity</:link>
|
|
1315
|
+ |
<:stat icon="star">2 stars</:stat>
|
|
1316
|
+ |
<:stat icon="eye">0 watching</:stat>
|
|
1317
|
+ |
<:stat icon="branch">0 forks</:stat>
|
|
1318
|
+ |
<:contributor :for={person <- @contributors} name={person.name} />
|
|
1319
|
+ |
<:language percent={91.8}>Elixir</:language>
|
|
1320
|
+ |
<:language percent={3.1}>CSS</:language>
|
|
1321
|
+ |
<:language percent={3.1}>Shell</:language>
|
|
1322
|
+ |
<:language percent={1.0}>JavaScript</:language>
|
|
1323
|
+ |
<:language percent={1.0}>Other</:language>
|
|
1324
|
+ |
</UI.repo_about>
|
|
1325
|
+ |
</:about>
|
|
1326
|
+ |
</UI.repo_view>
|
|
1327
|
+ |
</div>
|
|
1328
|
+ |
<p class="text-sm text-base-content/60">
|
|
1329
|
+ |
The tree, the commit subjects, the branch, the contributors, and the commit count
|
|
1330
|
+ |
are this repository's own — each row's message is what <code>git log -1 -- <path></code>
|
|
1331
|
+ |
says about that path. A composed demo is only worth reading if the composition is
|
|
1332
|
+ |
carrying real proportions; invented ones make every column look comfortable.
|
|
1333
|
+ |
</p>
|
|
1334
|
+ |
<p class="text-sm text-base-content/60">
|
|
1335
|
+ |
The rail becomes a second column above 1024px and falls below the tree under it.
|
|
1336
|
+ |
Source order is already the narrow order, so nothing reorders: what a repository
|
|
1337
|
+ |
is, how it is licensed, and who wrote it are what a reader wants beside the file
|
|
1338
|
+ |
list on a desktop and after it on a phone.
|
|
1339
|
+ |
</p>
|
|
1340
|
+ |
</div>
|
|
1341
|
+ |
"""
|
|
1342
|
+ |
end
|
|
1343
|
+ |
|
| 1130 |
1344
|
|
defp component_demo(%{item: %{slug: "openagents-diff-file"}} = assigns) do
|
| 1131 |
1345
|
|
assigns =
|
| 1132 |
1346
|
|
assign(
|