Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix: schedulePane render
  • Loading branch information
SharonStrats committed Mar 13, 2026
commit 504ed5c1834123f32e29f86e43cc20ecb04432b1
52 changes: 51 additions & 1 deletion src/schedule/schedulePane.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,9 +557,53 @@ export const schedulePane = {
const showForms = function () {
clearElement(naviCenter) // Remove refresh button if nec
const div = naviMain

// form2 depends on sched:allDay; seed a local default for new polls
if (!kb.any(subject, ns.sched('allDay'))) {
kb.add(
subject,
ns.sched('allDay'),
$rdf.literal(
'true',
undefined,
$rdf.sym('http://www.w3.org/2001/XMLSchema#boolean')
),
detailsDoc
)
}
Comment on lines +598 to +610

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In showForms, the new detailsDoc is derived from the resolved invitation (details.ttl#event), but this block seeds sched:allDay on the original subject. When the pane is invoked from folder-view, subject can be index.ttl#this, which would write triples about the index subject into details.ttl, and the later UI (which reads title/comment/etc from invitation) won’t see the values. Pick a single canonical poll subject (likely invitation/thisInstance) and use it consistently for all reads/writes in the form flow.

Copilot uses AI. Check for mistakes.

const wizard = true
let currentSlide = 0
let gotDoneButton = false

const hasFormControls = function (container) {
return !!container.querySelector('input, select, textarea, button')
}

const asBoolean = function (term, fallback) {
if (!term) return fallback
const value = (term.value || '').toLowerCase()
if (value === 'true' || value === '1') return true
if (value === 'false' || value === '0') return false
return fallback
}

const renderTimeProposalFallback = function (slide) {
const allDayValue = asBoolean(kb.any(subject, ns.sched('allDay')), true)
const fallbackForm = kb.sym(
formsURI + (allDayValue ? '#AllDayForm2' : '#NotAllDayForm2')
)
UI.widgets.appendForm(
document,
slide,
{},
subject,
fallbackForm,
detailsDoc,
complainIfBad
)
}
Comment on lines +628 to +642

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renderTimeProposalFallback computes sched:allDay and renders the fallback form against subject, but the pane now resolves invitation to details.ttl#event for folder-view compatibility. If subject is index.ttl#this, the fallback will populate and read the wrong subject compared to the rest of the render path. Use the same resolved subject (invitation/thisInstance) here as well.

Copilot uses AI. Check for mistakes.

if (wizard) {
const forms = [form1, form2, form3]
const slides = []
Expand All @@ -575,6 +619,12 @@ export const schedulePane = {
detailsDoc,
complainIfBad
Comment on lines 648 to 657

Copilot AI Mar 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the wizard slide loop, UI.widgets.appendForm(...) is still passed subject as the form’s target. When opened from folder-view this can be index.ttl#this, but the rest of the pane now treats invitation (details.ttl#event) as the event to display/query. This mismatch will cause form data (e.g., cal:summary, sched:option) to be written under a different subject than showResults reads from. Use the resolved subject consistently when rendering the forms.

Copilot uses AI. Check for mistakes.
)

// Some stores end up with form2's ui:Options unresolved; force a usable input form.
if (f === 1 && !hasFormControls(slide)) {
renderTimeProposalFallback(slide)
}

slides.push(slide)
}

Expand Down Expand Up @@ -882,7 +932,7 @@ export const schedulePane = {

// Read or create empty results file
function getResults () {
fetcher.nowOrWhenFetched(resultsDoc.uri, (ok, body, response) => {
fetcher.nowOrWhenFetched(resultsDoc.uri, undefined, (ok, body, response) => {
if (!ok) {
if (response.status === 404) {
// / Check explicitly for 404 error
Expand Down
Loading