Skip to content

Commit 4f2c7e0

Browse files
committed
new outine structure, ts ignores
1 parent 57056d4 commit 4f2c7e0

12 files changed

Lines changed: 153 additions & 79 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,11 @@ contacts (A VCARD Address Book, Group, Individual, Organization) can be handled
7878
pane. Any other pane which wants to deal with contacts can just use the pane within its own user interface.
7979

8080
![Mapping many classes on the L to panes on the R](https://solidos.github.io/solid-panes/doc/images/panes-for-classes.svg)
81+
82+
83+
## Generative AI usage
84+
The SolidOS team is using GitHub Copilot integrated in Visual Studio Code.
85+
We have added comments in the code to make it explicit which parts are 100% written by AI.
86+
87+
### Prompt usage hitory:
88+
* Model Claude Opus 4.6: Initially solid-panes is loaded into a HTML shell form mashlib that looks like ... Also, an iFrame is rendered inside the <div class="TabulatorOutline" id="DummyUUID"> for “isolated pane rendering”. Analize the solid-panes code for what it uses from this HTML and suggest a new HTML structure which is mobile and accessibility friendly. Lets go ahead and make chnages in this code as suggested to accommodate the new databwroser HTML.

dev/dev-mash.css

Lines changed: 80 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -8,81 +8,54 @@
88
@import url("./dev-light.css");
99
@import url("./dev-mash-utilities.css");
1010

11-
/* I couldn't find the code for the collapse image. this is a quick work around
12-
to make the collapsing easier to use ( the triangles dont jump 20 pixels). ~cm2
13-
*/
14-
img[title="Hide details."] {
15-
float: left;
16-
}
17-
18-
html {
19-
height: 100%;
20-
line-height: 1.15;
21-
}
22-
body {
23-
height: 100%;
24-
background-color: var(--color-background);
25-
color: var(--color-text);
11+
html, body {
12+
margin: 0;
13+
padding: 0;
2614
font-family: var(--font-family-base);
27-
}
28-
29-
/* Improved heading hierarchy */
30-
h1, h2, h3, h4, h5, h6 {
31-
color: var(--color-primary);
32-
font-weight: 600;
33-
line-height: var(--line-height-tight);
34-
margin-top: 0;
35-
margin-bottom: var(--spacing-sm);
36-
}
37-
38-
h1 { font-size: 2em; } /* 32px */
39-
h2 { font-size: 1.5em; } /* 24px */
40-
h3 { font-size: 1.25em; } /* 20px */
41-
h4 { font-size: 1.125em; }/* 18px */
42-
h5, h6 { font-size: 1em; }/* 16px */
43-
44-
/* Better paragraph spacing */
45-
p {
46-
margin-bottom: var(--spacing-md);
15+
font-size: var(--font-size-base);
4716
line-height: var(--line-height-base);
48-
max-width: 65ch; /* Optimal reading width */
49-
}
50-
51-
/* Improved link accessibility */
52-
a {
53-
color: var(--color-primary);
54-
text-decoration: underline;
55-
text-underline-offset: 0.125em;
56-
text-decoration-thickness: 0.0625em;
57-
}
58-
59-
a:hover, a:focus {
60-
text-decoration-thickness: 0.125em;
17+
background: var(--color-background);
18+
color: var(--color-text);
19+
-webkit-font-smoothing: antialiased;
20+
-moz-osx-font-smoothing: grayscale;
21+
text-rendering: optimizeLegibility;
6122
}
6223

63-
64-
/* Main page elements in databrowser.html */
65-
#PageBody {
24+
/* ── App layout ── */
25+
body {
6626
display: flex;
6727
flex-direction: column;
28+
min-height: 100dvh; /* dvh = dynamic viewport for mobile chrome */
6829
}
69-
#DummyUUID {
70-
flex: 1 0 auto;
71-
}
30+
7231
#PageHeader {
32+
position: sticky;
33+
top: 0;
34+
z-index: 100;
7335
flex-shrink: 0;
7436
}
37+
38+
#MainContent {
39+
flex: 1 1 auto;
40+
overflow-y: auto;
41+
-webkit-overflow-scrolling: touch; /* smooth iOS scroll */
42+
padding: clamp(0.5rem, 2vw, 1.5rem); /* responsive gutter */
43+
container-type: inline-size; /* enable @container queries */
44+
}
45+
7546
#PageFooter {
7647
flex-shrink: 0;
7748
}
7849

50+
7951
.warning {
8052
color: var(--color-warning);
8153
}
8254
.selected {
8355
background-color: var(--color-selected-bg);
8456
}
8557

58+
/* used in profile-pane as success button */
8659
.licOkay {
8760
background-color: var(--color-success-bg);
8861
}
@@ -1409,3 +1382,56 @@ End of styles for tableViewPane
14091382
-moz-box-shadow: $x-axis $y-axis $blur $color;
14101383
-o-box-shadow: $x-axis $y-axis $blur $color;
14111384
}
1385+
1386+
/* Generated by AI */
1387+
@media screen and (max-width: 768px) {
1388+
#PageHeader,
1389+
#PageFooter {
1390+
width: 100%;
1391+
}
1392+
1393+
#MainContent {
1394+
padding-top: 0.75rem;
1395+
padding-right: max(0.75rem, env(safe-area-inset-right));
1396+
padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
1397+
padding-left: max(0.75rem, env(safe-area-inset-left));
1398+
}
1399+
1400+
.TabulatorOutline,
1401+
.outline-view {
1402+
overflow-x: auto;
1403+
-webkit-overflow-scrolling: touch;
1404+
}
1405+
1406+
.TabulatorOutline table,
1407+
.outline-view table {
1408+
min-width: 100%;
1409+
}
1410+
1411+
img.outlineImage,
1412+
img.pic,
1413+
img.foafPic {
1414+
height: auto;
1415+
max-width: 100%;
1416+
}
1417+
1418+
div.description,
1419+
div.premises,
1420+
div.justification,
1421+
div.mildNotice {
1422+
box-sizing: border-box;
1423+
margin-left: 0;
1424+
margin-right: 0;
1425+
width: 100%;
1426+
}
1427+
}
1428+
1429+
html[data-layout="mobile"] #PageBody {
1430+
min-height: var(--app-height, 100dvh);
1431+
}
1432+
1433+
html[data-layout="mobile"] #MainContent {
1434+
overscroll-behavior-x: contain;
1435+
}
1436+
1437+
/* END of Generated by AI */

dev/loader.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { solidLogicSingleton, store, authSession } from 'solid-logic'
55
import { getOutliner } from '../src'
66
import Pane from 'profile-pane'
77
import './dev-mash.css'
8+
import { DataBrowserContext, RenderEnvironment } from 'pane-registry'
89

910
// Add custom properties to the Window interface for TypeScript
1011
declare global {
@@ -27,15 +28,24 @@ async function renderPane (uri: string) {
2728
await new Promise((resolve, reject) => {
2829
store.fetcher.load(doc).then(resolve, reject)
2930
})
30-
const context = {
31+
32+
const devEnvironment : RenderEnvironment = {
33+
layout: 'desktop', // or 'mobile'
34+
layoutPreference: 'desktop', // or 'mobile' or 'auto'
35+
inputMode: 'pointer', // or 'touch'
36+
theme: 'light', // or 'dark'
37+
viewport: { width: 800, height: 480 } // this is the default viewport for the browser window
38+
}
39+
const context : DataBrowserContext = {
3140
// see https://github.com/solidos/solid-panes/blob/005f90295d83e499fd626bd84aeb3df10135d5c1/src/index.ts#L30-L34
3241
dom: document,
3342
getOutliner,
3443
session: {
3544
store: store,
3645
paneRegistry,
3746
logic: solidLogicSingleton
38-
}
47+
},
48+
environment: devEnvironment
3949
}
4050

4151
console.log(subject, context)

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/dashboard/basicPreferences.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export const basicPreferencesPane: PaneDefinition = {
1515
// The subject should be the logged in user.
1616
render: (subject, context) => {
1717
const dom = context.dom
18+
// @ts-ignore
1819
const store = context.session.store as Store
1920

2021
function complainIfBad (ok: Boolean, mess: any) {

src/internal/internalPane.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const pane: PaneDefinition = {
2020

2121
render: function (subject, context) {
2222
const dom = context.dom
23+
// @ts-ignore
2324
const store = context.session.store as Store
2425
const canonizedSubject = store.canon(subject) as BlankNode | NamedNode | Variable
2526
const types = store.findTypeURIs(canonizedSubject)

src/outline/context.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export function createContext (
1414
getOutliner,
1515
session: {
1616
paneRegistry,
17+
// @ts-ignore
1718
store,
19+
// @ts-ignore
1820
logic
1921
}
2022
}

src/outline/manager.js

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -464,10 +464,10 @@ export default function (context) {
464464
async function showDashboard (options = {}) {
465465
const dashboardContainer = getDashboardContainer()
466466
const outlineContainer = getOutlineContainer()
467-
// reuse dashboard if already children already is inserted
467+
// reuse dashboard if children already inserted
468468
if (dashboardContainer.childNodes.length > 0 && options.pane) {
469-
outlineContainer.style.display = 'none'
470-
dashboardContainer.style.display = 'inherit'
469+
outlineContainer.setAttribute('hidden', '')
470+
dashboardContainer.removeAttribute('hidden')
471471
const tab = dashboardContainer.querySelector(
472472
`[data-global-pane-name="${options.pane}"]`
473473
)
@@ -490,7 +490,8 @@ export default function (context) {
490490
authSession.events.on('logout', closeDashboard)
491491

492492
// finally - switch to showing dashboard
493-
outlineContainer.style.display = 'none'
493+
outlineContainer.setAttribute('hidden', '')
494+
dashboardContainer.removeAttribute('hidden')
494495
dashboardContainer.appendChild(dashboard)
495496
const tab = dashboardContainer.querySelector(
496497
`[data-global-pane-name="${options.pane}"]`
@@ -500,35 +501,37 @@ export default function (context) {
500501
}
501502

502503
function closeDashboard () {
503-
dashboardContainer.style.display = 'none'
504-
outlineContainer.style.display = 'inherit'
504+
dashboardContainer.setAttribute('hidden', '')
505+
outlineContainer.removeAttribute('hidden')
505506
}
506507
}
507508
this.showDashboard = showDashboard
508509

509510
function getDashboardContainer () {
510-
return getOrCreateContainer('GlobalDashboard')
511+
return getOrCreateContainer('GlobalDashboard', 'Dashboard')
511512
}
512513

513514
function getOutlineContainer () {
514-
return getOrCreateContainer('outline')
515+
return getOrCreateContainer('OutlineView', 'Resource browser')
515516
}
516517

517518
/**
518-
* Get element with id or create a new on the fly with that id
519+
* Get element with id or create a new section on the fly with that id
519520
*
520521
* @param {string} id The ID of the element you want to get or create
522+
* @param {string} [ariaLabel] Optional aria-label for accessibility
521523
* @returns {HTMLElement}
522524
*/
523-
function getOrCreateContainer (id) {
525+
function getOrCreateContainer (id, ariaLabel) {
524526
return (
525527
document.getElementById(id) ||
526528
(() => {
527-
const dashboardContainer = document.createElement('div')
528-
dashboardContainer.id = id
529+
const container = document.createElement('section')
530+
container.id = id
531+
if (ariaLabel) container.setAttribute('aria-label', ariaLabel)
529532
const mainContainer =
530533
document.querySelector('[role="main"]') || document.body
531-
return mainContainer.appendChild(dashboardContainer)
534+
return mainContainer.appendChild(container)
532535
})()
533536
)
534537
}
@@ -581,8 +584,9 @@ export default function (context) {
581584
const paneHiddenStyle =
582585
'width: 24px; border-radius: 0.5em; margin-left: 1em; padding: 3px'
583586
const paneIconTray = td.appendChild(dom.createElement('nav'))
584-
paneIconTray.style =
585-
'display:flex; justify-content: flex-start; align-items: center;'
587+
paneIconTray.setAttribute('role', 'toolbar')
588+
paneIconTray.setAttribute('aria-label', 'Pane views')
589+
paneIconTray.classList.add('paneIconTray')
586590

587591
const relevantPanes = options.hideList
588592
? []
@@ -1577,7 +1581,7 @@ export default function (context) {
15771581
outline.GotoSubject(object, true)
15781582
/* //deal with this later
15791583
deselectAll();
1580-
var newTr=dom.getElementById('outline').lastChild;
1584+
var newTr=dom.getElementById('OutlineView').lastChild;
15811585
setSelected(newTr.firstChild.firstChild.childNodes[1].lastChild,true);
15821586
function setSelectedAfterward(uri){
15831587
deselectAll();
@@ -2242,7 +2246,7 @@ export default function (context) {
22422246
@param table -- option -- a table element in which to put the outline.
22432247
*/
22442248
this.GotoSubject = function (subject, expand, pane, solo, referrer, table) {
2245-
table = table || dom.getElementById('outline') // if does not exist just add one? nowhere to out it
2249+
table = table || dom.getElementById('OutlineView') // if does not exist just add one? nowhere to out it
22462250
if (solo) {
22472251
UI.utils.emptyNode(table)
22482252
table.style.width = '100%'

src/outline/userInput.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,8 +1418,11 @@ export function UserInput (outline) {
14181418
false
14191419
)
14201420
window.addEventListener('mousedown', UserInput.Mousedown, false)
1421-
document.getElementById('outline').oncontextmenu = function () {
1422-
return false
1421+
const outlineView = document.getElementById('OutlineView')
1422+
if (outlineView) {
1423+
outlineView.oncontextmenu = function () {
1424+
return false
1425+
}
14231426
}
14241427

14251428
if (e.button === 2) {

src/pad/padPane.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const paneDef: PaneDefinition = {
1616

1717
// Does the subject deserve an pad pane?
1818
label: function (subject, context) {
19+
// @ts-ignore
1920
const t = (context.session.store as Store).findTypeURIs(subject)
2021
if (t['http://www.w3.org/ns/pim/pad#Notepad']) {
2122
return 'pad'
@@ -26,6 +27,7 @@ const paneDef: PaneDefinition = {
2627
mintClass: ns.pad('Notepad'),
2728

2829
mintNew: function (context, newPaneOptions: any) {
30+
// @ts-ignore
2931
const store = context.session.store as Store
3032
const updater = store.updater
3133
if (newPaneOptions.me && !newPaneOptions.me.uri) {
@@ -77,6 +79,7 @@ const paneDef: PaneDefinition = {
7779
// @@ TODO Set better type for paneOptions
7880
render: function (subject, context, paneOptions: any) {
7981
const dom = context.dom
82+
// @ts-ignore
8083
const store = context.session.store as Store
8184
// Utility functions
8285
const complainIfBad = function (ok: boolean, message: string) {

0 commit comments

Comments
 (0)