fix(pres_mgmt): remove lock_config — sync is now fully unconditional
lock_config made roughly half of sync_config__event_pres_mgmt()'s fields conditional: they only updated in a given browser if lock_config happened to be true at the exact moment that browser last synced. A field's local value therefore depended on the history of saves, not the current setting — undebuggable from the UI, and easy to corrupt by toggling Lock Config off even briefly during testing. This was the actual root cause of the "POC column / Hide POC sometimes works" reports. Checked the DB: every event, old and new, already had lock_config: true. The "unlocked, per-browser preference" use case it was built for has never actually been used in practice. - Removed lock_config from PressMgmtRemoteCfg, PresMgmtLocState, the sync function (no more conditional block — every field syncs unconditionally now, same as labels/Require Agreements always did), and the Config page UI (no more System section) - Old DB records with a lock_config key are simply ignored, same as any other removed key — no migration needed - Moved the now-fully-orphaned ae_comp__event_settings_pres_mgmt_form.svelte to ~/tmp/agents_trash (zero imports anywhere; the settings page already links to the canonical Config page) — completes Step 5 from the cleanup doc - Marked PROJECT__AE_Events_PressMgmt_Config_Cleanup.md complete — all Implementation Steps and known regressions resolved svelte-check: 0 errors, 0 warnings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -48,7 +48,6 @@ let lq__event_obj = $derived(
|
||||
// Draft state — initialized from the live event config
|
||||
// ---------------------------------------------------------------------------
|
||||
const cfg_defaults: PressMgmtRemoteCfg = {
|
||||
lock_config: true,
|
||||
label__person_external_id: null,
|
||||
label__presenter_external_id: null,
|
||||
label__session_poc_type: null,
|
||||
@@ -181,7 +180,6 @@ async function save() {
|
||||
|
||||
// Section collapse state
|
||||
let sections: Record<string, boolean> = $state({
|
||||
system: true,
|
||||
labels: true,
|
||||
codes: true,
|
||||
session: true,
|
||||
@@ -244,41 +242,13 @@ function toggle(key: string) {
|
||||
|
||||
<p class="text-surface-500 text-sm">
|
||||
Changes here update <code>event.mod_pres_mgmt_json</code> and take effect on
|
||||
the next event load. When <strong>Lock Config</strong> is on, all display flags
|
||||
are pushed to every browser — overriding local user preferences.
|
||||
the next event load, applying to every browser.
|
||||
</p>
|
||||
|
||||
{#if !draft_initialized}
|
||||
<p class="text-surface-400 italic">Loading event config...</p>
|
||||
{:else}
|
||||
|
||||
<!-- ================================================================ -->
|
||||
<!-- SYSTEM -->
|
||||
<!-- ================================================================ -->
|
||||
<section class="border-surface-200-800 rounded-xl border">
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full items-center justify-between px-4 py-3 text-left font-semibold"
|
||||
onclick={() => toggle('system')}>
|
||||
<span>System</span>
|
||||
{#if sections.system}<ChevronUp size="1em" />{:else}<ChevronDown size="1em" />{/if}
|
||||
</button>
|
||||
{#if sections.system}
|
||||
<div class="border-surface-200-800 space-y-3 border-t px-4 py-3">
|
||||
<label class="flex items-start gap-3">
|
||||
<input type="checkbox" class="checkbox mt-0.5" bind:checked={draft.lock_config} />
|
||||
<span>
|
||||
<span class="font-semibold">Lock Config</span>
|
||||
<span class="text-surface-500 ml-2 text-sm">
|
||||
Forces all display flags below to sync into every browser on event load,
|
||||
overriding local user preferences. Recommended: <strong>on</strong>.
|
||||
</span>
|
||||
</span>
|
||||
</label>
|
||||
</div>
|
||||
{/if}
|
||||
</section>
|
||||
|
||||
<!-- ================================================================ -->
|
||||
<!-- LABELS -->
|
||||
<!-- ================================================================ -->
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
<script lang="ts">
|
||||
import type { key_val } from '$lib/stores/ae_stores';
|
||||
|
||||
interface Props {
|
||||
mod_pres_mgmt_json: key_val | null | undefined;
|
||||
onsave?: (data: key_val) => void;
|
||||
}
|
||||
|
||||
let { mod_pres_mgmt_json = $bindable({}), onsave }: Props = $props();
|
||||
|
||||
function save() {
|
||||
if (onsave && mod_pres_mgmt_json) onsave(mod_pres_mgmt_json);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="space-y-4">
|
||||
{#if mod_pres_mgmt_json}
|
||||
<div class="grid grid-cols-2 gap-4">
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.lock_config} />
|
||||
<span>Lock Config</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.hide__location_code} />
|
||||
<span>Hide Location Code</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={
|
||||
mod_pres_mgmt_json.hide__presentation_code
|
||||
} />
|
||||
<span>Hide Presentation Code</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={
|
||||
mod_pres_mgmt_json.hide__presenter_code
|
||||
} />
|
||||
<span>Hide Presenter Code</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.hide__session_code} />
|
||||
<span>Hide Session Code</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.limit__navigation} />
|
||||
<span>Limit Navigation</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={mod_pres_mgmt_json.limit__options} />
|
||||
<span>Limit Options</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={
|
||||
mod_pres_mgmt_json.require__presenter_agree
|
||||
} />
|
||||
<span>Require Presenter Agreement</span>
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<input
|
||||
type="checkbox"
|
||||
class="checkbox"
|
||||
bind:checked={
|
||||
mod_pres_mgmt_json.require__session_agree
|
||||
} />
|
||||
<span>Require Session Agreement</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-2">
|
||||
<div>
|
||||
<label class="label">
|
||||
<span>Label for Person External ID</span>
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={
|
||||
mod_pres_mgmt_json.label__person_external_id
|
||||
} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<span>Label for Session POC Type</span>
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={
|
||||
mod_pres_mgmt_json.label__session_poc_type
|
||||
} />
|
||||
</label>
|
||||
</div>
|
||||
<div>
|
||||
<label class="label">
|
||||
<span>Label for Session POC Name</span>
|
||||
<input
|
||||
type="text"
|
||||
class="input"
|
||||
bind:value={
|
||||
mod_pres_mgmt_json.label__session_poc_name
|
||||
} />
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<button type="button" class="btn preset-tonal-primary" onclick={save}
|
||||
>Save</button>
|
||||
</div>
|
||||
Reference in New Issue
Block a user