Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
KotGPT
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Michael Pastushkov
KotGPT
Commits
b15588f3
Commit
b15588f3
authored
Aug 19, 2025
by
michaelpastushkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
12e79c3d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
static/www/1.html
+17
-4
No files found.
static/www/1.html
View file @
b15588f3
...
@@ -202,7 +202,7 @@
...
@@ -202,7 +202,7 @@
z-index
:
1100
;
z-index
:
1100
;
/* above composer/footer */
/* above composer/footer */
display
:
none
;
display
:
none
;
/* h
idden initially
*/
/* h
ard-hidden until armed
*/
align-items
:
center
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
center
;
border
:
1px
solid
#ced4da
;
border
:
1px
solid
#ced4da
;
...
@@ -324,6 +324,9 @@
...
@@ -324,6 +324,9 @@
let
firstRequestDone
=
false
;
let
firstRequestDone
=
false
;
let
controller
=
null
;
let
controller
=
null
;
// HARD STOP guard: do not show button until conversation starts
let
scrollBtnArmed
=
false
;
// --- render helpers ---
// --- render helpers ---
function
renderMarkdown
(
targetEl
,
md
)
{
function
renderMarkdown
(
targetEl
,
md
)
{
const
html
=
marked
.
parse
(
md
,
{
breaks
:
true
,
gfm
:
true
,
headerIds
:
false
});
const
html
=
marked
.
parse
(
md
,
{
breaks
:
true
,
gfm
:
true
,
headerIds
:
false
});
...
@@ -382,8 +385,12 @@
...
@@ -382,8 +385,12 @@
}
}
function
updateScrollButton
()
{
function
updateScrollButton
()
{
// Hard stop: never show until armed
if
(
!
scrollBtnArmed
)
{
scrollDownBtn
.
style
.
display
=
'none'
;
return
;
}
const
needs
=
isOverflowingAny
()
&&
!
atBottom
();
const
needs
=
isOverflowingAny
()
&&
!
atBottom
();
// hidden initially (no overflow) and whenever you’re at the bottom
scrollDownBtn
.
style
.
display
=
needs
?
'inline-flex'
:
'none'
;
scrollDownBtn
.
style
.
display
=
needs
?
'inline-flex'
:
'none'
;
}
}
...
@@ -405,6 +412,9 @@
...
@@ -405,6 +412,9 @@
if
(
!
firstRequestDone
)
{
welcomeLogo
?.
remove
();
firstRequestDone
=
true
;
}
if
(
!
firstRequestDone
)
{
welcomeLogo
?.
remove
();
firstRequestDone
=
true
;
}
// Arm the scroll button the moment a real conversation starts
scrollBtnArmed
=
true
;
const
autoStick
=
atBottom
();
const
autoStick
=
atBottom
();
const
userMsg
=
document
.
createElement
(
'div'
);
const
userMsg
=
document
.
createElement
(
'div'
);
...
@@ -496,7 +506,7 @@
...
@@ -496,7 +506,7 @@
window
.
addEventListener
(
'scroll'
,
updateScrollButton
,
{
passive
:
true
});
window
.
addEventListener
(
'scroll'
,
updateScrollButton
,
{
passive
:
true
});
window
.
addEventListener
(
'resize'
,
updateScrollButton
);
window
.
addEventListener
(
'resize'
,
updateScrollButton
);
// Observe content changes to recalc button visibility
// Observe content changes to recalc button visibility
(only after armed)
const
threadObserver
=
new
MutationObserver
(()
=>
{
const
threadObserver
=
new
MutationObserver
(()
=>
{
requestAnimationFrame
(
updateScrollButton
);
requestAnimationFrame
(
updateScrollButton
);
});
});
...
@@ -507,7 +517,10 @@
...
@@ -507,7 +517,10 @@
try
{
await
fetch
(
'/api/clear'
,
{
method
:
'GET'
});
}
catch
(
_
)
{
}
try
{
await
fetch
(
'/api/clear'
,
{
method
:
'GET'
});
}
catch
(
_
)
{
}
await
loadLocale
(
CURRENT_LOCALE
);
await
loadLocale
(
CURRENT_LOCALE
);
inputText
.
focus
();
inputText
.
focus
();
updateScrollButton
();
// initial -> hidden if no overflow
// Force-hide at startup no matter what
scrollBtnArmed
=
false
;
scrollDownBtn
.
style
.
display
=
'none'
;
updateScrollButton
();
});
});
</script>
</script>
</body>
</body>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment