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
6 changes: 6 additions & 0 deletions apps/client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.14.0

### Improvements

- Fixed summary container, updated chat lsit scroll logic

## 1.13.0

### Refactor
Expand Down
2 changes: 1 addition & 1 deletion apps/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sama",
"version": "1.13.0",
"version": "1.14.0",
"homepage": "https://github.com/SAMA-Communications/sama-client#readme",
"keywords": [
"react",
Expand Down
10 changes: 7 additions & 3 deletions apps/client/src/hooks/tools/persistedScroll/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const SAVE_DEBOUNCE_MS = 150;
const CLAMP_EPS_PX = 2;
const EXTRA_FETCH_CAP = 48;
const CONTAINER_RAF_TRIES = 40;
const TOP_THRESHOLD_PX = 25;

/**
* Conversation list scroll persistence. When `active` is false, effects no-op (shared hook entrypoint).
Expand Down Expand Up @@ -50,7 +51,6 @@ export function useListPersistedScroll(active, p) {

const runRestore = useCallback((container, persisted) => {
if (!persisted) {
container.scrollTop = 0;
pinnedBottomRef.current = false;
pendingScrollRef.current = null;
anchorRetryRef.current = null;
Expand Down Expand Up @@ -218,8 +218,12 @@ export function useListPersistedScroll(active, p) {

const delta = cont.scrollHeight - prevH;
if (prevH > 0 && delta !== 0) {
const maxTop = Math.max(0, cont.scrollHeight - cont.clientHeight);
cont.scrollTop = Math.min(prevTop + delta, maxTop);
if (prevTop <= TOP_THRESHOLD_PX) {
cont.scrollTop = 0;
} else {
const maxTop = Math.max(0, cont.scrollHeight - cont.clientHeight);
cont.scrollTop = Math.min(Math.max(0, prevTop + delta), maxTop);
}
}

const { pending, pinnedBottom } = buildChatListScrollSavePayload(cont);
Expand Down
2 changes: 1 addition & 1 deletion apps/client/src/services/usersService.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class UsersService {

return await api.userCreate({
login: login.trim().toLowerCase(),
email: login.trim(),
email: email.trim(),
password: password.trim(),
});
}
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sama-client",
"version": "1.13.0",
"version": "1.14.0",
"private": true,
"description": "SAMA monorepo: web client, SDK, UI kit",
"license": "MIT",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { WandSparkles, X } from "lucide-react";
import * as m from "motion/react-m";

import { SummaryContainerProps } from "@composites/SummaryContainer/SummaryContainer.types";

Expand All @@ -11,13 +10,7 @@ export const SummaryContainer = ({ summaryContent, onClose, getFilterLabel }: Su
const { isLoading, text, filter } = summaryContent;

return (
<m.div
className="ui:absolute ui:top-1/2 ui:right-2.5 ui:z-45 ui:max-w-87.5 ui:-translate-y-1/2 ui:rounded-2xl ui:bg-black/85 ui:p-3 ui:text-end ui:text-white"
initial={{ backgroundColor: "rgba(0, 0, 0, 0)" }}
animate={{ backgroundColor: "rgba(0, 0, 0, 0.85)" }}
exit={{ backgroundColor: "rgba(0, 0, 0, 0)" }}
transition={{ duration: 0.2 }}
>
<div className="ui:absolute ui:right-1/2 ui:bottom-17 ui:z-45 ui:w-[calc(100%-28px)] ui:max-w-300 ui:translate-x-1/2 ui:rounded-2xl ui:bg-black/65 ui:p-3 ui:text-end ui:text-white">
<div className="ui:flex ui:items-center ui:justify-between">
<span className="ui:text-span ui:text-gray-300">Only you can see this summary</span>
<X color="white" size={16} className="ui:cursor-pointer" onClick={onClose} />
Expand All @@ -38,6 +31,6 @@ export const SummaryContainer = ({ summaryContent, onClose, getFilterLabel }: Su
{getFilterLabel && (
<span className="ui:text-span ui:mt-2.25 ui:ml-auto ui:text-gray-300">{getFilterLabel(filter)}</span>
)}
</m.div>
</div>
);
};
Loading