Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions e2e/complete_workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -908,8 +908,8 @@ func TestCompleteWorkflow_BlogApp(t *testing.T) {
t.Fatalf("Failed to read template: %v", err)
}

if !strings.Contains(string(tmplContent), `id="scroll-sentinel"`) {
t.Error("❌ Template missing scroll-sentinel")
if !strings.Contains(string(tmplContent), `<div lvt-scroll-sentinel`) {
t.Error("❌ Template missing lvt-scroll-sentinel")
} else {
t.Log("✅ Scroll sentinel element present")
}
Expand Down
6 changes: 3 additions & 3 deletions e2e/rendering_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ func TestRendering_InfiniteScroll(t *testing.T) {
<style>
#scroll-container { height: 200px; overflow-y: auto; border: 1px solid #ccc; }
.item { height: 40px; padding: 10px; border-bottom: 1px solid #eee; }
#scroll-sentinel { height: 1px; }
[lvt-scroll-sentinel] { height: 1px; }
#loading { display: none; padding: 10px; text-align: center; }
</style>
</head>
Expand All @@ -1301,7 +1301,7 @@ func TestRendering_InfiniteScroll(t *testing.T) {
<div class="item">Item 3</div>
<div class="item">Item 4</div>
<div class="item">Item 5</div>
<div id="scroll-sentinel"></div>
<div lvt-scroll-sentinel></div>
</div>
<div id="loading">Loading more...</div>
</div>
Expand All @@ -1310,7 +1310,7 @@ func TestRendering_InfiniteScroll(t *testing.T) {
let isLoading = false;

const container = document.getElementById('scroll-container');
const sentinel = document.getElementById('scroll-sentinel');
const sentinel = document.querySelector('[lvt-scroll-sentinel]');
const loading = document.getElementById('loading');

// Intersection Observer for infinite scroll
Expand Down
4 changes: 2 additions & 2 deletions e2e/resource_generation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ func TestResourceGen_PaginationInfinite(t *testing.T) {
t.Fatalf("Failed to read template: %v", err)
}

if !strings.Contains(string(tmpl), `id="scroll-sentinel"`) {
t.Error("Template missing scroll-sentinel element")
if !strings.Contains(string(tmpl), `<div lvt-scroll-sentinel`) {
t.Error("Template missing lvt-scroll-sentinel element")
}

// Validate generated code compiles
Expand Down
2 changes: 1 addition & 1 deletion e2e/testdata/golden/resource_template.tmpl.golden
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
Loading more...
</div>
{{end}}
<div id="scroll-sentinel" style="height: 1px;"></div>
<div lvt-scroll-sentinel style="height: 1px;"></div>
{{end}}
{{end}}

Expand Down
6 changes: 3 additions & 3 deletions e2e/tutorial_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,10 +828,10 @@ func TestTutorialE2E(t *testing.T) {
}

tmplStr := string(tmplContent)
if !strings.Contains(tmplStr, `id="scroll-sentinel"`) {
t.Error("❌ Template does not contain scroll-sentinel element")
if !strings.Contains(tmplStr, `<div lvt-scroll-sentinel`) {
t.Error("❌ Template does not contain lvt-scroll-sentinel element")
} else {
t.Log("✅ Template contains scroll-sentinel element for infinite scroll")
t.Log("✅ Template contains lvt-scroll-sentinel element for infinite scroll")
}

// Verify the sentinel appears in actual rendered HTML when there are no template errors
Expand Down
2 changes: 1 addition & 1 deletion internal/generator/templates/components/pagination.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Loading more...
</div>
{{end}}
<div id="scroll-sentinel" style="height: 1px;"></div>
<div lvt-scroll-sentinel style="height: 1px;"></div>
{{end}}
{{end}}

Expand Down
4 changes: 2 additions & 2 deletions internal/generator/templates/resource/template.tmpl.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
Loading more...
</div>
{{end}}
<div id="scroll-sentinel" style="height: 1px;"></div>
<div lvt-scroll-sentinel style="height: 1px;"></div>
{{end}}
[[- else if eq .PaginationMode "load-more"]]
{{if .HasMore}}
Expand Down Expand Up @@ -342,7 +342,7 @@
}

function setupInfiniteScroll() {
const sentinel = document.getElementById('scroll-sentinel');
const sentinel = document.querySelector('[lvt-scroll-sentinel]');
if (!sentinel) return;

const observer = new IntersectionObserver(function(entries) {
Expand Down
2 changes: 1 addition & 1 deletion internal/kits/system/multi/components/pagination.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Loading more...
</div>
{{end}}
<div id="scroll-sentinel" style="height: 1px;"></div>
<div lvt-scroll-sentinel style="height: 1px;"></div>
{{end}}
{{end}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
Loading more...
</div>
{{end}}
<div id="scroll-sentinel" style="height: 1px;"></div>
<div lvt-scroll-sentinel style="height: 1px;"></div>
{{end}}
[[- else if eq .PaginationMode "load-more"]]
{{if .HasMore}}
Expand Down Expand Up @@ -402,7 +402,7 @@
}

function setupInfiniteScroll() {
const sentinel = document.getElementById('scroll-sentinel');
const sentinel = document.querySelector('[lvt-scroll-sentinel]');
if (!sentinel) return;

const observer = new IntersectionObserver(function(entries) {
Expand Down
2 changes: 1 addition & 1 deletion internal/kits/system/single/components/pagination.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
Loading more...
</div>
{{end}}
<div id="scroll-sentinel" style="height: 1px;"></div>
<div lvt-scroll-sentinel style="height: 1px;"></div>
{{end}}
{{end}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
Loading more...
</div>
{{end}}
<div id="scroll-sentinel" style="height: 1px;"></div>
<div lvt-scroll-sentinel style="height: 1px;"></div>
{{end}}
[[- else if eq .PaginationMode "load-more"]]
{{if .HasMore}}
Expand Down Expand Up @@ -402,7 +402,7 @@
}

function setupInfiniteScroll() {
const sentinel = document.getElementById('scroll-sentinel');
const sentinel = document.querySelector('[lvt-scroll-sentinel]');
if (!sentinel) return;

const observer = new IntersectionObserver(function(entries) {
Expand Down
2 changes: 1 addition & 1 deletion testdata/golden/resource_template.tmpl.golden
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
Loading more...
</div>
{{end}}
<div id="scroll-sentinel" style="height: 1px;"></div>
<div lvt-scroll-sentinel style="height: 1px;"></div>
{{end}}
{{end}}

Expand Down
Loading