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

add collapsible drawer to show/hide prompt #2269

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

naufandarmawan
Copy link

Description

Use a collapsible drawer to show/hide the GPT prompt #377

Changes

Add collapsible drawer to show/hide prompt (in Analysis.jsx) using react-collapse

Screenshots

Before
localhost_3000_uk_policy_focus=policyOutput analysis reform=72850 region=uk timePeriod=2024 baseline=1 (1)

After
localhost_3000_uk_policy_focus=policyOutput analysis reform=72850 region=uk timePeriod=2024 baseline=1

Tests

Tested locally, the result similar to the screenshots

@anth-volk
Copy link
Collaborator

Thanks @naufandarmawan! I should have a review for you either today or tomorrow.

@anth-volk anth-volk self-requested a review January 3, 2025 13:51
Copy link
Collaborator

@anth-volk anth-volk left a comment

Choose a reason for hiding this comment

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

Hi @naufandarmawan! Thanks for your work on this issue. I left a couple of comments, but I think the high-level takeaway is that a simpler fix, whereby our existing collapsible code feature is expanded/refactored, would probably be preferable. Thank you again.

{showPrompt ? (
<CodeBlock lines={lines} language={"markdown"} data={prompt} />
) : null}
<motion.div
Copy link
Collaborator

Choose a reason for hiding this comment

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

issue, blocking: Please match this to our existing style.

As implemented here, this component doesn't quite match our visual style. Using the "Input" and "Ouptut" components at https://policyengine.org/us/api, could you refactor this to better match our visual style?

This issue could probably even be solved by just refactoring the existing code component to allow for full collapsibility on default, without the need for react-collapse and motion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: PR: Changes Requested
Development

Successfully merging this pull request may close these issues.

2 participants