superfile icon indicating copy to clipboard operation
superfile copied to clipboard

WIP: feat(default theme): add default color theme based on terminal

Open nkxxll opened this issue 9 months ago • 15 comments

this is only a suggestion test it out yourself and adjust the colors as you like the palette is limited with only the default terminal colors terminal (16 bit for max compatability)

Summary by CodeRabbit

  • New Features
    • Introduced a new code syntax highlighting theme based on the popular "dracula" style, offering refined color settings for various interface components and states to enhance visual consistency.

nkxxll avatar Mar 10 '25 21:03 nkxxll

Thanks I will try it out later

lazysegtree avatar Mar 11 '25 04:03 lazysegtree

By the way, FYI we have an active discord(see ReadMe.md) . You can join that for more flexible discussion with spf team, and see whats else is being worked on.

lazysegtree avatar Mar 11 '25 04:03 lazysegtree

Walkthrough

A new configuration file, ansi-default.toml, has been added to define a "dracula" code syntax highlighting theme. The file specifies color settings for various UI elements such as borders, backgrounds, and foregrounds as well as active states and indicators like cursors and error highlights. This configuration extends the application's theming capabilities without altering existing control flows.

Changes

File Summary
src/superfile_config/theme/ansi-default.toml Added a new configuration file defining a "dracula" syntax highlighting theme with color settings for borders, backgrounds, foregrounds, and UI-specific elements.

Poem

I'm a rabbit with a cheerful grin,
Hopping through colors where ideas begin.
A "dracula" theme now lights the night,
With hues so vibrant, pure delight.
Carrot dreams and codes unite!
🥕✨


📜 Recent review details

Configuration used: CodeRabbit UI Review profile: CHILL Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4bebbe2bac4c8a5612fee74e37b51ed2cc2f81a5 and 4e665194ef76c0b7bc1fe8061ea9bb823df76bdf.

📒 Files selected for processing (1)
  • src/superfile_config/theme/ansi-default.toml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/superfile_config/theme/ansi-default.toml

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

coderabbitai[bot] avatar Apr 05 '25 01:04 coderabbitai[bot]

should i close this up or is this still a thing?

nkxxll avatar Apr 25 '25 21:04 nkxxll

This will get merged. Was busy in other things. Will take this up and pending PRs soon

lazysegtree avatar Apr 27 '25 02:04 lazysegtree

Right now, I am focussing on getting this done and merged to main

  • https://github.com/yorukot/superfile/pull/775

lazysegtree avatar Apr 27 '25 03:04 lazysegtree

This will get merged. Was busy in other things. Will take this up and pending PRs soon

no worries, take your time 😄

nkxxll avatar Apr 28 '25 06:04 nkxxll

@nkxxll "add default color theme based on terminal" - Does this mean if my terminal is in light mode, spf should open in light mode ? I didn't observe it work like that.

image image

lazysegtree avatar Apr 28 '25 13:04 lazysegtree

Also some colors looks off

image

Process bar color is not visible

image

Directory icon color is black, and background is also black, making it invisible

image

lazysegtree avatar Apr 28 '25 13:04 lazysegtree

And image preview breaks when I use this theme

lazysegtree avatar May 01 '25 10:05 lazysegtree

I try to look into it today...

nkxxll avatar May 04 '25 12:05 nkxxll

And image preview breaks when I use this theme

yes done that pr before image preview was a thing the image preview takes the hex codes and does something with them my hacky trick here is to take ansi codes instead of hex codes because bubble tea has an api that takes either one of the formats and this leads to it working fine...

have to find an fix here but it might be better to just not hack the way into using the double api on bubble tea and instead find the default colors of the terminal some other way

nkxxll avatar May 04 '25 20:05 nkxxll

switched the colors a bit now it looks a bit better but light theme needs another set of colors which would also better be solved with software instead of config because you would need a light and a dark theme

nkxxll avatar May 04 '25 21:05 nkxxll

@nkxxll

Just add a screenshot and add it to the list of themes in website code. Something like this - https://github.com/yorukot/superfile/commit/900af6805896846be8ff83ac5138cacd752f4b4f

lazysegtree avatar May 05 '25 03:05 lazysegtree

@nkxxll To prevent theme issues, we are adding these instruction for theme PRs.

Please add these screenshots in the PR, to make sure that the theme doesn't have any issues

  • Full view of superfile (Including sidebar, file previewer, process panel, metadata panel, and clipboard panel )
    • Make sure that file previewer is non empty, process panel has at least one process, and clipboard has at least one entry
  • Add a screenshot of these individual panel being focussed (To make sure border focus color is good)
    • Sidebar
    • Processbar
  • Add a screenshot of help menu (Press ?)
  • Add a screenshot of popup that opens when you create a new file (Ctrl+n)
  • Add a screenshot of image being preview using your theme.
  • Add a screenshot of successful and unsuccessful shell command.
Example

  • Full view of superfile (Including sidebar, file previewer, process panel, metadata panel, and clipboard panel )
    • Make sure that file previewer is non empty, process panel has at least one process, and clipboard has at least one entry
image
  • Add a screenshot of these individual panel being focussed (To make sure border focus color is good)
    • Sidebar
    • Processbar
image image
  • Add a screenshot of help menu (Press ?) image

  • Add a screenshot of popup that opens when you create a new file (Ctrl+n) image

  • Add a screenshot of image being preview using your theme. image

  • Add a screenshot of successful and unsuccessful shell command. image image

lazysegtree avatar May 05 '25 04:05 lazysegtree

If not reverted back by 15th July, this PR will be considered stale and closed.

lazysegtree avatar May 29 '25 10:05 lazysegtree