bigbite / themer

GNU General Public License v2.0
2 stars 0 forks source link

Jump to button to show code change #83

Closed jonnywatersbb closed 3 months ago

jonnywatersbb commented 4 months ago

What problem does this address?

When using Themer to edit theme.json, it becomes difficult to see exactly where your code change is happening even with the code preview.

What is your proposed solution?

Add a jump to button next to each setting to display the line(s) of code that is being effected by the setting change

Mockup

jump

g-elwell commented 3 months ago

@jonnywatersbb I think 'jump to' would be tricky to pull off. A simpler solution to solve the same problem may be to contextualise the code preview, so that it only shows relevant config based on what you're currently editing.

I've put together a quick experiment of this approach if you want to try it out

Another alternative would be to prioritise bringing back the block editor preview, since this was removed as a temporary measure in favour of the 'easy' option of introducing a code preview. If the code preview requires significant work to make it useful, we should probably reconsider that decision. That said, I think the contextualised code preview is much more useful so could be a valid stop gap until we have time to re-introduce the block editor preview.

squarewave17 commented 3 months ago

@g-elwell I don't think you have seen this yet, but the code editor is already up and running and solving a lot of problems, including the jump to feature - Draft PR

In response to your comment, i'm happy to stop work on it but I believe it's the fastest route to 1.0.0

g-elwell commented 3 months ago

@squarewave17 I did see there was draft PR whilst submitting #83 but only took a cursory look at it since it's still in draft. It looks like a cool idea but I do think it raises too many questions at this stage. Is it finished? What problems does it solve beyond the 'jump to' feature?

squarewave17 commented 3 months ago

@g-elwell Well for example, currently there is no way to set or add colors or fonts. The user still has to go into the theme files to manually edit theme.json.

It's currently at a fully working state, but i'm looking at ways to optimise data as the controls are laggy.

g-elwell commented 3 months ago

@g-elwell Well for example, currently there is no way to set or add colors or fonts. The user still has to go into the theme files to manually edit theme.json.

Ah ok, that's fine for now because we're just focusing on editing styles for v1.0.0 and are planning to extend this to include a UI to control settings in a subsequent release.

The code editor would take the plugin in a different direction, so we'd need to decide whether that functionality actually aligns with our goals for the plugin, and answer questions surrounding how the UX for editing code and things like validation should behave.

I think it would be best to pause that work for now and we can come back to it later to discuss whether we want to include the feature before spending additional time on it.

g-elwell commented 3 months ago

Closing as this was resolved by #88