Skip to content

Commit 53ee6c1

Browse files
Merge branch '25_2' into 25_2_angular_19
2 parents d60ec76 + f2268b5 commit 53ee6c1

File tree

2 files changed

+163
-0
lines changed

2 files changed

+163
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
applyTo: "**/localization/messages/**/*.json"
3+
---
4+
5+
# CRITICAL: DO NOT REVIEW LOCALIZATION FILES
6+
7+
These files are managed by a dedicated localization team through a separate workflow.
8+
9+
## Absolute Prohibitions - You MUST NOT:
10+
11+
- ❌ NEVER suggest translating English text to other languages
12+
- ❌ NEVER comment that text should be translated to match the locale
13+
- ❌ NEVER suggest alternative translations or phrasings in any language
14+
- ❌ NEVER comment on language consistency (e.g., "this should be in Arabic")
15+
- ❌ NEVER suggest changing text content for localization purposes
16+
- ❌ NEVER comment on which language should be used
17+
- ❌ NEVER suggest adding or removing message keys
18+
- ❌ NEVER provide language-specific style recommendations
19+
20+
## Why These Files Are Off-Limits:
21+
22+
Translation suggestions make PR pages UNRESPONSIVE and overwhelm human reviewers. The localization team handles all translation work through a separate quality assurance process.
23+
24+
## The ONLY Acceptable Comments:
25+
26+
✅ Critical JSON syntax errors that would break the build (missing commas, unclosed brackets)
27+
✅ Severe grammar errors (ONLY if they would cause user confusion)
28+
29+
## Examples of FORBIDDEN Comments:
30+
31+
- ❌ "This English text should be translated to Arabic"
32+
- ❌ "Translation is missing for this locale"
33+
- ❌ "Consider translating '(No subject)' to '(بدون موضوع)'"
34+
- ❌ "This text is in English but should be in German"
35+
- ❌ "Inconsistent language - use native translation"
36+
37+
If you have ANY doubt about whether to comment on a localization file, DO NOT COMMENT.
38+
39+
Focus your review on actual code files instead.

apps/react-storybook/stories/chat/Chat.stories.tsx

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -790,3 +790,127 @@ export const Editing: Story = {
790790
);
791791
}
792792
};
793+
794+
export const FileAttachments: Story = {
795+
args: {
796+
user: firstAuthor,
797+
...commonArgs,
798+
},
799+
argTypes: {
800+
user: {
801+
control: 'select',
802+
options: [firstAuthor.name, secondAuthor.name],
803+
mapping: {
804+
[firstAuthor.name]: firstAuthor,
805+
[secondAuthor.name]: secondAuthor,
806+
},
807+
defaultValue: firstAuthor.name,
808+
},
809+
},
810+
render: ({
811+
width,
812+
height,
813+
disabled,
814+
rtlEnabled,
815+
user,
816+
visible,
817+
activeStateEnabled,
818+
hoverStateEnabled,
819+
focusStateEnabled,
820+
}) => {
821+
const [messages, setMessages] = useState<ChatTypes.Message[]>([
822+
{
823+
id: 1,
824+
author: firstAuthor,
825+
text: 'Files attached in a very long message: Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vel tempus orci, sit amet tempor tortor. Etiam ut aliquam nisi.',
826+
attachments: [
827+
{ name: 'report.pdf', size: 1024 * 512 },
828+
{ name: 'presentation.pptx', size: 1024 * 1024 },
829+
{ name: 'photo.jpg', size: 1024 * 300 },
830+
{ name: 'song.mp3', size: 1024 * 300 },
831+
],
832+
},
833+
{
834+
id: 2,
835+
author: secondAuthor,
836+
text: 'Files, short message',
837+
attachments: [
838+
{ name: 'report.pdf', size: 1024 * 512 },
839+
{ name: 'song.mp3', size: 1024 * 1024 },
840+
],
841+
},
842+
]);
843+
844+
const [toastConfig, setToastConfig] = useState({
845+
visible: false,
846+
message: '',
847+
});
848+
849+
const onAttachmentDownloadClick = useCallback((e: ChatTypes.AttachmentDownloadClickEvent) => {
850+
const { attachment } = e;
851+
852+
setToastConfig({
853+
visible: true,
854+
message: `Downloading ${attachment?.name}...`,
855+
});
856+
857+
setTimeout(() => {
858+
setToastConfig({
859+
visible: true,
860+
message: `${attachment?.name} downloaded successfully`,
861+
});
862+
}, 1000);
863+
}, []);
864+
865+
const onMessageEntered = useCallback(
866+
({ message }) => {
867+
setMessages((prev) => [...prev, message]);
868+
},
869+
[]
870+
);
871+
872+
const onToastHiding = useCallback(() => {
873+
setToastConfig({ visible: false, message: '' });
874+
}, []);
875+
876+
const fileUploaderOptions = useMemo(() => ({
877+
uploadFile: (file: File) => {
878+
setToastConfig({
879+
visible: true,
880+
message: `Uploading ${file.name}...`,
881+
});
882+
setTimeout(() => {
883+
setToastConfig({
884+
visible: true,
885+
message: `${file.name} uploaded successfully`,
886+
});
887+
}, 1000);
888+
}
889+
}), []);
890+
891+
return (
892+
<div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
893+
<Chat
894+
width={width}
895+
height={height}
896+
items={messages}
897+
disabled={disabled}
898+
rtlEnabled={rtlEnabled}
899+
user={user}
900+
visible={visible}
901+
activeStateEnabled={activeStateEnabled}
902+
focusStateEnabled={focusStateEnabled}
903+
hoverStateEnabled={hoverStateEnabled}
904+
onAttachmentDownloadClick={onAttachmentDownloadClick}
905+
onMessageEntered={onMessageEntered}
906+
fileUploaderOptions={fileUploaderOptions}
907+
/>
908+
<Toast
909+
{...toastConfig}
910+
onHiding={onToastHiding}
911+
displayTime={1000}
912+
/>
913+
</div>
914+
);
915+
},
916+
};

0 commit comments

Comments
 (0)