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

feat: add pages mockup #2

Merged
merged 1 commit into from
Jul 9, 2024
Merged

feat: add pages mockup #2

merged 1 commit into from
Jul 9, 2024

Conversation

rjborba
Copy link
Collaborator

@rjborba rjborba commented Jul 7, 2024

image image image

Copy link

linear bot commented Jul 7, 2024

ORM-1452 Create pages Mockup

Create mockup for the most important pages so we can check the components interface and see what we have left

@rjborba rjborba force-pushed the feature/orm-1452 branch from 5edb814 to a2e55e8 Compare July 7, 2024 20:18
@rjborba rjborba requested a review from g-francesca July 7, 2024 20:18
@@ -5,7 +5,6 @@ defineCustomElements()

/** @type { import('@storybook/html').Preview } */
const preview = {
tags: ['autodocs'],
// TODO: Theme class should be a variable
decorators: [(story) => `<div id="orama-ui" class="theme-dark">${story()}</div>`],
Copy link
Contributor

Choose a reason for hiding this comment

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

btw I added a linear to track the problem with the theme class, you can reference it in the comment https://linear.app/oramasearch/issue/ORM-1455

@@ -9,11 +9,16 @@ export default meta
type Story = StoryObj

const Template = (args) => {
return `<orama-chat ${{...args}}></orama-chat>`
return `
<div style="height: 800px; width: 360px; border: 1px solid white;">
Copy link
Contributor

Choose a reason for hiding this comment

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

memo: It would be nice to add the storybook addon to preview mobile version, so we can add multiple screen resolutions to easily test the responsive behaviour (this kind of testing will be recurring for searchbox and other components). I found this but there may be others: https://storybook.js.org/addons/storybook-mobile-addon.
Added this ticket for reminder: https://linear.app/oramasearch/issue/ORM-1456/storybook-addon-to-preview-mobile

@@ -29,6 +29,7 @@ export class Input {
@Prop() label?: InputProps['label']
@Prop() labelForScreenReaders?: InputProps['labelForScreenReaders']

// TODO: It probably should be a prop as well
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm currently completing the Input in my branch, that will fix this. You can remove this comment if you want

.message-actions {
display: flex;
// TODO: Is it ok to be fixed?
margin-top: 20px;
Copy link
Contributor

Choose a reason for hiding this comment

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

yes I think it's ok in this case! but better to use the pxToRem function

padding: var(--spacing-m, $spacing-m);
margin: 0 var(--spacing-l, $spacing-l);

.message-actions {
Copy link
Contributor

Choose a reason for hiding this comment

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

If we don't strictly need nesting classes, I think it's better to keep this out of .message-wrapper

justify-content: end;

> * {
cursor: pointer;
Copy link
Contributor

Choose a reason for hiding this comment

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

curiosity: why do we need the universal selector here? Putting this rule right under .message-actions did not cover all the cases?

flex-grow: 0;
flex-shrink: 0;

& ::after {
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a typo here, a space afer &

.source {
position: relative;
overflow: hidden;
width: 180px;
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure about this width here (better using pxToRem wither way), I will check the preview to better understand the use case

<div class="sources-wrapper">
<div class="source">
{/* TODO: We should be able to costumize internal UI components through classes. We probable need an apporach like classe merge of Tailwind */}
<orama-paragraph class="source-title">Title title title</orama-paragraph>
Copy link
Contributor

Choose a reason for hiding this comment

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

I suppose you added classes here because the style was different by the one defined for our typo elements, but I would try to use them if possible. We can check with Angela in case there are important differences, so we can avoid adding extra classes, if not strictly necessary

<div class="footer-wrapper">
<form onSubmit={this.handleSubmit}>
<div style={{ display: 'flex' }}>
<orama-textarea
Copy link
Contributor

Choose a reason for hiding this comment

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

we should define a label for screen readers only here

</orama-textarea>
</div>
</form>
<div class="spacer" />
Copy link
Contributor

Choose a reason for hiding this comment

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

If possible, I would avoid adding html tags to handle spacings, I think in this case we can add margin to the form. wdyt?

import { chatContext } from '../context/chatContext'
import { searchContext } from '../context/searchContext'

const LIMIT_RESULTS = 10
Copy link
Contributor

Choose a reason for hiding this comment

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

memo for next improvements: this value should be customizable as other search paramteres


// TODO: I'm not sure if this is the best way to do this
* {
box-sizing: border-box;
Copy link
Contributor

@g-francesca g-francesca Jul 8, 2024

Choose a reason for hiding this comment

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

this would affect the whole hosting application (I think in this case, it wouldn't be a big deal, but I would avoid it), I did something like

#orama-ui {
  // style here

  *, *:before, *:after{
    box-sizing: border-box;
  }
}

wdyt?

return (
<Host>
<div class="message-wrapper">
<div>{this.message.content}</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

I see this renders a text, so better to wrap in an inline text element (p is ok) unless there are different cases

@rjborba rjborba force-pushed the feature/orm-1452 branch from a2e55e8 to 09be102 Compare July 9, 2024 02:45
@rjborba rjborba merged commit 367316c into main Jul 9, 2024
1 check failed
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.

2 participants