scarpe-team / scarpe

Scarpe - shoes but running on webview
Other
162 stars 29 forks source link

Added font and tooltip to edit-box #537

Closed Nj221102 closed 7 months ago

Nj221102 commented 7 months ago

Description

This PR adds:-

  1. font-shorthand property to edit-box which allows users to decide how their text should look inside the edit box, and they can write any property in any order if they maintain the white space between the properties.

  2. Tooltip which can be used to give suggestions to people while they input something in the edit box, u can write anything u want to be shown when someone is hovering over the input field (text area), it goes away as soon as someone starts writing ,not causing any distraction

Shoes.app do
    para "Anything:",size:"30px"
    lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim."
    @manuscript = edit_box(lorem, width: "100%", font:"italic normal bold 25px 'Times New Roman', serif;", tooltip:"This is a tooltip") do |box|
      @char_count.replace("#{box.text.length} characters")
    end
    @char_count = para "#{@manuscript.text.length} characters" ,size:"20px"
  end

Image(if needed, helps for a faster review)

Screenshot 2024-02-02 at 4 25 19 PM

Checklist

noahgibbs commented 7 months ago

Looks good! Yay fonts and yay tooltips!

I'm still seeing at least one test breaking in CI, though it looks pretty straightforward to fix.

Nj221102 commented 7 months ago

Looks good! Yay fonts and yay tooltips!

I'm still seeing at least one test breaking in CI, though it looks pretty straightforward to fix.

Looks good! Yay fonts and yay tooltips!

I'm still seeing at least one test breaking in CI, though it looks pretty straightforward to fix.

Fixed it , and sorry for taking two commits to fix a obvious thing , i was a little careless with whitespaces and i have a question as well, why doesn't these error occurs when running tests locally using "bundle exec rake test"?

noahgibbs commented 7 months ago

sorry for taking two commits to fix a obvious thing

I promise, we all do that kind of thing :-)

why doesn't these error occurs when running tests locally using "bundle exec rake test"?

The CI check (.github/workflows/ci.yml) actually does a number of things, not just "bundle exec rake test".

Scanning through, here are the tests its runs (not counting install, etc. that it also does):

CI_RUN='true' bundle exec rake lacci_test
CI_RUN='true' bundle exec rake component_test
CI_RUN-'true' bundle exec rake test
bundle exec rake test:check_html_fixtures
noahgibbs commented 7 months ago

It could definitely make sense to have a "bundle exec ci_test" or something that did all these.