linutil icon indicating copy to clipboard operation
linutil copied to clipboard

Refactor: float content interface

Open cartercanedy opened this issue 1 year ago • 16 comments

refactor FloatContent interface for better responsibility delegation

Type of Change

  • [x] Bug fix
  • [x] Refactoring

Description

Testing

Tested by running a few commands, could use some feedback from other users.

Impact

removes replicated code, simplifies interface consumers

  • Resolves #722

Checklist

  • [x] My code adheres to the coding and style guidelines of the project.
  • [x] I have performed a self-review of my own code.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [x] I have made corresponding changes to the documentation.
  • [x] My changes generate no errors/warnings/merge conflicts.

cartercanedy avatar Oct 02 '24 01:10 cartercanedy

dupe of #723

ghost avatar Oct 02 '24 02:10 ghost

dupe of #723

Not really

cartercanedy avatar Oct 02 '24 02:10 cartercanedy

dupe of #723

Not really

both of these PRs solve the same color bleeding issue, except yours comes later with a different proposed fix to the same issue. So yes this is a duplicate of my PR

ghost avatar Oct 02 '24 02:10 ghost

also you forgot to add closes #722 to the description

ghost avatar Oct 02 '24 02:10 ghost

This is more than just a fix for the styling issues, this makes the FloatContent interface more reasonable in terms of formatting and uniform styling of all Floats

cartercanedy avatar Oct 02 '24 02:10 cartercanedy

yours comes later with a different proposed fix to the same issue

It coincidentally fixes the same issue, but also refactors, so it's not a complete duplicate. The issue can be solved by your pr while also leaving this pr valid

cartercanedy avatar Oct 02 '24 02:10 cartercanedy

This is more than just a fix for the styling issues, this makes the FloatContent interface more reasonable in terms of formatting and uniform styling of all Floats

never said it wasn't i was just generalizing the fact that it solves the same issue making it a dupe

ghost avatar Oct 02 '24 02:10 ghost

it solves the same issue making it a dupe

The lack of nuance was my concern

cartercanedy avatar Oct 02 '24 02:10 cartercanedy

@afonsofrancof Just implemented what you did in #633 (I made sure to give you co-authorship) Please take a look and let me know if I captured what you were hoping to implement in your PR. I'm happy to update if I missed something

cartercanedy avatar Oct 03 '24 22:10 cartercanedy

Hey carter! I like what you did, but the main goal of my PR was to remove the FloatingTextMode so that we could display anything we want instead of being fixed to those 3 enum types. What I did would make it so that we could make the titles generic for any float we want to create in the future. What do you think? Maybe we could add it here as well?

afonsofrancof avatar Oct 03 '24 22:10 afonsofrancof

Totally! Just rebase any changes you made on top of mine and open a PR on my dev branch

cartercanedy avatar Oct 03 '24 22:10 cartercanedy

In August, when I was creating the FloatingContent interface and the FloatingText stucts, what I had in mind was that FloatingContent could be implemented by anything that wanted to show a float.

I think that restricting what the FloatingText can have as a title with an Enum goes against being generic. I think we should keep FloatingText as a way to show a generic float with any text and any title. We could expand upon the FloatingText struct, later on, if we wanted to have different behavior depending on the type of FloatingText we are creating (Preview,Descriptio, etc.) , while leaving FloatingText alone.

That is why the title is now a single string instead of having a "name" field. We don't know if the "name" value will even make sense for future FloatingTexts.

Let me know what you think

https://github.com/cartercanedy/linutil/pull/3

afonsofrancof avatar Oct 04 '24 00:10 afonsofrancof

I really like the changes. Only thing preventing the rebase pull is the temp-dir patch being out-of-order with upstream and your changes being applied before mine. Do you mind dropping Jeev's patch and applying your changes on top of mine to make the rebase possible?

cartercanedy avatar Oct 04 '24 01:10 cartercanedy

Will do once I am home :)

afonsofrancof avatar Oct 04 '24 08:10 afonsofrancof

@cartercanedy I cleaned it up :) Let me know if it's good for a rebase

afonsofrancof avatar Oct 04 '24 18:10 afonsofrancof

@afonsofrancof I spent way too much time trying to linearize the tree, but I'll just let your first commit stick around as a merge. Thanks for the help!

cartercanedy avatar Oct 04 '24 20:10 cartercanedy

these changes are just trying rebasing on top of all of the closed PRs, this should be good to go

cartercanedy avatar Oct 31 '24 19:10 cartercanedy

these changes are just trying rebasing on top of all of the closed PRs, this should be good to go

#889

adamperkowski avatar Oct 31 '24 19:10 adamperkowski

#889

I figured that cargo.lock got lost in the deps cleanup, thanks for fixing

cartercanedy avatar Oct 31 '24 19:10 cartercanedy

?

cartercanedy avatar Nov 06 '24 22:11 cartercanedy

@ChrisTitusTech any particular reason?

cartercanedy avatar Nov 07 '24 00:11 cartercanedy