From d0b42cdaa5464f5f2561a53b56257bc90deb9f01 Mon Sep 17 00:00:00 2001 From: lizerk Date: Mon, 13 Apr 2026 14:34:59 +0300 Subject: [PATCH] refactor(frontend): restore profile timeline emphasis --- frontend/src/app/profile/page.tsx | 32 +++++------ .../users/EmployeeActionsTimeline.tsx | 55 ++++++++++--------- 2 files changed, 44 insertions(+), 43 deletions(-) diff --git a/frontend/src/app/profile/page.tsx b/frontend/src/app/profile/page.tsx index 0efa3823..30629b3b 100644 --- a/frontend/src/app/profile/page.tsx +++ b/frontend/src/app/profile/page.tsx @@ -153,24 +153,22 @@ export default function ProfilePage() { bottomPanel={} /> -
- void handleAddSkill()} - submitDisabled={!skillName.trim() || skillsSaving} - inputDisabled={skillsSaving} - availableSkills={availableSkills} - skills={profileSkills} - error={skillsError} - loading={skillsLoading} - onRemoveSkill={(skillId) => void handleRemoveSkill(skillId)} - removeDisabled={skillsSaving} - emptyText="Навыки пока не указаны" - /> + void handleAddSkill()} + submitDisabled={!skillName.trim() || skillsSaving} + inputDisabled={skillsSaving} + availableSkills={availableSkills} + skills={profileSkills} + error={skillsError} + loading={skillsLoading} + onRemoveSkill={(skillId) => void handleRemoveSkill(skillId)} + removeDisabled={skillsSaving} + emptyText="Навыки пока не указаны" + /> - -
+ initialVisibleCount); + const canCollapse = Boolean( + initialVisibleCount && sortedActions.length > initialVisibleCount, + ); const visibleActions = useMemo( - () => (canCollapse && !showAll ? sortedActions.slice(0, initialVisibleCount) : sortedActions), + () => + canCollapse && !showAll + ? sortedActions.slice(0, initialVisibleCount) + : sortedActions, [canCollapse, initialVisibleCount, showAll, sortedActions], ); @@ -60,16 +65,9 @@ export default function EmployeeActionsTimeline({ return (
-
-
-

Кадровые события

- {!showAll && canCollapse ? ( -

- Последние {visibleActions.length} из {sortedActions.length} -

- ) : null} -
-
+
+

Кадровые события

+
{showCountLabel ? ( {sortedActions.length}{" "} @@ -101,6 +99,12 @@ export default function EmployeeActionsTimeline({
+ {!showAll && canCollapse ? ( +

+ Последние {visibleActions.length} из {sortedActions.length} +

+ ) : null} +
{visibleActions.map((action) => { const isCurrent = latestActionId === action.id; @@ -111,27 +115,26 @@ export default function EmployeeActionsTimeline({ : action.comment; return ( -
+
- -
-
+ {isCurrent ? ( + + ) : null} +
+
{action.action_display || action.action} {isCurrent ? ( - + текущий ) : null} @@ -142,8 +145,8 @@ export default function EmployeeActionsTimeline({

) : null}
-
-