这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@shatfield4
Copy link
Collaborator

@shatfield4 shatfield4 commented Jan 16, 2024

Pull Request Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #590

What is in this change?

Describe the changes in this PR that are impactful to the repo.

  • truncate title to shorter length so x button is not hidden for longer title names in the citation modal

Additional Information

Add any other context about the Pull Request here that was not captured above.

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@shatfield4 shatfield4 linked an issue Jan 16, 2024 that may be closed by this pull request
@review-agent-prime
Copy link

frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/Citation/index.jsx

There is a repeated code block for rendering the SkeletonLine component. This can be extracted into a separate function to improve the readability of the code.
Create Issue
See the diff
Checkout the fix

    const renderSkeletonLines = (count) => {
      return [...Array(count)].map((_, idx) => (
        <SkeletonLine key={idx} />
      ));
    };

    // Usage
    {renderSkeletonLines(3)}
git fetch origin && git checkout -b ReviewBot/Impro-r4ozgwq origin/ReviewBot/Impro-r4ozgwq

The handleModalClose function is re-created every time the component re-renders. This can be avoided by using the useCallback hook.
Create Issue
See the diff
Checkout the fix

    const handleModalClose = useCallback(() => {
      if (dialogRef.current) {
        dialogRef.current.close();
      }
      onClose();
    }, [onClose]);
git fetch origin && git checkout -b ReviewBot/Impro-0ky8lf2 origin/ReviewBot/Impro-0ky8lf2

@timothycarambat timothycarambat merged commit 8b11288 into master Jan 16, 2024
@timothycarambat timothycarambat deleted the 590-bug-no-x-button-when-citation-name-is-long branch January 16, 2024 21:43
cabwds pushed a commit to cabwds/anything-llm that referenced this pull request Jul 3, 2025
Mintplex-Labs#603)

* truncate title to shorter length so x button is not hidden for longer title names in the citation modal

* absolutely position x button on citation modal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: No X button when citation name is long.

3 participants