Skip to content

Add size / fill / internal scrolling options for Code components #91

Description

@BitRevenant

I would like to request a feature for the Code component, especially when used inside a Tab.

Problem

Right now, the Code component seems to grow based on its content. This makes it hard to use it as a console/log viewer inside a tab.

For example, I would like to create a log console that:

  • fills the available width of the tab
  • has a fixed height or fills the remaining vertical space
  • keeps its size even when there are only a few log lines
  • does not expand the whole tab when there are many logs
  • scrolls internally inside the console area instead of making the entire tab scroll

At the moment, this does not seem possible through the public API.

Suggested API

It would be great if Tab:Code() supported options like:

local Console = Tab:Code({
    Title = "Logs",
    Code = "",
    Width = UDim.new(1, 0),
    Height = UDim.new(1, 0), -- or fixed pixel height
    Fill = true,
    Scrollable = true,
    AutoScroll = true
})

Or maybe something like:

local Console = Tab:Code({
    Title = "Logs",
    Code = "",
    Size = UDim2.new(1, 0, 1, 0),
    MaxHeight = 400,
    Scrollable = true,
    AutoScroll = true
})

Use case

This would make it possible to build a proper console/log viewer:

local Console = LogsTab:Code({
    Title = "Console",
    Code = "",
    Size = UDim2.new(1, 0, 1, 0),
    Scrollable = true,
    AutoScroll = true
})

Console:SetCode("[12:00:00] Started\n[12:00:01] Loaded modules")

The expected behavior would be:

  • the code block stays inside the tab bounds
  • the code area scrolls internally
  • the tab layout does not grow infinitely
  • new logs can optionally auto-scroll to the bottom

Why this would help

The Code component is very useful for displaying logs, debug output, console messages, script status, etc. Adding layout and scrolling options would make it much more flexible without requiring users to hack around the internal WindUI instances.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions