Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added custom size and Default widget open in <DocsGPTWidget /> #1389

Merged
merged 5 commits into from
Nov 5, 2024

Conversation

ayaan-qadri
Copy link
Contributor

  • What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)

    1. Allow to custom size of DocsGPTWidgte using height, width, max width, max height
    2. Added defaultOpen prop which was necessary to open widget when docsgpt-widget-plugin route hits without explicitly clicking on widget icon

  • Why was this change needed? (You can also link to an open issue here)

    These changes offer support for the sub problem of issue Feature: Backstage widget plugin #1341.

  • Other information:

    Custom sizing does not work in < 1280px screen (as far as i know, i do not think that backstage going to be use in mobile / < 1280px), lemme know if we need to add custom size prop also affect screen sizes < 1280px

Copy link

vercel bot commented Oct 28, 2024

@ayaan-qadri is attempting to deploy a commit to the Arc53 Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Collaborator

@ManishMadan2882 ManishMadan2882 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayaan-qadri
Other components using WidgetProps won't align with the custom object for size
image
Size is ideally string in the min-width and height

@ayaan-qadri
Copy link
Contributor Author

@ManishMadan2882
image

So I'm making changed into height and width of prompt window only,
I also changed into interface for size, In the current implementation it will not affect 'StyledButton' or 'PromptContainer' as they are taking size parameter even if someone passes custom object as argument (I also tested myself, it is working as before)

If we make those styled-component size prop's type string (as it was before) so it throws Linting error

In my opinion, making size prop compatible custom object is more reliable and future proof as well:

(Lemme know your thoughts that what should we do for this as if the current implementation does not fits code style)

@@ -265,7 +295,7 @@ const DotAnimation = styled.div`
const Delay = styled(DotAnimation) <{ delay: number }>`
animation-delay: ${props => props.delay + 'ms'};
`;
const PromptContainer = styled.form<{ size: string }>`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayaan-qadri I was thinking if you could just replace the need of passing the sizes to different styled components.
Having an object of dimensions for small, medium, large and the custom.
So that the width, height could be controlled from the parent directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we can control dimensions from sizesConfig.

@ayaan-qadri
Copy link
Contributor Author

@ManishMadan2882 Please give me some time, I will sure look into this.

Copy link

vercel bot commented Nov 2, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-gpt ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 2, 2024 3:49pm

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.05%. Comparing base (0b7be94) to head (64f72ad).
Report is 36 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1389   +/-   ##
=======================================
  Coverage   34.05%   34.05%           
=======================================
  Files          69       69           
  Lines        3374     3374           
=======================================
  Hits         1149     1149           
  Misses       2225     2225           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ayaan-qadri ayaan-qadri changed the title Added custom size N Default widget open in <DocsGPTWidget /> Added custom size and Default widget open in <DocsGPTWidget /> Nov 4, 2024
Copy link
Collaborator

@ManishMadan2882 ManishMadan2882 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the changes, Thanks @ayaan-qadri !

@dartpain dartpain merged commit 62b15f2 into arc53:main Nov 5, 2024
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions Extensions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants